![Нежелательные отступы](https://rvso.com/image/286349/%D0%9D%D0%B5%D0%B6%D0%B5%D0%BB%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5%20%D0%BE%D1%82%D1%81%D1%82%D1%83%D0%BF%D1%8B.png)
В следующем коде все, начиная с «Сценария с 3 пиратами..» и ниже, имеет отступ относительно текста выше.
\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}
Может ли кто-нибудь объяснить мне, почему это происходит?
решение1
Если вы не хотите, чтобы что-либо имело отступ, лучше загрузить parskip
. Это устанавливает отступ абзаца на ноль и помечает абзацы с увеличенным вертикальным пропуском, сохраняя при этом правильное форматирование сред, использующих \parindent
и \parskip
т. д.
\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}
В качестве альтернативы вам может быть проще использовать среду списка, чтобы сохранить единообразие форматирования. Например:
\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}
Это в основном устанавливает новый, специализированный pirates
список, отформатированный определенным образом. Пример выглядит так:
решение2
Вам нужно добавить \noindent
перед любым новым абзацем. По умолчанию первый абзац не имеет отступа, а все последующие имеют. После a \section
очевидно, что это начало нового абзаца. Но чтобы отличить последующие абзацы, обычно делают отступ.
Это становится более понятным, если у вас длинный текст:
Примечания:
Абзац, следующий за таблицей, является хорошим примером того, почему последующие абзацы имеют отступ. Если бы этот абзац не имел отступа, читатель не имел бы возможности узнать, является ли он началом последующего абзаца или нет.
Если вы вообще не хотите, чтобы абзацы имели отступ, вы можете использовать:
\usepackage[parfill]{parskip}
Код:
\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}