Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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 tex.stackexchange.com/questions/2631/… (duplicate?) –  Caramdir Mar 27 '12 at 23:10

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
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: 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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.