我使用描述环境来输入逐项列表...形式中有很多代码片段
\begin{description}
\item [(1)] some text
\item [(2)] some text
\item [(3)] some text
\item [(4)] some text
\end{description}
\begin{description}
\item [(11)] some text
\item [(22)] some text
\item [(33)] some text
\item [(44)] some text
\end{description}
\begin{description}
\item [(111)] some text
\item [(222)] some text
\item [(333)] some text
\item [(444)] some text
\end{description}
问题是,对于每个第一行,即
\item [(1)] some text
\item [(11)] some text
\item [(111)] some text
日志文件中显示下一条消息:
Missing control sequence inserted
Please don't say `\def cs{...}', say `\def\cs{...}'.
I've inserted an inaccessible control sequence so that your
definition will be completed without mixing me up too badly.
You can recover graciously from this error, if you're
careful; see exercise 27.2 in The TeXbook.
这个问题似乎不会影响过程的结果,但我想抑制它。有人可以帮助我解决这种情况吗?
答案 ==> 我解决了这个问题!!在我的代码中我使用命令
\setlist[itemize,1]{font=\color{itemizeColor1}\bfseries,label=$\bullet$}
\setlist[itemize,2]{font=\color{itemizeColor2}\bfseries,label=$\blacktriangleright$}
\setlist[itemize,3]{font=\color{itemizeColor3}\bfseries,label=$\bigstar$}
设置标签的字体和颜色,但带有描述,正确的语法只是
\setlist[description,1]{font=\color{itemizeColor1}\bfseries}
\setlist[description,2]{font=\color{itemizeColor2}\bfseries}
\setlist[description,3]{font=\color{itemizeColor3}\bfseries}
最后一个“标签”参数是导致问题的参数。当我删除它时,问题解决了...
答案1
我怀疑您想要或多或少类似的东西,其中枚举是自动的,并且标签不会流入边缘,带有选项wide
,这意味着标签是left-aligned
;否right-aligned
,这是默认设置:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\begin{document}
\setlist[enumerate]{wide = 0pt, leftmargin = *, font = \bfseries}
\setlist[enumerate, 1]{label = (\arabic*)}
\setlist[enumerate, 2]{label = (\arabic{enumi}.\arabic*) }
\setlist[enumerate, 3]{label = (\arabic{enumi}.\arabic{enumii}.\arabic*)}
\begin{enumerate}[ widest = (0)]
\item some text
\begin{enumerate}[leftmargin = *]
\item some text
\item some text
\end{enumerate}
\item some text
\begin{enumerate}
\item some text
\item some text
\item some text
\end{enumerate}
\item some text
\begin{enumerate}
\item some text. Some more text. Some more text.Some more text. Some more text. Some more text. Some more text.Some more text. Some more text.
\item some text
\begin{enumerate}
\item some text
\item some text
\item some text
\end{enumerate}
\end{enumerate}
\item [(4)] some text
\end{enumerate}
\end{document}