latex-skript/content/formatting-paragraphs.tex

33 lines
1.4 KiB
TeX

\chapter{Formatting Paragraphs} % (fold)
\label{sec:formatting-paragraphs}
\section*{Ragged alignment}
\label{sec:ragged-alignment}
By default, \LaTeX{} sets continuous text in full justification.
However, we can also switch to ragged alignment by using the commands
\code{latex}{\textbackslash raggedright}, \code{latex}{\textbackslash raggedleft}, and
\code{latex}{\textbackslash centering}.
These commands influence the environment that they are used in, e.\,g., the
\mono{document} environment. Correspondingly, the text within the whole
document is affected.
Alternatively, we can use dedicated environments in order to influence the
formatting
of certain paragraphs (\cref{lst:ragged-alignment}).
\example{lst:ragged-alignment}{formatting-paragraphs/ragged-alignment}{Ragged
alignment}
\section*{Indentation and spacing}
\label{sec:indents-and-parskips}
Usually, we illustrate a new paragraph by indenting the first line of it
(\code{latex}{\textbackslash parindent}).
Alternatively, paragraph spacing, i.\,e., vertical space between paragraphs,
can be used (\code{latex}{\textbackslash parskip}).
For both variants, there are adjustable parameters:
\codeblock{latex}{listings/formatting-paragraphs/indentation.tex}
\noindent We can use \code{latex}{\textbackslash noindent} to turn off the indentation for only one
paragraph.
For the first paragraph after a heading, there is usually no indentation.