![Sangría no deseada](https://rvso.com/image/286349/Sangr%C3%ADa%20no%20deseada.png)
Con el siguiente código, todo, desde "Escenario que contiene 3 piratas..." y más abajo, tiene sangría en relación con el texto anterior.
\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}
¿Alguien podría decirme por qué sucede esto?
Respuesta1
Si no desea sangrar nada, es mejor cargar parskip
. Esto establece la sangría del párrafo en cero y marca los párrafos con mayor salto vertical mientras mantiene el formato adecuado de los entornos que usan \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}
Alternativamente, puede que le resulte más fácil utilizar un entorno de lista para mantener la coherencia del formato. Por ejemplo:
\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}
Básicamente, esto configura una pirates
lista nueva y especializada con un formato particular. El ejemplo se ve así:
Respuesta2
Debe agregar \noindent
antes de cualquier párrafo nuevo. El valor predeterminado es que el primer párrafo no tiene sangría y todos los siguientes sí. Después de a \section
es obvio que este es el comienzo de un nuevo párrafo. Pero para distinguir los párrafos siguientes, el método habitual es sangrarlos.
Esto queda más claro si tiene un texto más largo:
Notas:
El párrafo que sigue a la tabla es un buen ejemplo de por qué los párrafos siguientes tienen sangría. Si este párrafo no tuviera sangría, el lector no tendría ninguna forma de saber si este era el comienzo de un párrafo siguiente o no.
Si no desea que sus párrafos tengan ninguna sangría, puede usar:
\usepackage[parfill]{parskip}
Código:
\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}