Added section about aligning text

This commit is contained in:
Kenneth John Odle 2023-10-29 13:39:44 -04:00
parent d32507e0f4
commit 7c7b101f99

View File

@ -10,9 +10,10 @@
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{tabularray}
\usepackage{lipsum}
\usepackage{nicefrac}
\raggedbottom
\usepackage{nicefrac}
% Where are our images?
\graphicspath{{images/}}
@ -470,6 +471,51 @@ For more information, see the section ``\nameref{codeexp}'' on page \pageref{cod
\section{Alignment}
By default, \LaTeX{} fully justifies text. That is, there are equal margins for each line on both the left and the right sides.
\subsection{Centered Text}
To center text, surround it with a \texttt{center} environment:
\begin{Verbatim}
\begin{center}
This text is centered.
\end{center}
\end{Verbatim}
produces this text:
\begin{center}
This text is centered.
\end{center}
\subsection{Left-Aligned Text}
To produce left-aligned text with a ragged right edge, use the \texttt{flushleft} environment:
\begin{Verbatim}[]
\begin{flushleft}
This text will be left-aligned with a ragged right edge.
\end{flushleft}
\end{Verbatim}
\begin{flushleft}
You dont know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that aint no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly—Toms Aunt Polly, she is—and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before.\end{flushleft}
\subsection{Right-Aligned Text}
To produce right-aligned text with a ragged left edge, use the \texttt{flushright} environment:
\begin{Verbatim}[]
\begin{flushright}
This text will be left-aligned with a ragged right edge.
\end{flushright}
\end{Verbatim}
\begin{flushright}
You dont know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that aint no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly—Toms Aunt Polly, she is—and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before.
\end{flushright}
\section{Vertical Space}
\subsection{\texttt{vspace}}