3

Why hyperref influence on defining a style for new list which is based on enumerate?

In a case, when you need lists in tables is handy to define new list, something like is done in the following MWE:

\documentclass{article}
\usepackage{enumitem}
    \newlist{tabenum}{enumerate}{1}% <-- defined new list
    \setlist[tabenum]{nosep,
                     leftmargin=*,
                     label={\textbf{\arabic*.}},
                     before=\begin{minipage}[t]{\linewidth},    % <---
                     after=\end{minipage}                       % <---
                     }
    \newlist{tabitem}{itemize}{1}% <-- defined new list
    \setlist[tabitem]{nosep,
                     leftmargin=*,
                     label=\textbullet,
                     before=\begin{minipage}[t]{\linewidth},    % <---
                     after=\end{minipage}                       % <---
                     }
\usepackage{tabularx}
\renewcommand\arraystretch{1.2}
%\usepackage{hyperref}

\begin{document} \begin{tabularx}{\textwidth}{|X|X|} \hline Column 1 Heading & Column 2 Heading \ \hline \begin{tabitem} \item Item 1 \item Item 2 \end{tabitem} & \begin{tabenum} \item Lorem ipsum dolor sit amet, consectetur adipisicing elit. \item More and more lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. \end{tabenum}\ \hline \end{tabularx} \end{document}

which gives expected result:

enter image description here

however, if in above WME I load hyperref package, the result is different, but only at tabenum:

enter image description here

Can be this considered as bug or I doing something wrong in definition of the tabenum list?

Zarko
  • 296,517
  • You can overcome this by adding the nohyper environment in your definition of the tabenum environment. See for example: https://tex.stackexchange.com/a/578888/134144 – leandriis Apr 11 '21 at 07:32
  • See also https://tex.stackexchange.com/q/423014/2388 – Ulrike Fischer Apr 11 '21 at 08:59
  • @leandriis, thank you very much for the link. Your solution works fine, if tables doesn't contain mix of itemize and enumerate based new lists. In my case the last item in \tabitem spill out of left border of column (or minipage). – Zarko Apr 11 '21 at 10:12
  • @UlrikeFischer, thank you very much for information. Your and Heiko answer gives me some ideas how can i solve my problem. Actually, now I search how to determine height of hyperref marker. So far I estimated (by trial and error method) that is about 0.6\baselineskip. – Zarko Apr 11 '21 at 10:24
  • don't rely to much on this, I'm hopping that we can change the behaviour in some not to far feature and move the creation of the destination to a better place. – Ulrike Fischer Apr 11 '21 at 10:37
  • @UlrikeFischer, you are right. Meanwhile I will stick by my estimation and considering it in tabenum definition. – Zarko Apr 11 '21 at 10:44

0 Answers0