[Tex/LaTex] Why xelatex indents only the first paragraph

indentationparagraphs

Example:

\documentclass[a4paper,titlepage]{article}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Times New Roman}
\usepackage[margin=0.5in]{geometry}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}
\parindent 3ex
Some text, indented properly.
\section{Some section}
  Another text, without indent this time.
\end{document}

It works, but only on the first paragraph. All other paragraphs (they are located in sections and subsections) are not indented at all.

What can I do to fix this?

Best Answer

There is nothing strange. By default, LaTeX doesn't indent the first paragraph following a section title.

You can countermand this decision by loading the package indentfirst.

\documentclass[a4paper,titlepage]{article}
\usepackage[margin=0.5in]{geometry}

\usepackage{indentfirst}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}

Some text, indented properly.

\section{Some section}
Another text, this is indented.

And also this one.

\end{document}

Notice that xltxtra should generally not be loaded. The right package to load is fontspec.

Related Question