[Tex/LaTex] Unwanted Indenting

indentation

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?

Best Answer

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