项目编号与任务不一致

项目编号与任务不一致

使用枚举和任务时,我遇到了对齐问题。具体来说,当我有一个带有相关任务的“空白”项目时,项目编号和任务编号不会水平对齐。任何建议都很好。谢谢。

\documentclass[10pt]{article}
\usepackage[shortlabels]{enumitem}
\usepackage{tasks}

\begin{document}
\begin{enumerate}[label=\arabic*.]
   \item Some item % Looks ok here
   \begin{tasks}[counter-format=(tsk[a]),item-indent=0em, label-offset=1.00em, ](2)%
      \task Task a
      \task Task b
      \task Task c
      \task Task d
   \end{tasks}
   \item % With no "item", the item # and task #s don't line up horizontally
   \begin{tasks}[counter-format=(tsk[a]),item-indent=0em, label-offset=1.00em, ](2)%
      \task Task a
      \task Task b
      \task Task c
      \task Task d
   \end{tasks}
   \item Another item
\end{enumerate}
\end{document}

答案1

这是一个解决方法:

\documentclass[10pt]{article}
\usepackage[shortlabels]{enumitem}
\usepackage{tasks}

\begin{document}

\begin{enumerate}[label=\arabic*.]
   \item Some item % Looks ok here
   \begin{tasks}[counter-format=(tsk[a]),item-indent=0em, label-offset=1.00em, ](2)%
      \task Task a
      \task Task b
      \task Task c
      \task Task d
   \end{tasks}
   \item \leavevmode\vspace{-\dimexpr\baselineskip+\topsep}%
   \begin{tasks}[counter-format=(tsk[a]),item-indent=0em, label-offset=1.00em](2)%
      \task Task a
      \task Task b
      \task Task c
      \task Task d
   \end{tasks}
   \item Another item
\end{enumerate}

\end{document} 

在此处输入图片描述

相关内容