如何在LaTex中的枚举之间左对齐文本?

时间:2018-12-04 01:46:24

标签: latex

\begin{enumerate}
\def\labelenumi{\Alph{enumi}.}
\item
The \textbf{Definition} of ``Period of Restoration'' is replaced by
the following:

\begin{enumerate}
\def\labelenumii{\arabic{enumii}.}
\setcounter{enumii}{2}
\item
``Period of Restoration'' means the period of time that:

\begin{enumerate}
\def\labelenumiii{\alph{enumiii}.}
\item
  Begins:

  \begin{enumerate}
  \def\labelenumiv{(\arabic{enumiv})}
  \item
    72 hours after the time of direct physical loss or damage for
    Business Income coverage; or
  \item
    Immediately after the time of direct physical loss or damage for
    Extra Expense coverage;
  \end{enumerate}

  caused by or resulting from any Covered Cause of Loss at the
  described premises; and
\item
  Ends on the earlier of:

  \begin{enumerate}
  \def\labelenumiv{(\arabic{enumiv})}
  \item
    The day before the opening of the next school term following the
    date when, with reasonable speed and similar quality, the
    property at the described premises should be repaired, rebuilt
    or replaced; or
  \item
    The date when the school term is resumed at a new permanent
    location.
  \end{enumerate}

“恢复期”不包括由于执行以下任何法令或法律而需要的任何延长期限:

我需要最后一行在b下对齐。并且在(2)下排成一列

我得到这个:

Result

3 个答案:

答案 0 :(得分:0)

我相信您需要在“日期...永久位置”之后加上两个\ end {enumerate}。线。

\documentclass[]{article}
\begin{document}


\begin{enumerate}
    \def\labelenumi{\Alph{enumi}.}
    \item
    The \textbf{Definition} of ``Period of Restoration'' is replaced by
    the following:

    \begin{enumerate}
        \def\labelenumii{\arabic{enumii}.}
        \setcounter{enumii}{2}
        \item
        ``Period of Restoration'' means the period of time that:

        \begin{enumerate}
            \def\labelenumiii{\alph{enumiii}.}
            \item
            Begins:

            \begin{enumerate}
                \def\labelenumiv{(\arabic{enumiv})}
                \item
                72 hours after the time of direct physical loss or damage for
                Business Income coverage; or
                \item
                Immediately after the time of direct physical loss or damage for
                Extra Expense coverage;
            \end{enumerate}

            caused by or resulting from any Covered Cause of Loss at the
            described premises; and
            \item
            Ends on the earlier of:

            \begin{enumerate}
                \def\labelenumiv{(\arabic{enumiv})}
                \item
                The day before the opening of the next school term following the
                date when, with reasonable speed and similar quality, the
                property at the described premises should be repaired, rebuilt
                or replaced; or
                \item
                The date when the school term is resumed at a new permanent
                location.
            \end{enumerate}

        \end{enumerate}

        ``Period of Restoration" does not include any increased period required due to the enforcement of any ordinance or law that:

    \end{enumerate}

\end{enumerate}

\end{document}

第一个\ end {enumerate}使您从“上学日期...”中的T对齐到与(2)对齐。您还需要一个才能使它与b对齐。

如果您需要从上次中断的地方(3c,3d等)处提取列表,则可以使用\ setcounter进行操作,这样它就不会从a处重新开始;这是一个例子:

\documentclass[]{article}
\begin{document}

\begin{enumerate}
\item text
\item text
\item text
\end{enumerate}

Text Text Text

\begin{enumerate}
\setcounter{enumi}{3}
\item pickup where left off
\item text
\end{enumerate}

\end{document}

答案 1 :(得分:0)

您必须使用\noindent 您只是缩进了;)

答案 2 :(得分:0)

我写了一个叫做unclip的小宏。

与所有小写字母一起使用时,它将结束列表,写入给定的内容,然后恢复列表。 与大写U一起使用时,它将在写入内容之前收集枚举数,并在恢复列表时将其还原。

\newcommand{\unclip}[2][enumerate]{\end{#1}#2\begin{#1}}%
\makeatletter
\newcommand{\Unclip}[2][enumerate]{%
  \@ifundefined{c@saveenum@\romannumeral\@enumdepth}%    create temporary counter
    {\newcounter{saveenum@\romannumeral\@enumdepth}}{}%
  \setcounter{saveenum@\romannumeral\@enumdepth}%        store item number
    {\value{enum\romannumeral\@enumdepth}}%
  \end{#1}#2\begin{#1}%                                  end list, write content, resume
  \setcounter{enum\romannumeral\@enumdepth}%             restore item number
    {\value{saveenum@\romannumeral\@enumdepth}}}%
\makeatother

您可以将其堆叠为多个级别。请注意,如果将其堆叠,可能会产生错误,除非在每次内部调用之后都使用\ item []。它仍然会编译。

广泛的示例:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\newcommand{\unclip}[2][enumerate]{\end{#1}#2\begin{#1}}%
\makeatletter
\newcommand{\Unclip}[2][enumerate]{%
  \@ifundefined{c@saveenum@\romannumeral\@enumdepth}%    create temporary counter
    {\newcounter{saveenum@\romannumeral\@enumdepth}}{}%
  \setcounter{saveenum@\romannumeral\@enumdepth}%        store item number
    {\value{enum\romannumeral\@enumdepth}}%
  \end{#1}#2\begin{#1}%                                  end list, write content, resume
  \setcounter{enum\romannumeral\@enumdepth}%             restore item number
    {\value{saveenum@\romannumeral\@enumdepth}}}%
\makeatother

\begin{document}

\begin{itemize}
  \item TestItem A
  \begin{description}
    \item[preparation] No Item-number yet, so only smallercase unclip
    \item[test] and action:
    \unclip[description]{This should be below \textit{TestItem A}}
    \item[Test] And now inside a enumeration:
    \begin{enumerate}
      \item One
      \item Two
      \Unclip{This should be under \textit{Test}}
      \item Three
      \Unclip{But now we are stacking, by calling
        \textbackslash Unclip\{\textbackslash unclip[description]\{text\}\}
        \unclip[description]{so this should be under \textit{TestItem A}
        \\Be aware it will raise an error, eventhough it works fine.
        \unclip[itemize]{And while you can have text in front of an inner unclip,
        doing it the other way round would seriously fuck up your layout.}}}
      \item Four
      \begin{enumerate}
        \item Unus
        \item Duo
        \item Tres
        \Unclip{Yes, you can \Unclip{unclip multiple
          \unclip[description]{levels just fine.
          \unclip[itemize]{Still works. :-)}}}}
        \item Quattuor
        \Unclip{\Unclip{\unclip[description]{\unclip[itemize]{By the way:}
          \item[]You can get rid of the errors,}\item[and] stack it back in}
          \item[] by using \textbackslash item[] after the inner unclips}
        \item Quinque
        \item \dots
      \end{enumerate}
    \end{enumerate}
  \end{description}
  \item TestItem B
\end{itemize}

\end{document}

我希望它会有所帮助。 干杯。