2

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?

Caramdir
  • 89,023
  • 26
  • 255
  • 291
Rogach
  • 3,088
  • 1
    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
  • See also http://tex.stackexchange.com/questions/2631/why-do-i-need-to-use-paragraph-after-a-section-to-get-correct-indenting-wh/2632#2632 (duplicate?) – Caramdir Mar 27 '12 at 23:10

2 Answers2

7

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.

egreg
  • 1,121,712
  • 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
  • 1
    @Rogach On a Ubuntu system? Unfortunately it's really outdated, particularly for XeTeX and LuaTeX support. Installing TeX Live 2011 is not very difficult: http://tug.org/texlive – egreg Mar 28 '12 at 08:35
2

I don't know \indent, but I believe

\parindent 3ex

is what you're looking for.