我从这里复制了这段代码在定理环境中枚举对齐问题
并添加\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}
数字 1.1 与项目 (a) 不一致。
如果我删除\usepackage[unicode,bookmarksnumbered]{hyperref}
,我得到正确的对齐
我怎样才能获得正确的对齐?
答案1
该hyperref
包将锚点放在列表上方,因此有额外的垂直空间。如果不需要锚点,您可以包装\item
列表中的第一个或环境中的整个enumerate
或所有环境。以下 MWE 包装在 中:minipage
NoHyper
enumerate
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}
答案2
我认为问题是由于hyperref
包重新定义了宏并放置了用于交叉引用的锚点。我更喜欢以下代码:
\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}
在示例中,我使用了enumitem
包而不是enumerate
。