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.

With the following code, everything from "Scenario containing 3 pirates.." and below has been indented relative to the text above.

\documentclass{article}
\title{Assignment \#1}
\author{Giri}
\date{March 20, 2014}
\begin{document}
\maketitle     
\section*{Question 1}
\textit{Scenario containing 2 pirates :} \\*\\*
 Regardless of how the gold is split, the 2nd pirate will vote against the 1st pirate and take all the gold. \\*\\*

\textit{Scenario containing 3 pirates:} 

\begin{table}[ht]
\caption{3 Pirates}
\centering
\begin{tabular}{c c c}
\hline\hline
Pirate\#1 & Pirate\#2 & Pirate\#3 \\  
\hline
x & x & x \\
\hline
\end{tabular}
\end{table}

In this...

\end{document}

Could someone please tell me why this is happening?

share|improve this question
    
A blank line indicates a paragraph break. Paragraphs after the first are indented... –  cfr Mar 16 at 4:09

2 Answers 2

up vote 3 down vote accepted

If you don't want anything indented, it is better to load parskip. This sets the paragraph indentation to zero and marks paragraphs with increased vertical skip while maintaining the proper formatting of environments which use \parindent, \parskip etc.

\documentclass{article}
\usepackage{parskip}% if you don't want paragraphs indented but would prefer to mark them by increased vertical spacing
\title{Assignment \#1}
\author{Giri}
\date{March 20, 2014}
\begin{document}
\maketitle
\section*{Question 1}
\textit{Scenario containing 2 pirates :} \\*\\*
 Regardless of how the gold is split, the 2nd pirate will vote against the 1st pirate and take all the gold. \\*\\*

\textit{Scenario containing 3 pirates:}

\begin{table}[ht]
\caption{3 Pirates}
\centering
\begin{tabular}{c c c}
\hline\hline
Pirate\#1 & Pirate\#2 & Pirate\#3 \\
\hline
x & x & x \\
\hline
\end{tabular}
\end{table}

In this...

\end{document}

Non-indented pirates

Alternatively, you might find it easier to use a list environment to keep formatting consistent. For example:

\documentclass{article}
\usepackage{enumitem}
  \newlist{pirates}{description}{1}
  \setlist[pirates,1]{font=\normalfont\itshape,style=nextline,labelindent=0pt,leftmargin=0pt,itemsep=1.5em}
\title{Assignment \#1}
\author{Giri}
\date{March 20, 2014}
\begin{document}
\maketitle
\section*{Question 1}

\begin{pirates}
    \item[Scenario containing 2 pirates:] \mbox{}\\
      Regardless of how the gold is split, the 2nd pirate will vote against the 1st pirate and take all the gold.
    \item[Scenario containing 3 pirates:] \mbox{}\\
      \begin{table}[ht]
      \caption{3 Pirates}
      \centering
      \begin{tabular}{c c c}
      \hline\hline
      Pirate\#1 & Pirate\#2 & Pirate\#3 \\
      \hline
      x & x & x \\
      \hline
      \end{tabular}
      \end{table}
\end{pirates}
In this...

\end{document}

This basically sets up a new, specialised pirates list formatted in a particular way. The example looks like this:

pirates list

share|improve this answer

You need to add \noindent before any new paragraphs. The default is that the first paragraph is not indented and all subsequent ones are. Following a \section is it obvious that this is the start of a new paragraph. But to distinguish subsequent paragraphs the usual method is to have them indented.

This becomes clearer if you have longer text:

enter image description here

Notes:

  • The paragraph following the table is a good example of why subsequent paragraphs are indented. If this paragraph was not indented the reade would not have any way of knowing if this was the start of a subsequent paragraph or not.

  • If you don't want your paragraphs indented at all, you could use:

    \usepackage[parfill]{parskip}
    

Code:

\documentclass{article}

\title{Assignment \#1}
\author{Giri}
\date{March 20, 2014}
\begin{document}
\maketitle     
\section*{Question 1}
\textit{Scenario containing 2 pirates :} \\*\\*
 Regardless of how the gold is split, the 2nd pirate will vote against the 1st pirate and take all the gold. \\*\\*

Here is some longer text to show that only the start of that paragraph is indented.
\textit{Scenario containing 3 pirates:} 

\begin{table}[ht]
\caption{3 Pirates}
\centering
\begin{tabular}{c c c}
\hline\hline
Pirate\#1 & Pirate\#2 & Pirate\#3 \\  
\hline
x & x & x \\
\hline
\end{tabular}
\end{table}

In this, and some more text here again to show that only the start of the paragraph is indented.

\end{document}
share|improve this answer

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.