两个枚举命令,一个计数器(这不仅仅是“恢复列表”)

两个枚举命令,一个计数器(这不仅仅是“恢复列表”)

我正在创建一个使用编号列表的文档。我的列表有两个环境:常规枚举命令(一列)和个性化的两列枚举命令。我不知道这方面的正确词汇是什么,非常抱歉,我对 Latex 还不熟悉。

\documentclass[twoside]{article}
\usepackage{amsmath,amsfonts,amssymb,graphicx,mathtools,flexisym,tasks,enumitem,multicol,mdframed,tabularx}

%my itemized lists in two columns
\NewTasks[style=enumerate]{myitemize}[\item](2)

\begin{document}

\begin{enumerate} % this should be numbered 1, 2
\item this is in one column
\item because this problem is worked horizontally
\end{enumerate}

\begin{myitemize} % this should be numbered 3, 4 in the first row and 5, 6 in the second row, etc.
\item but these problems
\item are in two columns
\item because they are better
\item when worked vertically
\end{myitemize}

\begin{enumerate} % this should be numbered 8, 9
\item but then you have to do some writing
\item which happens horizontally
\item so we are back to one column
\end{enumerate}
\end{document}

尽管格式有所改变,但我希望继续使用数字系统。因此,我们应该看到每个项目都按 1-9 连续编号。我相信您知道,每次计数都会重置。我尝试使用 [resume] 并手动更改计数器,但这并不好,因为我经常随意返回并将项目添加到我的列表中。注意:[resume] 对 enumerate 和 myitemize 命令都非常有用!但它们不能一起工作。

我觉得这很接近:恢复在小页面内开始的列表但这不是我所需要的,因为我已经定义了自己的列表制作功能。我尝试使用 [resume*, start=5],但它似乎不适用于我的两列命令。我也在探索这一点:如何在多列环境中恢复列表编号(枚举列表)但是它并没有按照我想要的方式进行编号(也就是说,它是沿着列向下计数,而不是跨行计数,这是我已经惊慌地提交的一个问题两列数字问题)。

提前感谢您,如果需要,我很乐意澄清。

答案1

\NewTasks命令非常灵活:

\documentclass[twoside]{article}
\usepackage{mathtools, amsfonts, amssymb, graphicx, flexisym, tasks, enumitem, multicol, mdframed, tabularx}

%my itemized lists in two columns by default
\NewTasks[style=enumerate]{myitemize}[\item](2)

\begin{document}

\begin{myitemize}(1)
  \item this is in one column
  \item because this problem is worked horizontally
\end{myitemize}

\begin{myitemize}[resume]%
  \item but these problems
  \item are in two columns
  \item because they are better
  \item when worked vertically
\end{myitemize}

\begin{myitemize}[resume](1)%
  \item but then you have to do some writing
  \item which happens horizontally
  \item so we are back to one column
\end{myitemize}

\end{document} 

在此处输入图片描述

相关内容