# Why xelatex indents only the first paragraph?

Example:

\documentclass[a4paper,titlepage]{article}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Times New Roman}
\usepackage[margin=0.5in]{geometry}
\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?

-
A minimal example is needed. There is no \beginclass command and \indent 3ex will indent a line but also print "3ex". – egreg Mar 27 '12 at 22:43
This explains it. The first paragraph of a section is never indented! – Stephan Lehmke Mar 27 '12 at 22:52

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

-
I don't know what is included in xltxtra, but at the very least changing it to fontspec breaks compilation immediately. – Rogach Mar 27 '12 at 23:00
@Rogach What TeX distribution do you have? – egreg Mar 27 '12 at 23:01
texlive-full, installed it from repositories. – Rogach Mar 27 '12 at 23:11
@Rogach On a Ubuntu system? Unfortunately it's really outdated, particularly for XeTeX and LuaTeX support. Installing TeX Live 2011 is not very difficult: tug.org/texlive – egreg Mar 28 '12 at 8:35

I don't know \indent, but I believe

\parindent 3ex


is what you're looking for.

-
Same problem - it indents only the first paragraph – Rogach Mar 27 '12 at 22:46
You should give a larger example demonstrating the problem. – Stephan Lehmke Mar 27 '12 at 22:47
added a minimal example to question. – Rogach Mar 27 '12 at 22:50
@rogach have you seen a non-indented paragraph anywhere other than immediately following a sectioning command? indentation is suppressed in that situation, for good typogrqaphical reasons. – wasteofspace Mar 27 '12 at 22:51