枚举环境中的缩进问题

枚举环境中的缩进问题

我想要生成一个缩进如下的列表:

在此处输入图片描述

我的乳胶工作如下:

\documentclass[12pt]{article}

\usepackage{times,color,pdfpages,epsf, graphicx,setspace,parskip,mathrsfs,enumerate,fancyhdr,lastpage,amsmath,amssymb,amscd,amsthm,amsfonts,array,paralist,subcaption,framed,epsf,helvet,scrextend,ragged2e}
\usepackage[a4paper, margin=1in, headsep=.2in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[none]{hyphenat}
\usepackage[labelfont=bf]{caption}
\setlength{\labelsep}{.215in}
\usepackage[shortlabels]{enumitem}

\newcommand{\di}{\displaystyle}
\newcommand{\rvline}{\hspace*{-\arraycolsep}\vline\hspace*{-\arraycolsep}}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\arraystretch}{1.5}
\setlength{\footskip}{32pt}
\cfoot{\fontsize{12pt}{12pt}
    \selectfont{\thepage
        %       \ of \pageref{LastPage}
    }
}

\setlength\parindent{0pt}
\linespread{1.35}


\def\endpaper{\centering\textbf{END OF QUESTION PAPER}}
%\def\endpaper{\centering\textbf{-END OF MARKING SCHEME-}}

\begin{document}
    
    %% choose cover
    \include{Titlepage_paper}  %Use cover for paper
    %\include{Titlepage_markingscheme} %Use cover for marking scheme
    
    \rhead{\textbf{2122I/BUM1433}
        %   T\Sessionshort/\Coursecode
        %   /\Version
    }
    \lhead{\textbf{CONFIDENTIAL}}   
    \onehalfspacing
    \renewcommand{\arraystretch}{1.5}
    
    \clearpage
    \setcounter{page}{2}
    
    \begin{enumerate}[labelsep=1cm, label=(\alph*), itemindent=0.65cm, leftmargin=0.8cm]
        \item Basket Robbins will launch two new flavors in 2023 for Eid-Fitr that are chocolate mint and chocolate caramel. A few months prior to the lunch, they distributed the sample of the flavors to $360$ respondents to collect their feedback. It was found that $25\%$ of them like both flavors, $15\%$ of them do not like both flavors and half of them like the chocolate mint flavor only.
    \end{enumerate}

\endpaper

\end{document}

其结果如下:

在此处输入图片描述

我怎样才能修复这个问题?

答案1

我建议你更换

itemindent=0.65cm,leftmargin=0.8cm

left=0pt,align=left

在此处输入图片描述

geometry因为我已经使用选项加载了包,所以绘制了文本块和标题行周围的框线showframe


我在这里和那里注释了您的代码:

\documentclass[12pt]{article}

\usepackage{%
      %times,  % see below
      %helvet, % see below
      %color,
      xcolor,
      pdfpages,
      %epsf, % not needed
      graphicx,setspace,parskip,mathrsfs,
      %enumerate, % don't load both 'enumerate' anf 'enumitem'
      fancyhdr,lastpage,
      amsmath,amssymb,
      %amscd,    % redundant
      %amsfonts, % redundant
      amsthm,
      newtxtext,newtxmath, % Times Roman text and math font
      array,paralist,subcaption,framed,
      %epsf, % not needed/don't load packages twice
      scrextend,ragged2e}
\usepackage[scaled=0.86]{helvet} % match x-height of Times Roman

\usepackage[a4paper, margin=1in, headsep=.2in, showframe
           ]{geometry}
\usepackage[T1]{fontenc}
\usepackage[none]{hyphenat}
\usepackage[labelfont=bf]{caption}
%\setlength{\labelsep}{.215in}
\usepackage[shortlabels]{enumitem}

\newcommand{\di}{\displaystyle}
\newcommand{\rvline}{\hspace*{-\arraycolsep}\vline\hspace*{-\arraycolsep}}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\arraystretch}{1.5}
\setlength{\footskip}{32pt}
\cfoot{\fontsize{12pt}{14.4pt}\selectfont%
        {\thepage%
        %       \ of \pageref{LastPage}
        }
      }

