Further revisions to basic structure

This commit is contained in:
Kenneth John Odle 2023-07-06 15:48:16 -04:00
parent 15faa2d664
commit 5238297376

View File

@ -13,7 +13,6 @@
\graphicspath{{images/}}
% Let's set this as a half-letter sized sheet
% https://tex.stackexchange.com/questions/338789/how-to-set-paper-size-to-half-letter-5-5-x-8-5-in-in-amsbook
\usepackage{geometry}
\geometry{
paperheight=8.5in,
@ -23,23 +22,21 @@
}
% Adjust the top and bottom margins
% http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907057
\addtolength{\topmargin}{0.4in}
\addtolength{\textheight}{-0.5in}
% Set the header style
% https://www.overleaf.com/learn/latex/Headers_and_footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE,LO]{\textit{the little book of \LaTeX{}}}
% We won't use footers, but we'll keep this in case we change our minds.
% \cfoot{Page \thepage}
%\renewcommand{\footrulewidth}{0.5pt}
% Include sections and subsections in the TOC
% https://latex-tutorial.com/tutorials/table-of-contents/
% \setcounter{tocdepth}{2}
% \setcounter{tocdepth}{1}
% We will probably want some two- or three-column sections
\usepackage{multicol}
@ -48,7 +45,6 @@
\counterwithout{footnote}{chapter}
% Let's wrap some images
% https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
\usepackage{wrapfig}
% Use tab stops when we need to (especially in footnotes)
@ -59,21 +55,9 @@
% Use strikethrough
\usepackage{ulem}
% Style a blockquote
% 2021.11.22 -- Not really sure I need this anymore.
% See https://tex.stackexchange.com/questions/325695/how-to-style-blockquote
% \usepackage{etoolbox}
% \usepackage{setspace} % for \onehalfspacing and \singlespacing macros
% See also https://www.overleaf.com/learn/latex/Typesetting_quotations
% Make things neater. Thanks /u/-LeopardShark-
\usepackage{microtype}
% Put a horizontal rule in an align environment
% This is just for the page numbers/scanning picture in issue #2
% Keep this in case it becomes useful later
% \usepackage{booktabs}
% Use line numbers with code samples
% \begin{Verbatim}...\end{Verbatim} <-- Note the capitalization!
\usepackage{fancyvrb}
@ -108,8 +92,7 @@
\usepackage[generate,ps2eps]{abc}
\usepackage{mathptmx} %Necessary for abc package to work?
% Do we want to include URLs?
% Yes, but we also want to hide the big red box it puts around them in the pdf. Thanks /u/0b0101011001001011
% Include URLs, but hide the big red box it puts around them in the pdf.
\usepackage[hidelinks]{hyperref}
%%%% Document Information %%%%%
@ -119,6 +102,7 @@
\vspace{3em}
{\normalsize A Partial Guide \\
\bigskip
1\textsuperscript{st} Edition \\
Typeset in \LaTeX{} (of course!)}
}
\date{{\small 2023}}
@ -127,9 +111,14 @@
\maketitle
\section*{}
\thispagestyle{empty}
All contents \copyright2023 Kenneth John Odle
FYI, this is made in \LaTeX \,using the report document class. It then gets exported to a letterhalf (5.5 in x 8.5 in) pdf, which then gets made into a booklet using PDF Booklet (\href{https://pdfbooklet.sourceforge.io/wordpress/}{\texttt{https://pdfbooklet.sourceforge.io/wordpress/}}).
\bigskip
\noindent{}FYI, this is made in \LaTeX \,using the report document class. It then gets exported to a letterhalf (5.5 in x 8.5 in) pdf, which then gets made into a booklet using PDF Booklet (\href{https://pdfbooklet.sourceforge.io/wordpress/}{\texttt{https://pdfbooklet.sourceforge.io/wordpress/}}).
@ -139,7 +128,7 @@ FYI, this is made in \LaTeX \,using the report document class. It then gets expo
\chapter{Beginnings}
I realized that even though I've mentioned that the reason I created this zine was to learn how to use LaTeX, and even though I've mentioned the things I've learned about LaTeX while writing it, I've never really provided a basic guide for others who might be interested in learning \LaTeX{}. So here goes…
I am neither a mathematician nor a physicist, but I've been fascinated with typography for as long as I can remember. I finally decided to take the plunge and learn \LaTeX{}, but because I have a project-based mind, I needed a project to learn it. I ended up creating a zine about Linux, typeset entirely in \LaTeX{}. It's been a fun ongoing project, and I've learned a lot as a result. I finally decided that instead of keeping notes everywhere (mostly in the preambles the documents I've been working on) I decided to write a little book that recorded what I've learned to use as a reference guide. If I had something like this when I started, things probably would have gone much more smoothly for me.
\paragraph{A Caveat} First, I am far from an expert in these matters. What follows is pretty much a listing of what I've gleaned from hours spent searching the internet and trying things out myself.
@ -147,13 +136,16 @@ Second, some things will look differently and behave differently for you dependi
\begin{enumerate}[noitemsep]
\item Don't compare yourself to others. Your mileage can—and will—vary, because people learn things at different rates and in different orders.
\item Practice doesn't make perfect, but it does make things less shitty.
\item Practice doesn't make perfect, but it does make things less bad.
\item A willingness to experiment is your best guide.
\item You will get errors as part of the learning process. Your goal should always be to get better errors.
\end{enumerate}
Also, if you have access to the source code so you can see how other people have done things, so much the better. (You can view the source code for this zine at \href{https://git.kjodle.net/kjodle/the-codex}{\texttt{https://git.kjodle.net/kjodle/the-codex}}.) In particular with \LaTeX{}, it can help if you create an MWE (minimal working example) when working with new things, to rule out interference from other bits of code.
When (not \textit{if}) you have problems, please consult the ``Troubleshooting'' chapter. It's not going to solve all, if any, of your problems, but it will suggest a general problem-shooting algorithm that will help you figure out where things are going wrong.
\chapter{Basics}
Also, if you have access to the source code so you can see how other people have done things, so much the better. (You can view the source code for this zine at \href{https://git.kjodle.net/kjodle/little-book-of-LaTeX}{\texttt{https://git.kjodle.net/kjodle/little-book-of-LaTeX}}.)
\chapter{\LaTeX{} Basics}
\section{Files}
@ -190,6 +182,19 @@ spaces.
\vspace{2mm}
\hrule
\section{Comments}
Comments are created by adding a \texttt{\%} to the line. Anything beyond the percent sign will be ignored when your document is compiled.
To create multi-line comments, surround those lines with \verb|\iffalse| and \verb|fi|:
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=Multi-line Comment Block]
\iffalse
These lines will not appear in your published text.
That is because they are surrounded by \iffalse and \fi.
If you didn't use that construction, you would need to put a \% in front of each line.
\fi
\end{Verbatim}
\section{Document Structure}
@ -222,7 +227,7 @@ Anything not in the preamble goes in the \texttt{document} environment, which lo
\end{document}
\end{Verbatim}
\subsection{Document Sections}
\subsection{Document Structure}
Each \LaTeX{} document can be divided into a hierarchical structure consisting of the following sections:
@ -248,13 +253,19 @@ Notice that we have the option \texttt{[Books]} which describes how this chapter
\chapter*{Books I Have Read}
\end{verbatim}
For best results, stick to the hierarchical structure shown above, as this is also how each section will be numbered. See the table of contents of this zine as an example.\footnote{I am a stickler about hierarchical structures because they represent logical, organized thinking about a subject. Not all subjects lend themselves to a perfectly hierarchical information structure, but we should always strive to be less disorganized (i.e., less shitty).}
For best results, stick to the hierarchical structure shown above, as this is also how each section will be numbered. See the table of contents of this zine as an example.
\subsection{Environments}
\noindent{} This is where \LaTeX{} shows its power, as environments are used to to take care of typesetting tasks. Every environment begins with \verb+\begin{<environment>}+ and ends with \verb+\end{<environment>}+. In fact, we've already seen one environment: the \texttt{document} environment, which encompasses our entire document. Here are a few other useful ones:
\subsubsection{Enumerate}
\chapter{Formatting Words}
\chapter{Formatting Paragraphs}
\chapter{List Environments}
\section{Enumerate}
\texttt{enumerate} is used to create numbered lists. They can be nested to create an outline. To prevent \LaTeX{} from adding a lot of space between the item numbers, add the \texttt{enumitem} package pass the \texttt{[noitemsep]} to the environment.
@ -300,7 +311,7 @@ For example, this code:
\end{spacing}
\vspace{2mm} \hrule
\subsubsection{Itemize}
\section{Itemize}
Similar to the \texttt{enumerate} environment, the \texttt{itemize} environment creates bulleted lists, which can also be indented.
@ -364,7 +375,7 @@ As an example, we'll use the above example, but in a bulleted list:
\item[$\triangle$] Third item
\end{itemize}
\subsection{Math in \LaTeX{}}
\chapter{Math in \LaTeX{}}
\LaTeX{} has a couple of different environments that are useful for typesetting math (\texttt{align} and \texttt{array}, but they get a little beyond what I want to cover here.\footnote{Maybe in a later issue? I can, if there is interest.} In addition, there are other packages (in particular \texttt{amsmath} and \texttt{mathtools}) that greatly extend the power of LaTeX to handle mathematical typesettings, but again, they are beyond the scope of this zine.
@ -391,14 +402,13 @@ The Pythagorean Theorem is \[x^2 + y^2 = z^2\]
The Pythagorean Theorem is \[x^2 + y^2 = z^2\]
\chapter{Images}
\paragraph{Installing \LaTeX{}} I realize that I haven't talked about how to install LaTeX, but that really depends on what system you are running. Trying to include every possible operating system could easily turn this from a zine into a book.\footnote{And a quickly outdated and inaccurate book, at that.} The best approach is to search for your operating system + ``install latex''.
\chapter{Referencing}
\chapter{Coda}
\chapter{Miscellaneous}
\section{What I Learned About \LaTeX{} While Creating This Issue}
@ -592,4 +602,8 @@ somewhere \textit{after} the start of the page.
\paragraph{I almost forgot to add:} If you are interested in seeing this project, you can view it at and download it from \href{https://git.kjodle.net/kjodle/Flatland}{\texttt{https://git.kjodle.net/kjodle/Flatland}}.
\chapter{Troubleshooting}
In particular with \LaTeX{}, it can help if you create an MWE (minimal working example) when working with new things, to rule out interference from other bits of code.
\end{document}