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.

For some reason in my code my paragraph indents aren't working.

I'm using MikTeX 2.9 on Windows 7 compiling with XeLaTeX. I'm using multicols for a 2 column layout but I'm not sure if thats the issue.

using the article class and I'm specifying:

\setlength\parindent{20pt}

edit: manually inserting \indent at the start of each paragraph works but this is annoying.

Here is a M(non-)WE, this uses random text from the Wikipedia article on shrimp, however, if I replace the text with \lipsum[1] then the indenting works perfectly. What's going wrong here?

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

% DOCUMENT LAYOUT
\documentclass[10pt, letterpaper]{article} 
\usepackage{geometry} 
\geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{20pt}
\usepackage{multicol}

% LOREM IPSUM FILLER
\usepackage{lipsum}

% FONTS
\usepackage{fontspec}
\usepackage[usenames,dvipsnames]{xcolor}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont [Ligatures={Common}, Numbers={OldStyle}, Variant=01]{Linux Libertine O}

% HEADINGS
\usepackage{sectsty} 
\usepackage[normalem]{ulem} 
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize} 
\subsubsectionfont{\mdseries\upshape\large} 

% DOCUMENT
\begin{document}
\begin{multicols}{2}[\section*{Shrimp}]
The class Malacostraca contains about half of the crustaceans. The members of this class have a primitive body plan that can be described as shrimp-like, consisting of a 5-8-7 body plan. They have a small carapace that encloses the head and the thorax, and have a muscular abdomen for swimming. They also have a thin exoskeleton to maintain a light weight. These general characteristics are common in all members of the class.\\
The class can be further divided into the decapods, which are even still divided into the dendrobranchiates (prawns) and the carideans (shrimp and snapping shrimp).\\
The prawns have sequentially overlapping body segments (segment one covers the segment two, segment two covers segment three, etc.), chelate (claw like) first three leg pairs, and have a very basic larval body type.\\
The shrimps also have overlapping segments, however, in a different pattern (segment two overlaps segments one and three), only the first two leg pairs are chelate, and they have a more complex larval form.\\
Biologists distinguish the true shrimp from the true prawn because of the differences in their gill structures. The gill structure is lamellar in shrimp but branching in prawns. The easiest practical way to separate true shrimps from true prawns is to examine the second abdominal segment. The second segment of a shrimp overlaps both the first and the third segment, while the second segment of a prawn overlaps only the third segment.
\end{multicols}
\end{document}

MWE!:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

% DOCUMENT LAYOUT
\documentclass[10pt, letterpaper]{article} 
\usepackage{geometry} 
\geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{20pt}
\usepackage{multicol}

% LOREM IPSUM FILLER
\usepackage{lipsum}

% FONTS
\usepackage{fontspec}
\usepackage[usenames,dvipsnames]{xcolor}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont [Ligatures={Common}, Numbers={OldStyle}, Variant=01]{Linux Libertine O}

% HEADINGS
\usepackage{sectsty} 
\usepackage[normalem]{ulem} 
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize} 
\subsubsectionfont{\mdseries\upshape\large} 

% DOCUMENT
\begin{document}
\begin{multicols}{2}[\section*{Random}]
\lipsum
\end{multicols}
\end{document}
share|improve this question
4  
`\\` wont start a new paragraph, only a new line, hence no indentation. Add a blank line between paragraphs to indicate a new paragraph. –  Torbjørn T. Jan 19 '12 at 21:28
    
aha, thanks! don't need the \\ on the new line, thanks! –  s0rce Jan 19 '12 at 21:31
    
The reason why \lipsum works is because after every paragraph, it executes \par - a valid paragraph break, causing a subsequent paragraph indentation. Using \lipsum* does not issue this paragraph break. –  Werner Jan 19 '12 at 22:01
add comment

1 Answer 1

up vote 4 down vote accepted

To start a new paragraph you have to add two newlines in the code (i.e., an empty line). \\ will not start a new paragraph, just a new line, and therefore the next line will have no paragraph indentation.

\documentclass{article} 
\begin{document}
The first line. \\
Second line, still the same paragraph, no indentation.

New paragraph, line indented.
\end{document}
share|improve this answer
add comment

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.