段落缩进(\indent 和 \par)均不起作用

段落缩进(\indent 和 \par)均不起作用

序言。我使用 Win 8 Pro x64、MiKTeX 2.9、TeXnicCenter 最新版本。

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{polyglossia}
\usepackage{xltxtra}
\usepackage{xunicode}
\usepackage{units}
\usepackage{amsmath}
\usepackage{pstricks}
\usepackage{float}
\usepackage{wrapfig}
\usepackage[top=2.5cm, left=3cm, bottom=2.5cm, right=2.5cm]{geometry}
\usepackage{setspace}
\usepackage{pgfplots}
\usepackage[document]{ragged2e}
\usepackage[nottoc]{tocbibind}
\usepackage{titlesec}
\usepackage{indentfirst}
\setlength\parindent{24pt}
\titleformat{\section}[block]{\color{black}\Large\bfseries\filcenter}{}{1em}{}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{polar}
\usepgflibrary{shapes.geometric}
\usetikzlibrary{calc}
\onehalfspacing
\setmainfont{Times New Roman}
\setdefaultlanguage{latvian}
\setotherlanguages{english, russian}
\numberwithin{equation}{subsection}
\numberwithin{figure}{subsection}
\numberwithin{table}{subsection}
\pgfplotsset{pa/.append style={axis x line=bottom, axis y line=left, xlabel={$r; \cdot 10^7 m$}, ylabel={$F_{pa}; \cdot 10^8 N$}}}
\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother
\begin{document}

根据需要加工件:

\begin{center}
\noindent \large{\textsc{University \\
Department\\
Faculty}}

\topskip0pt
\vspace*{\fill}
\noindent \Large{name \\
\textbf{Topic} \\
Study}
\vspace*{\fill}
\end{center}
\begin{FlushRight}
\noindent \large{Work advisor: \\
Professor } \end{FlushRight} \bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\begin{center}
\noindent \large{\textsc{City, Year}}
\end{center}
\newpage
\tableofcontents
\newpage

在这里我titlepage按照要求的样式进行制作。然后我去写摘要。没有段落缩进,但我需要在第一行(之后)缩进section,我尝试在那段文字中将\par\indent用于两个不同的段落。此外,在文档的任何地方都没有任何意图起作用。

\section*{Abstract}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \par
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
\\ \indent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\newpage

它应该有三个缩进,但是却没有。

查看现有的类似问题也没有给我带来任何解决方案。此外,我已将我的构建日志放在 pastebin 上 -http://pastebin.com/0EiP5BKw

答案1

您已使用选项加载了软件包ragged2edocument该选项会取消缩进并以不规则的方式排版文档,但我认为这不是您想要的。

我还对您的输入做了一些更改,以便更易于管理。请注意,诸如\Large 接受一个论点,但设置他们的行动继续,直到被另一个命令或发出命令的组结束取消。

还要注意,只需在源代码中留下一个空行即可结束一个段落。

\documentclass[12pt,a4paper]{article}

%% Packages
\usepackage{amsmath} % must go before fontspec

\usepackage{fontspec}
\usepackage{polyglossia}

\usepackage[
  top=2.5cm,
  left=3cm,
  bottom=2.5cm,
  right=2.5cm
]{geometry}

\usepackage{graphicx}
\usepackage{units}
\usepackage{pstricks}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{ragged2e}
\usepackage[nottoc]{tocbibind}
\usepackage{titlesec}
\usepackage{indentfirst}

\usepackage{pgfplots}
  \usepgfplotslibrary{polar}
  \usepgflibrary{shapes.geometric}
  \usetikzlibrary{calc}
  \pgfplotsset{compat=1.8}
  \pgfplotsset{
    pa/.append style={
      axis x line=bottom, 
      axis y line=left,
      xlabel={$r; \cdot 10^7 m$},
      ylabel={$F_{pa}; \cdot 10^8 N$}
    }
  }

%% Fonts and languages
\setmainfont[Ligatures=TeX,
  SmallCapsFont=TeX Gyre Termes,
  SmallCapsFeatures={Letters=SmallCaps}
]{Times New Roman}

\setdefaultlanguage{latvian}
\setotherlanguages{english, russian}

%% Misc settings
\titleformat{\section}[block]
  {\color{black}\Large\bfseries\filcenter}
  {}
  {1em}
  {}

\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother

\numberwithin{equation}{subsection}
\numberwithin{figure}{subsection}
\numberwithin{table}{subsection}

\onehalfspacing

\setlength\parindent{24pt}

\begin{document}

\begin{titlepage}
\centering

{\large\scshape
  University \\
  Department \\
  Faculty
\par}

\vspace*{\fill}

{\Large
  name
\par}

{\Large\bfseries
  Topic
\par}

{\Large
  Study
\par}

\vspace*{\fill}

\raggedleft

{\large
  Work advisor: \\
  Professor
\par}

\vspace{\fill}

\centering

{\large\scshape
  City, Year
\par}

\end{titlepage}

\tableofcontents
\clearpage

\section*{Abstrakts}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

\end{document}

答案2

您已设置\parindent为 0pt。请\parindent30pt在摘要前进行设置。

据我了解,您不需要段落,而是需要段落缩进。

相关内容