增加枚举环境的最大数量?

增加枚举环境的最大数量?

我正在使用该outlines软件包编写一些大纲,有时四个级别不足以呈现我的数据。我理解这是 LaTeX 的限制,因为您不能嵌套超过四个级别的enumerate环境。有没有办法增加这个限制?如果没有,为什么限制正好是四个?

答案1

outlines添加另一个层/深度不够灵活。几乎需要重写整个包才能添加一个层:

在此处输入图片描述

\documentclass{article}

\usepackage{outlines,xcolor,enumitem}

\makeatletter
\newcommand{\outlinev}{\ol@type}
\newcommand{\ol@incv}{\begin{\outlinev}}
\newcommand{\ol@decv}{\end{\outlinev}}
\newcommand{\ol@tov}{}
\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}%
}
\renewcommand{\ol@exit}{%
  \ol@commands{}{}{}{}{}{}}
\renewcommand{\ol@z}{%
  \ol@commands%
    {}%
    {\ol@inci}%
    {\ol@inci\ol@incii}%
    {\ol@inci\ol@incii\ol@inciii}%
    {\ol@inci\ol@incii\ol@inciii\ol@inciiii}%
    {\ol@inci\ol@incii\ol@inciii\ol@inciiii\ol@incv}}
\renewcommand{\ol@i}{%
  \ol@commands%
    {\ol@deci}%
    {}%
    {\ol@incii}%
    {\ol@incii\ol@inciii}%
    {\ol@incii\ol@inciii\ol@inciiii}%
    {\ol@incii\ol@inciii\ol@inciiii\ol@incv}}
\renewcommand{\ol@ii}{%
  \ol@commands%
    {\ol@decii\ol@deci}%
    {\ol@decii}%
    {}%
    {\ol@inciii}%
    {\ol@inciii\ol@inciiii}%
    {\ol@inciii\ol@inciiii\ol@incv}}
\renewcommand{\ol@iii}{%
  \ol@commands%
    {\ol@deciii\ol@decii\ol@deci}%
    {\ol@deciii\ol@decii}%
    {\ol@deciii}%
    {}%
    {\ol@inciiii}%
    {\ol@inciiii\ol@incv}}
\renewcommand{\ol@iiii}{%
  \ol@commands%
    {\ol@deciiii\ol@deciii\ol@decii\ol@deci}%
    {\ol@deciiii\ol@deciii\ol@decii}%
    {\ol@deciiii\ol@deciii}%
    {\ol@deciiii}%
    {}%
    {\ol@incv}}
\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}%
    {}}

\renewenvironment{outline}[1][]{%
  \ifthenelse{\equal{#1}{}}{}{\renewcommand{\ol@type}{#1}}%
  \ol@z%
  \newcommand{\0}{\ol@toz\ol@z}%
  \newcommand{\1}{\ol@toi\ol@i\item}%
  \newcommand{\2}{\ol@toii\ol@ii\item}%
  \newcommand{\3}{\ol@toiii\ol@iii\item}%
  \newcommand{\4}{\ol@toiiii\ol@iiii\item}%
  \newcommand{\5}{\ol@tov\ol@v\item}%
}{%
  \ol@toz\ol@exit%
}
\makeatother

\newlist{deepoutline}{enumerate}{5}

\setlist[deepoutline,1]{label=\color{red}\Roman*.}
\setlist[deepoutline,2]{label=\color{blue}\Alph*.}
\setlist[deepoutline,3]{label=\arabic*.}
\setlist[deepoutline,4]{label=\alph*.}
\setlist[deepoutline,5]{label=\color{green}\Roman*.}

\begin{document}

\begin{outline}[deepoutline]
  \1 Heading type 1
    \2 Heading type 2
      \3 Outline type 1
        \4 Outline type 2
          \5 Outline type X
\end{outline}

\end{document}

主要思想是创建一个新的列表类型(deepoutline上面),其中包含您想要概述的更深层次的内容。

相关内容