使用 enumitem 包和我的标头会导致枚举列表无法编译

使用 enumitem 包和我的标头会导致枚举列表无法编译

我正在尝试解决这个问题物品上的压痕 但我的标题有些不协调。

这可以编译并且看起来像我想要的那样,但是没有枚举列表:

\documentclass[a4paper, english]{scrartcl}
\usepackage[margin=3.2cm,  includefoot,  footskip=30pt,]{geometry}
\usepackage{changepage, enumitem}
%\usepackage{changepage}

\usepackage{natbib}
\usepackage{verbatim}
\usepackage{url}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfigure} 
\usepackage{setspace}
\onehalfspacing
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx} % for images
\usepackage{color,soul} % for highlights
\usepackage[hidelinks]{hyperref} %for links
\usepackage{placeins}
\usepackage{enumerate}

% for equation caption
\usepackage{amsmath}
\usepackage{caption}
\DeclareCaptionType{mycapequ}[][List of equations]
\captionsetup[mycapequ]{labelformat=empty}

\oddsidemargin=0.15in
\evensidemargin=0.15in
\topmargin=-.5in
\textheight=9in
\textwidth=6.25in

\usepackage{refcount}

\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\tab}[1]{\hspace{.2\textwidth}\rlap{#1}}
\newcommand{\todo}[1]{{\color{red}\bf TODO: #1}}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}

\usepackage{array}
\usepackage{tabulary}
\newcolumntype{K}[1]{>{\centering\arraybackslash}m{#1}}

\usepackage{multirow}
\usepackage{multicol}


\begin{document}


bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\begin{adjustwidth}{1cm}{3cm}
\begin{itemize}[align = left]
\item[Input:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\item[Output:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\end{itemize}
\end{adjustwidth}
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 


%\begin{enumerate}
%\item bla bla bla bla
%\item bla bla bla bla
%\item bla bla bla bla
%\end{enumerate}

\end{document}

在此处输入图片描述

这编译并具有枚举列表但看起来并不像我想要的那样:

\documentclass[a4paper, english]{scrartcl}
\usepackage[margin=3.2cm,  includefoot,  footskip=30pt,]{geometry}
%\usepackage{changepage, enumitem}
\usepackage{changepage}

\usepackage{natbib}
\usepackage{verbatim}
\usepackage{url}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfigure} 
\usepackage{setspace}
\onehalfspacing
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx} % for images
\usepackage{color,soul} % for highlights
\usepackage[hidelinks]{hyperref} %for links
\usepackage{placeins}
\usepackage{enumerate}

% for equation caption
\usepackage{amsmath}
\usepackage{caption}
\DeclareCaptionType{mycapequ}[][List of equations]
\captionsetup[mycapequ]{labelformat=empty}

\oddsidemargin=0.15in
\evensidemargin=0.15in
\topmargin=-.5in
\textheight=9in
\textwidth=6.25in

\usepackage{refcount}

\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\tab}[1]{\hspace{.2\textwidth}\rlap{#1}}
\newcommand{\todo}[1]{{\color{red}\bf TODO: #1}}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}

\usepackage{array}
\usepackage{tabulary}
\newcolumntype{K}[1]{>{\centering\arraybackslash}m{#1}}

\usepackage{multirow}
\usepackage{multicol}


\begin{document}


bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\begin{adjustwidth}{1cm}{3cm}
\begin{itemize}%[align = left]
\item[Input:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\item[Output:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\end{itemize}
\end{adjustwidth}
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 


\begin{enumerate}
\item bla bla bla bla
\item bla bla bla bla
\item bla bla bla bla
\end{enumerate}

\end{document}

在此处输入图片描述

这不能编译:

\documentclass[a4paper, english]{scrartcl}
\usepackage[margin=3.2cm,  includefoot,  footskip=30pt,]{geometry}
\usepackage{changepage, enumitem}
%\usepackage{changepage}

\usepackage{natbib}
\usepackage{verbatim}
\usepackage{url}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfigure} 
\usepackage{setspace}
\onehalfspacing
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx} % for images
\usepackage{color,soul} % for highlights
\usepackage[hidelinks]{hyperref} %for links
\usepackage{placeins}
\usepackage{enumerate}

% for equation caption
\usepackage{amsmath}
\usepackage{caption}
\DeclareCaptionType{mycapequ}[][List of equations]
\captionsetup[mycapequ]{labelformat=empty}

\oddsidemargin=0.15in
\evensidemargin=0.15in
\topmargin=-.5in
\textheight=9in
\textwidth=6.25in

\usepackage{refcount}

\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\tab}[1]{\hspace{.2\textwidth}\rlap{#1}}
\newcommand{\todo}[1]{{\color{red}\bf TODO: #1}}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}

\usepackage{array}
\usepackage{tabulary}
\newcolumntype{K}[1]{>{\centering\arraybackslash}m{#1}}

\usepackage{multirow}
\usepackage{multicol}


\begin{document}


bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\begin{adjustwidth}{1cm}{3cm}
\begin{itemize}[align = left]
\item[Input:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\item[Output:]  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 
\end{itemize}
\end{adjustwidth}
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla 


\begin{enumerate}
\item bla bla bla bla
\item bla bla bla bla
\item bla bla bla bla
\end{enumerate}

\end{document}

这是我收到的错误消息:

! Undefined control sequence.\enit@endenumerate ->\enit@after\endlist \ifx \enit@series \relax \else \if... \end{enumerate}

到底是怎么回事?

答案1

您的编译问题是由于同时加载enumerateenumitem冲突造成的。

我清理并简化了您的代码,删除了与您的问题无关的任何包加载。特别是,我认为您adjustwidth在这里不需要环境,因为enumitem为列表环境提供了相同的功能。此外,description环境比更适合第一个列表itemize

因此希望以下代码能够提供您想要的布局:

\documentclass[a4paper, english]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[margin=3.2cm, width=6.25in, height=9in, hmargin =1.15in, includefoot, footskip=30pt,]{geometry}
\usepackage{ enumitem}
\usepackage{setspace}
\onehalfspacing

\begin{document}

bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

\begin{description}[font=\normalfont, labelindent=1cm, nosep, leftmargin=1.5cm, rightmargin=3cm]%
  \item[Input:] bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  \item[Output:] bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
\end{description}
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

\begin{enumerate}[wide=1cm, leftmargin=*]
  \item bla bla bla bla
  \item bla bla bla bla
  \item bla bla bla bla
\end{enumerate}

\end{document} 

在此处输入图片描述

答案2

您不能同时使用enumitem和包,并且 as具有所有功能以及附加功能是没有意义的。如果您删除enumerateenumitemenumerate

\usepackage{enumerate}

相关内容