我正在製定大綱,並意識到我需要另一個枚舉標籤。因此,當我添加第五個並執行相同的 \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}