1

I copy this code from Enumerate alignment problem in theorem environment and add \usepackage[unicode,bookmarksnumbered]{hyperref}

\documentclass{article}
\usepackage{amsthm}
\usepackage{fouriernc}
\usepackage[utf8]{vietnam}
\usepackage{amsmath}
\theoremstyle{definition}
\newtheorem{thm}{}[section]
\usepackage[unicode,bookmarksnumbered]{hyperref}
\usepackage{enumerate}
\begin{document}
\section{My theorem}
\begin{thm}\begin{minipage}[t]{\linewidth}
\begin{enumerate}[(a)]
\item This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem  This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem
\item Item 2
\item Item 3
\end{enumerate}
\end{minipage}
\end{thm}
\end{document} 

I got enter image description here

The number 1.1 doesn't align with item (a).

If I remove \usepackage[unicode,bookmarksnumbered]{hyperref}, I got correct align enter image description here

How can I get the correct align?

minthao_2011
  • 4,534
  • 7
  • 36
  • 61
  • hyperref puts the anchor above the list, hence the extra vertical space. If no anchor is needed, you can wrap the first \item in the list (or the entire enumerate or the minipage environments) in a NoHyper environment. – alwaysask Jul 17 '16 at 06:44
  • You are right. Thank you very much. You can write answer and I will accept your answer. – minthao_2011 Jul 17 '16 at 08:55

2 Answers2

1

I think the problem is because hyperref packages redefines the macro and puts anchor for cross referencing. I would prefer the following code:

\documentclass{article}
\usepackage{amsthm}
\usepackage{fouriernc}
\usepackage[utf8]{vietnam}
\usepackage{amsmath}
\theoremstyle{definition}
\newtheorem{thm}{}[section]
\usepackage[unicode,bookmarksnumbered]{hyperref}
\usepackage{lipsum}
\usepackage{enumitem}
\sloppy
\begin{document}
\section{My theorem}
\lipsum[1]
\begin{thm}\begin{minipage}[t]{\linewidth}
\begin{enumerate}[label=(\arabic*),before=\vspace*{-\baselineskip},rightmargin=\leftmargin]
\item This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem  This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem
\item Item 2
\item Item 3
\end{enumerate}
\end{minipage}
\end{thm}
\lipsum[1]
\end{document} 

In the example, I have used enumitem package instead of enumerate.

Jagath
  • 4,287
  • unfortunately, the theorem label is just a bit lower than the first line of the text of item (1). on the other hand, the width of the enumerated paragraph is good. – barbara beeton Jul 17 '16 at 14:55
1

The hyperref package puts the anchor above the list, hence the extra vertical space. If no anchor is needed, you can wrap the first \item in the list or the entire enumerate or the minipage environments in a NoHyper environment. The following MWE is with the enumerate wrapped in NoHyper:

\documentclass{article}
\usepackage{amsthm}
\usepackage{fouriernc}
\usepackage[utf8]{vietnam}
\usepackage{amsmath}
\theoremstyle{definition}
\newtheorem{thm}{}[section]
\usepackage[unicode,bookmarksnumbered]{hyperref}
\usepackage{enumerate}
\begin{document}
    \section{My theorem}
    \begin{thm}
        \begin{minipage}[t]{\linewidth}
           \begin{NoHyper}
            \begin{enumerate}[(a)]
                \item This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem  This is a problem This is a problem This is a problem This is a problem This is a problem This is a problemThis is a problem This is a problem
                \item Item 2
                \item Item 3
            \end{enumerate}
          \end{NoHyper} 
        \end{minipage}
    \end{thm}
\end{document}

Output: enter image description here

alwaysask
  • 2,248
  • 13
  • 16
  • this has a small problem -- using \linewidth as the width of the minipage makes this too wide by the width of the theorem label. – barbara beeton Jul 17 '16 at 14:53