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

Package varwidth Warning: “Failed to reprocess entire contents” if hyperref is loaded #367

Open
dbitouze opened this issue Nov 15, 2024 · 4 comments

Comments

@dbitouze
Copy link

The following MCE:

\documentclass{article}
\usepackage{varwidth}
% \usepackage{hyperref}
\begin{document}
\begin{varwidth}[t]{.5\linewidth}
\section{A Section}\label{sec:section}
Cf. section \ref{sec:section}.
\end{varwidth}
\end{document}

is okay but, as soon as hyperref is loaded, it triggers (twice) the following warning:

Package varwidth Warning: Failed to reprocess entire contents on input line 8.

@u-fischer
Copy link
Member

well varwidth doesn't like the bookmark command. You can add some support for it, but generally I would avoid to do to much in a varwidth ...

\documentclass{article}
\usepackage{varwidth,etoolbox}
\usepackage{hyperref}
\makeatletter
\let\@@vwid@addcontentsline\addcontentsline 
\def\@vwid@addcontentsline#1#2#3{\@vwid@wrap{\@@vwid@addcontentsline{#1}{#2}{#3}}}
\preto\@vwid@setup{\let\addcontentsline\@vwid@addcontentsline}
\makeatother
\begin{document}
\begin{varwidth}[t]{.5\linewidth}
\section{blub}
x
\end{varwidth}
\end{document}

@dbitouze
Copy link
Author

generally I would avoid to do to much in a varwidth

I agree with you about direct use, but my real use case is actually based on the standalone package which is based on varwidth. And, AFAICS, standalone is widely used.

@u-fischer
Copy link
Member

standalone is clearly used too much. It is fine for a picture but I don't see the use for a document with a section and hyperref links.

@dbitouze
Copy link
Author

dbitouze commented Nov 15, 2024

My use case is a math article in an “endless” page.

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

2 participants