我正在制作大纲,然后意识到我需要另一个枚举标签。因此,当我添加第 5 个并执行相同的 \5 命令时,出现错误,提示“未定义的控制序列”。我该怎么办?请告诉我,谢谢。
\usepackage{outlines}
\usepackage{enumitem}
\setenumerate[1]{label=\Roman*.}
\setenumerate[2]{label=\Alph*.}
\setenumerate[3]{label=\roman*.}
\setenumerate[4]{label=\alph*.}
\setenumerate[5]{label=\arabic*.} %%% Not working%%%%%%
\newcommand{\tbf}[1]{\textbf{#1}}
\newcommand{\tit}[1]{\textit{#1}}
\begin{document}
\1 \tbf{Science}:
\2 stuff 1
\3 stuff 2
\4 Stuff 3
\5 HELP %%% Command not working %%%%%
\end{document}
答案1
以下用途https://tex.stackexchange.com/a/41409/117050添加另一层枚举(这样我们就可以使用第五层)。然后它更改了内部结构outlines
以支持第五层并用作myEnumerate
列表类型。
\documentclass{article}
\usepackage{outlines}
\usepackage{enumitem}
\newlist{myEnumerate}{enumerate}{5}
\setlist[myEnumerate,1]{label=\Roman*.}
\setlist[myEnumerate,2]{label=\Alph*.}
\setlist[myEnumerate,3]{label=\roman*.}
\setlist[myEnumerate,4]{label=\alph*.}
\setlist[myEnumerate,5]{label=\arabic*.}
\newcommand{\tbf}[1]{\textbf{#1}}
\newcommand{\tit}[1]{\textit{#1}}
\usepackage{xpatch}
\makeatletter
\xapptocmd\outline{\newcommand{\5}{\ol@tov\ol@v\item}}{}
{\GenericError{}{Patching `outline` failed}{}{}}
\renewcommand\ol@commands[6]
{%
\renewcommand{\ol@toz}{#1}%
\renewcommand{\ol@toi}{#2}%
\renewcommand{\ol@toii}{#3}%
\renewcommand{\ol@toiii}{#4}%
\renewcommand{\ol@toiiii}{#5}%
\renewcommand{\ol@tov}{#6}%
}
\xapptocmd\ol@exit{{}}{}
{\GenericError{}{Patching `\string\ol@exit` failed}{}{}}
\xapptocmd\ol@z{{\ol@inci\ol@incii\ol@inciii\ol@inciiii\ol@incv}}{}
{\GenericError{}{Patching `\string\ol@z` failed}{}{}}
\xapptocmd\ol@i{{\ol@incii\ol@inciii\ol@inciiii\ol@incv}}{}
{\GenericError{}{Patching `\string\ol@i` failed}{}{}}
\xapptocmd\ol@ii{{\ol@inciii\ol@inciiii\ol@incv}}{}
{\GenericError{}{Patching `\string\ol@ii` failed}{}{}}
\xapptocmd\ol@iii{{\ol@inciiii\ol@incv}}{}
{\GenericError{}{Patching `\string\ol@iii` failed}{}{}}
\xapptocmd\ol@iiii{{\ol@incv}}{}
{\GenericError{}{Patching `\string\ol@iiii` failed}{}{}}
\newcommand\ol@v
{%
\ol@commands
{\ol@decv\ol@deciiii\ol@deciii\ol@decii\ol@deci}
{\ol@decv\ol@deciiii\ol@deciii\ol@decii}
{\ol@decv\ol@deciiii\ol@deciii}
{\ol@decv\ol@deciiii}
{\ol@decv}
{}%
}
\newcommand\outlinev{\ol@type}
\newcommand\ol@incv{\begin{\outlinev}}
\newcommand\ol@decv{\end{\outlinev}}
\newcommand\ol@tov{}
\renewcommand\ol@type{myEnumerate}
\makeatother
\begin{document}
\begin{outline}
\1 \tbf{Science}:
\2 stuff 1
\3 stuff 2
\4 Stuff 3
\5 HELP %%% Command not working %%%%%
\end{outline}
\end{document}