From 7c7b101f99ce9576fb2cff03fe60c4237bafca84 Mon Sep 17 00:00:00 2001 From: Kenneth Odle Date: Sun, 29 Oct 2023 13:39:44 -0400 Subject: [PATCH] Added section about aligning text --- lbol.tex | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/lbol.tex b/lbol.tex index 1b43fd5..5cab8da 100644 --- a/lbol.tex +++ b/lbol.tex @@ -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 don’t know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain’t 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—Tom’s 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 don’t know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain’t 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—Tom’s 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}}