我正在尝试创建一个待办事项列表,其中包含一列枚举列表。我的 MWE 如下所示。我想移动括号中的小时数,使其与每个新项目对齐(见上图)。感谢您的帮助!
\documentclass[12pt, A4]{article}
\usepackage{multicol}
\renewcommand\labelenumi{\theenumi.} % default is "\theenumi."
\begin{document}
\begin{enumerate}
\item Title Text
\begin{multicols}{2}
\begin{enumerate}
\item Very very very very very Long Text
\item Normal text
\item Normal text
\end{enumerate}
\columnbreak
\hfill (3h) \\
\hfill (2h) \\
\hfill (5.5h) \\
\end{multicols}
\end{enumerate}
\end{document}
答案1
我认为这不multicols
适合。相反,我建议使用包裹enumitem
为列表设置更大的右边距,并使用将等\marginpar
添加(3h)
到该附加边距中:
\documentclass[12pt,a4paper]{article}% Note: A4 would be an unknown an
% therefore unused global option.
\usepackage{enumitem}
\newcommand*{\intextnote}[1]{\leavevmode\marginpar{\makebox[0pt][r]{(#1)\hspace{\marginparsep}}}\ignorespaces}
\usepackage{showframe}% only for debugging to make the text area and other
% page areas visible
\usepackage{blindtext}% only for adding a lot of text easier
\begin{document}
\begin{enumerate}
\item Title Text
\begin{enumerate}[rightmargin=5em]
\item \intextnote{3h}\blindtext
\item \intextnote{2h}Normal text
\item \intextnote{5.5h}Normal text
\end{enumerate}
\end{enumerate}
\end{document}
例如,如果您将其替换rightmargin=5em
为,则rightmargin=\dimexpr.5\textwidth-\columnsep\relax
文本列将像您的示例中一样窄。