繁体   English   中英

第一个元素上的 LaTeX 不需要的逐项缩进

[英]LaTeX unwanted itemize indentation on first element

在我的文档中,每当我使用itemize时,第一个元素都有不需要的缩进。 在我使用\ident的每一章中,这会导致问题吗? 如何修复不需要的缩进? 我想保留标准的逐项缩进,只调整第一项。 该文档正在 Overleaf 上编辑。

这就是它的样子:

这就是它的样子:

我的目标

我的目标

这是一个示例代码,它为我复制了这个问题:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage[table,xcdraw]{xcolor}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[toc,page]{appendix}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{float}
\usepackage[numbers]{natbib}
\usepackage{textcomp}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{commath}
\usepackage{transparent}
\usepackage[T1]{fontenc}
\usepackage{amsfonts}
\usepackage{adjustbox}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
 breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Your Title},
 pdfauthor={Your Name},
 pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}
\makeatletter
\providecommand{\tabularnewline}{\\}
\usepackage[caption=false,font=footnotesize]{subfig} 
\usepackage[caption=false,font=footnotesize]{subfig}
\@ifundefined{showcaptionsetup}{}{%
\PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother

\usepackage{makecell}
\usepackage[official]{eurosym}
\usepackage{comment}
\usepackage{booktabs}

%-----------HEADER AND FOOTER DEFINITION-----------%

\usepackage{fancyhdr}
\renewcommand{\headheight}{0.7in}
\setlength{\headwidth}{\textwidth}
\rhead{% left
\raisebox{0.25in}{\textcolor{gray}{\large Namen}}
}
\lhead{ % right
  % \transparent{0.5}\includegraphics[height=0.6in]{Logo_novo_FEUPbranco.jpg}
}
\pagestyle{fancy}
%\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}




%\usepackage{eurosym}
\usepackage[section]{placeins}

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}

\makeatletter
\newcommand{\chapterauthor}[1]{%
  {\parindent0pt\vspace*{-5pt}%
  \linespread{1.1}\large\slshape#1%
  \par\nobreak\vspace*{45pt}}
  \@afterheading%
}
\makeatother
\begin{document}

% ------------------ TITLE PAGE -------------------

\begin{titlepage}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here
\setlength{\topmargin}{0in}
\center % Center everything on the page






%---------------------------------------------------------------------------------
%   HEADING SECTIONS
%---------------------------------------------------------------------------------

\textsc{\Large xxxxt }\\[1.5cm] 


\HRule \\[0.4cm]
{ \bfseries \textbf{ title:} Here\\[0.4cm] % Title of your document
\HRule \\[1cm]
}

%----------------------------------------------------------------------
%   AUTHOR SECTION
%----------------------------------------------------------------------


%\begin{minipage}[b][][b]{\linewidth}

\end{titlepage}

% ------------------------------- body --------------------

%%%%%%%%--------- TABLE OF CONTENT ----------%%%%%%%%%%%%%%%

\newpage
\tableofcontents

%%%%%%%%%%-------- ABSTRACT %%%%%%%%%%%%%%%
\newpage
\renewcommand{\abstractname}{Abstract}
\addcontentsline{toc}{section}{Abstract}
\begin{abstract}
  \paragraph{}
  \par  The fu 

\end{abstract}

%%%%%%%%%% INTRODUCTION %%%%%%%%%%%%%%%
\newpage
\section{Introduction} \label{introduction}



\indent 
\par In

\par This report is divided in xx fs:
\begin{itemize}
    \item Chapter 2:
    \item Chapter 3:
    \item Chapter 4:
    \item Chapter 5:
\end{itemize}  

\end{document}

谢谢你。

这个问题与分项完全无关,你甚至不应该知道分项是什么样子的。 你不能在abstract环境中有\paragraph{} 这将导致错误:

在此处输入图像描述

永远不要忽略错误!

如果仍然存在错误,甚至不要查看什么可能是或可能不是有效的 pdf 文件!

在错误 tex 仅恢复到足以对文档的其余部分进行语法检查之后,它不会尝试生成合理的输出。


其他问题:

  • hyperref应该作为最后的包之一加载

  • \center只是偶然工作,更好地使用\centering

  • TeX 旨在分离布局和内容。 事实上,您必须弄乱文本中的格式说明,例如 \indent\par should tell you that there is something fundamentally wrong. For example if the first paragraph of a section should be indented, use the should tell you that there is something fundamentally wrong. For example if the first paragraph of a section should be indented, use the indentfirst` 包。


\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage[table,xcdraw]{xcolor}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[toc,page]{appendix}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{float}
\usepackage[numbers]{natbib}
\usepackage{textcomp}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{commath}
\usepackage{transparent}
\usepackage[T1]{fontenc}
\usepackage{amsfonts}
\usepackage{adjustbox}
\usepackage{indentfirst}

\makeatletter
\providecommand{\tabularnewline}{\\}
\usepackage[caption=false,font=footnotesize]{subfig} 
\usepackage[caption=false,font=footnotesize]{subfig}
\@ifundefined{showcaptionsetup}{}{%
\PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother

\usepackage{makecell}
\usepackage[official]{eurosym}
\usepackage{comment}
\usepackage{booktabs}

\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
 breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Your Title},
 pdfauthor={Your Name},
 pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}

%-----------HEADER AND FOOTER DEFINITION-----------%

\usepackage{fancyhdr}
\renewcommand{\headheight}{0.7in}
\setlength{\headwidth}{\textwidth}
\rhead{% left
\raisebox{0.25in}{\textcolor{gray}{\large Namen}}
}
\lhead{ % right
  % \transparent{0.5}\includegraphics[height=0.6in]{Logo_novo_FEUPbranco.jpg}
}
\pagestyle{fancy}
%\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}




%\usepackage{eurosym}
\usepackage[section]{placeins}

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}

\makeatletter
\newcommand{\chapterauthor}[1]{%
  {\parindent0pt\vspace*{-5pt}%
  \linespread{1.1}\large\slshape#1%
  \par\nobreak\vspace*{45pt}}
  \@afterheading%
}
\makeatother
\begin{document}

% ------------------ TITLE PAGE -------------------

\begin{titlepage}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here
\setlength{\topmargin}{0in}
\centering % Center everything on the page






%---------------------------------------------------------------------------------
%   HEADING SECTIONS
%---------------------------------------------------------------------------------

\textsc{\Large xxxxt }\\[1.5cm] 


\HRule \\[0.4cm]
{ \bfseries \textbf{ title:} Here\\[0.4cm] % Title of your document
\HRule \\[1cm]
}

%----------------------------------------------------------------------
%   AUTHOR SECTION
%----------------------------------------------------------------------


%\begin{minipage}[b][][b]{\linewidth}

\end{titlepage}

% ------------------------------- body --------------------

%%%%%%%%--------- TABLE OF CONTENT ----------%%%%%%%%%%%%%%%

\newpage
\tableofcontents

%%%%%%%%%%-------- ABSTRACT %%%%%%%%%%%%%%%
\newpage
\renewcommand{\abstractname}{Abstract}
\addcontentsline{toc}{section}{Abstract}
\begin{abstract}
%  \paragraph{}
    The fu 
\end{abstract}

%%%%%%%%%% INTRODUCTION %%%%%%%%%%%%%%%
\newpage
\section{Introduction} \label{introduction}

In

This report is divided in xx fs:
\begin{itemize}
    \item Chapter 2:
    \item Chapter 3:
    \item Chapter 4:
    \item Chapter 5:
\end{itemize}  

\end{document}

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM