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

时间:2019-04-23 12:59:16

标签: latex

在文档中,每当我使用itemize时,第一个元素都会出现不必要的缩进。在每章中,我使用\ident,这可能会引起问题吗? 如何解决不必要的缩进? 我想保留标准的项目缩进,只调整第一个项目。 正在Overleaf上编辑文档。

这是什么样子:

This is what is looks like:

我的目标

My goal

这在示例代码中为我复制了问题:

\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}

谢谢。

1 个答案:

答案 0 :(得分:0)

问题完全与项目无关,您甚至不应该知道项目的外观。您必须在\paragraph{}环境中没有abstract。这将导致错误:

enter image description here

永远不要忽略错误!

如果仍然有错误,甚至不要查看什么是有效的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 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}

enter image description here