%\setlength\parindent{0pt} % redundant
%\linespread{1.35}

\def\endpaper{\par\centering\textbf{END OF QUESTION PAPER}\par}
%\def\endpaper{\centering\textbf{-END OF MARKING SCHEME-}}

\begin{document}
    
%% choose cover
%%\include{Titlepage_paper}  %Use cover for paper
%\include{Titlepage_markingscheme} %Use cover for marking scheme
    
    \rhead{\textbf{2122I/BUM1433}}
    \lhead{\textbf{CONFIDENTIAL}}   
    \onehalfspacing
    %% \renewcommand{\arraystretch}{1.5} % see above
    
    \clearpage
    \setcounter{page}{2}
    
    \begin{enumerate}[label=(\alph*), 
                      %itemindent=0.65cm,leftmargin=0.8cm
                      left=0pt,align=left, % <-- new
                      labelsep=1cm]

    \item Basket Robbins will launch two new flavors in 2023 for Eid-Fitr that are chocolate mint and chocolate caramel. A few months prior to the lunch, they distributed the sample of the flavors to $360$ respondents to collect their feedback. It was found that $25\%$ of them like both flavors, $15\%$ of them do not like both flavors and half of them like the chocolate mint flavor only.
    \end{enumerate}

\endpaper

\end{document}

答案2

像这样吗?

在此处输入图片描述

您可以在序言中使用 的全局设置\setlist[enumerate]{...}来设置列表,然后使用 为每个级别使用其他设置\setlist[enumerate,n]{...}。另外,文档演示哪个长度名称对应列表的哪个部分。

\documentclass[12pt]{article}
\usepackage{times,color,pdfpages,epsf, graphicx,setspace,parskip,mathrsfs,enumerate,fancyhdr,lastpage,amsmath,amssymb,amscd,amsthm,amsfonts,array,paralist,subcaption,framed,epsf,helvet,scrextend,ragged2e}
\usepackage[a4paper, margin=1in, headsep=.2in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[none]{hyphenat}
\usepackage[labelfont=bf]{caption}
\setlength{\labelsep}{.215in}
\usepackage[shortlabels]{enumitem}

\usepackage{kantlipsum}   % <--- New package for dummy text


\newcommand{\di}{\displaystyle}
\newcommand{\rvline}{\hspace*{-\arraycolsep}\vline\hspace*{-\arraycolsep}}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\arraystretch}{1.5}
\setlength{\footskip}{32pt}
\cfoot{\fontsize{12pt}{12pt}
    \selectfont{\thepage
        %       \ of \pageref{LastPage}
    }
}
\setlength\parindent{0pt}
\linespread{1.35}

\setlist[enumerate]{                    % <--- New content
    labelwidth=1cm,
    labelsep=0cm,
    align=left,
    itemindent=0cm,
    leftmargin=1cm
}
\setlist[enumerate,1]{label=(\alph*)}    % New content
\setlist[enumerate,2]{label=\roman*)}   % New content

\def\endpaper{\centering\textbf{END OF QUESTION PAPER}}
%\def\endpaper{\centering\textbf{-END OF MARKING SCHEME-}}


\begin{document}
    
    %% choose cover
    \include{Titlepage_paper}  %Use cover for paper
    %\include{Titlepage_markingscheme} %Use cover for marking scheme
    
    \rhead{\textbf{2122I/BUM1433}
        %   T\Sessionshort/\Coursecode
        %   /\Version
    }
    \lhead{\textbf{CONFIDENTIAL}}   
    \onehalfspacing
    \renewcommand{\arraystretch}{1.5}
    
    \clearpage
    \setcounter{page}{2}
    
    \begin{enumerate}
        \item Basket Robbins will launch two new flavors in 2023 for Eid-Fitr that are chocolate mint and chocolate caramel. A few months prior to the lunch, they distributed the sample of the flavors to $360$ respondents to collect their feedback. It was found that $25\%$ of them like both flavors, $15\%$ of them do not like both flavors and half of them like the chocolate mint flavor only.
        \begin{enumerate}
            \item \kant[1][1]
            \item \kant[1][2]
        \end{enumerate}
        \item \kant[2][1]
    \end{enumerate}

\endpaper

\end{document}

相关内容