Updated coda » redefining a command

This commit is contained in:
Kenneth John Odle 2025-02-18 16:36:27 -05:00
parent 5ba7600b5c
commit 2445c2cc3a
2 changed files with 17 additions and 6 deletions

View File

@ -160,15 +160,15 @@
\begin{document}
%\maketitle
\maketitle
%\input{include/impressum}
\input{include/impressum}
%\tableofcontents
\tableofcontents
%\input{include/chap01}
\input{include/chap01}
%\input{include/chap02}
\input{include/chap02}
\input{include/chap03}
@ -178,7 +178,7 @@
%\input{include/chap06}
%\input{include/coda}
\input{include/coda}

View File

@ -22,6 +22,17 @@ Last time around, I mentioned using \verb|\input{<filename>}| to keep your \LaTe
For this issue, I decided to write up each chapter as a separate file, and then just \texttt{include} that file into my main document. This makes it much easier to manage, and I do feel more efficient. But because I'm using a GUI (Texmaker) I do have to remember to switch back to my main file when I compile the document. Overall, that's a trade-off I can live with. As a bonus, I can comment out chapters I am not concerned about when compiling. This saves both printer paper (since I tend to edit on paper—I'm very old-school in that way) and my adult-onset-attention-deficit-disordered brain.)
\subsection{Redefining a Command}
I switched to the Cantarell font for sans-serif fonts in this issue. The only problem is that it seemed a bit bigger than the serif font around it. So I redefined it in the preamble to make it a bit smaller:
\begin{Verbatim}[]
\let\oldtextsf\textsf
\renewcommand{\textsf}[1]{\small\oldtextsf{#1}\normalsize}
\end{Verbatim}
The first line saves the \texttt{textsf} command under a new name (\texttt{oldtextsf}). The second line then allows me to renew the original command by using the new name as an input to the original. I added \verb|\small| in front to change the size of the sans-serif text, and added \verb|\normalsize| after it to return to the regular font size.
%\newpage % Use only to keep the afterword together if we end up with orphans
\section{Afterword}