3

I want to center an enumerated list so i've tried to use the answer of this question given by the Great David Carlisle. But using hyperref, varwidth and enumerate (in any order in the preamble) cause a failure: the list (which I wish to be centered) is left aligned.

The minipage is due to my real situation.

I would be very grateful if someone could provide a fix and some explanations.

The mwe:

\documentclass{article}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{varwidth}

\begin{document}
\begin{minipage}{\textwidth}
\centering

\begin{varwidth}{\textwidth}% it's OK : "aaa" is centered
aaa
\end{varwidth}

\begin{varwidth}{\textwidth}% Ouch ! the list is left aligned
\begin{enumerate}
\item One
\item Two
\item Three
\end{enumerate}
\end{varwidth}

\end{minipage}
\end{document}

Thanks

P.S. Sorry for the bad English, I do my best.

  • 1
    varwidth is unable to do its working when hyperref is loaded and a list is involved. – egreg Mar 4 '16 at 13:30
  • The Great David Carlisle;-) – user31729 Mar 4 '16 at 13:32
  • @egreg : thanks for the answer. I know you're really busy (on this site at least) but could you explain why is not possible if you have the time (and if you want !) – sbm Mar 4 '16 at 13:36
  • 1
    @sbm I'm not sure of the reason, but apparently the work done by hyperref in order to provide hyperlinks to items hinders the job varwidth wants to perform. Do you need hyperlinks to the items? – egreg Mar 4 '16 at 13:37
  • 1
    @ChristianHupfer I hope the smiley signals agreement not incredulity! – David Carlisle Mar 4 '16 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.