diff --git a/bib/sites.bib b/bib/sites.bib index 0fe73dd..f748b68 100644 --- a/bib/sites.bib +++ b/bib/sites.bib @@ -1,8 +1,11 @@ @misc{website:overleaf001, - title = "Page size and margins", author = "Overleaf", howpublished = "\url{https://www.overleaf.com/learn/latex/Page_size_and_margins}", - year= "No date" +} + +@misc{website:overleaf002, + author = "Overleaf", + howpublished = "\url{https://www.overleaf.com/learn/latex/Brackets_and_Parentheses}", } @misc{website:wikibooks001, diff --git a/lbol.tex b/lbol.tex index 7c71f5d..8711951 100644 --- a/lbol.tex +++ b/lbol.tex @@ -41,7 +41,7 @@ %\renewcommand{\footrulewidth}{0.5pt} % Make a nice border and box for the tops of our examples -\newcommand\klab[3]{\vspace{#1}\noindent{}\hrulefill\fbox{\texttt{~#2~}}\hrulefill\vspace{#3}} +\newcommand\klab[3]{\vspace{#1}\noindent{}\hrulefill~~\fbox{\texttt{~#2~}}~~\hrulefill\vspace{#3}} % Add an \hrule with space above and below \newcommand\krule[2]{\vspace{#1}\hrule\vspace{#2}} @@ -705,6 +705,99 @@ The Pythagorean Theorem is \[x^2 + y^2 = z^2\] The Pythagorean Theorem is \[x^2 + y^2 = z^2\] +\section{Brackets and Parentheses} + +Brackets and parentheses are common in mathematical formulas, so it is natural that \LaTeX{} has a number of ways of typesetting these. + +% Provide some additional spacing in this table; may move this to preamble later +\setlength{\tabcolsep}{14pt} +\renewcommand{\arraystretch}{1.4} + +\begin{table}[H] +\centering +\caption{Brackets and Parentheses\label{brackpar}} +\medskip +\noindent{}\begin{tabular}{| m{3.5cm} m{3cm} m{1.5cm} |} +\hline + \textbf{Type} & \textbf{Code} & \textbf{Example} \\ +\hline + Parentheses; \newline round brackets & \verb|(a+b)| & $(a+b)$ \\ +\hline + Brackets; \newline square brackets & \verb|[a+b]| & $[a+b]$ \\ +\hline + Braces; curly brackets & \verb|\{a+b\}| & \{a+b\} \\ +\hline + Angle brackets & \verb|\langle a+b \rangle| & $\langle a+b \rangle$ \\ +\hline + Pipes & \verb:|a+b|: & $|a+b|$ \\ +\hline + Double Pipes & \verb:\|a+b\|: & $\|a+b\|$ \\ +\hline +\end{tabular} +\end{table} + +\subsection{Adjusting Size Dynamically} + +To dynamically size brackets and parentheses, you can use \verb+\left+ and \verb+\right+ commands. For example, this code + +\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm] +\[ +F=G \left( \frac{m_1 m_2}{r^2} \right) +\] +\end{Verbatim} + +produces this output: + +\[ +F=G \left( \frac{m_1 m_2}{r^2} \right) +\] + +Note that \textit{both} commands are required. + +If you are writing a multi-line equations in an \texttt{align}, \texttt{align*}, or \texttt{aligned} environment, you must balance \verb+\left+ and \verb+\right+ both on each line, and on the same side of the \texttt{\&} delimiter. If an opening or closing bracket is not required, you can use an invisible bracket to balance them, i.e., \verb+\left.+ and \verb+\right.+. + +\subsection{Adjusting Size Explicitly} + +You can also control the size of brackets and parentheses explicitly: + +% Provide some additional spacing in this table; may move this to preamble later +\setlength{\tabcolsep}{14pt} +\renewcommand{\arraystretch}{1.6} + +\begin{table}[H] +\centering +\caption{Explicit Size Commands\label{brackparexp}} +\medskip +\noindent{}\begin{tabular}{| m{7cm} m{2cm} |} +\hline + \textbf{Markup} & \textbf{Renders as} \\ +\hline + \verb+\bigl( \Bigl( \biggl( \Biggl(+ & $\bigl( \Bigl( \biggl( \Biggl($ \\ +\hline + \verb+\bigr] \Bigr] \biggr] \Biggr]+ & $\bigr] \Bigr] \biggr] \Biggr]$ \\ +\hline + \verb+\bigl\{ \Bigl\{ \biggl\{ \Biggl\{+ & $\bigl\{ \Bigl\{ \biggl\{ \Biggl\{$ \\ +\hline + \verb+\bigl \langle \Bigl \langle \biggl+ \verb+\langle \Biggl \langle+ & $\bigl \langle \Bigl \langle \biggl \langle \Biggl \langle$ \\ +\hline + \verb+\bigr \rangle \Bigr \rangle \biggr+ \verb+\rangle \Biggr \rangle+ & $\bigr \rangle \Bigr \rangle \biggr \rangle \Biggr \rangle$ \\ +\hline + \verb+\big| \Big| \bigg| \Bigg|+ & $\big| \Big| \bigg| \Bigg|$ \\ +\hline + \verb+\big\| \Big\| \bigg\| \Bigg\|+ & $\big\| \Big\| \bigg\| \Bigg\|$ \\ +\hline + \verb+\bigl \lceil \Bigl \lceil \biggl+ \verb+\lceil \Biggl \lceil+ & $\bigl \lceil \Bigl \lceil \biggl \lceil \Biggl \lceil$ \\ +\hline + \verb+\bigr \rceil \Bigr \rceil \biggr+ \verb+\rceil \Biggr \rceil+ & $\bigr \rceil \Bigr \rceil \biggr \rceil \Biggr \rceil$ \\ +\hline + \verb+\bigl \lfloor \Bigl \lfloor \biggl+ \verb+\lfloor \Biggl \lfloor+ & $\bigl \lfloor \Bigl \lfloor \biggl \lfloor \Biggl \lfloor$ \\ +\hline + \verb+\bigr \rfloor \Bigr \rfloor \biggr+ \verb+\rfloor \Biggr \rfloor+ & $\bigr \rfloor \Bigr \rfloor \biggr \rfloor \Biggr \rfloor$ \\ +\hline +\end{tabular} +\end{table} + + \section{The \texttt{align} Environment} \section{The \texttt{array} Environment}