Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyperref adds vertical space at the beginning of enumerate environment when the latter nested in tblr environment #333

Open
gannaiju opened this issue Mar 17, 2024 · 2 comments

Comments

@gannaiju
Copy link

hyperref package adds vertical space at the beginning of the enumerate environment.
Please compare two different compiled result:

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}

\begin{document}

\begin{tblr}{
    hlines,vlines,
    measure = vbox, stretch = -1,
    }
  test & \begin{enumerate}
      \item test 1
      \item test 2
    \end{enumerate} \\ 
  test & test 		
\end{tblr}
\end{document}

The code gets the result:
image
When hyperref package is used, there appears some space at the beginning of the enumerate environment:

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\usepackage{hyperref}

\begin{document}

\begin{tblr}{
    hlines,vlines,
    measure = vbox, stretch = -1,
    }
  test & \begin{enumerate}
      \item test 1
      \item test 2
     \end{enumerate} \\ 
  test & test 		
\end{tblr}
\end{document}

The code above gets the result:
image
which may not desired result.

OS: Win 10 Home Edition
Distribution: TeX Live 2024
Compiler: xelatex

@u-fischer
Copy link
Member

yes, hyperref inserts an anchor and that can affect spacing. You can disable the anchor locally:

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\usepackage{hyperref}

\begin{document}

\begin{tblr}{
    hlines,vlines,
    measure = vbox, stretch = -1,
    }
  test & \begin{enumerate}\LinkTargetOff
      \item \leavevmode\LinkTargetOn   test 1
      \item test 2
     \end{enumerate} \\ 
  test & test 		
\end{tblr}
\end{document}

image

@muzimuzhi
Copy link
Contributor

related: lvjr/tabularray#196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants