Added section about LaTeX without a GUI
This commit is contained in:
parent
af862b1e78
commit
4aa7c8cdcf
@ -63,9 +63,10 @@
|
||||
\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
|
||||
% \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-
|
||||
@ -309,8 +310,7 @@ And that's it. Just about anything you type often on the command line can be tur
|
||||
|
||||
I have an app on my phone called ``The Stoic'' that shows quotations from various Stoic philosophers. As I was working on this issue, this popped up:
|
||||
|
||||
\AtBeginEnvironment{quote}{\singlespacing\small}
|
||||
|
||||
\begin{small}
|
||||
\begin{quote}
|
||||
Because a thing seems difficult for you, do not think it impossible for anyone to accomplish.
|
||||
|
||||
@ -318,6 +318,7 @@ Because a thing seems difficult for you, do not think it impossible for anyone t
|
||||
---\textbf{Marcus Aurelius}
|
||||
\end{flushright}
|
||||
\end{quote}
|
||||
\end{small}
|
||||
|
||||
\chapter{Coda}
|
||||
|
||||
@ -328,8 +329,55 @@ As a big part of the reason I created this was to learn more about LaTeX, I'm ke
|
||||
\begin{enumerate}
|
||||
\item Need a little horizontal space? Use \verb|\hphantom{<stuff>}| where \texttt{<stuff>} is any standard unit. (I use this down below to separate the two images with borders when they are on the same line.)
|
||||
\item Need a box around an \verb|\includegraphics[scale=•]{•}| item? Just wrap it in \verb|\frame{}|. (Ditto.)
|
||||
\item Want a blockquote? Use the \texttt{quote} environment.
|
||||
\end{enumerate}
|
||||
|
||||
\subsection{\LaTeX{} Without a GUI}
|
||||
|
||||
Despite my blathering on about the benefits of the command line, I'm actually using a GUI editor called Texmaker (which you can find at \href{https://www.xm1math.net/texmaker/}{\texttt{https://www \\ .xm1math.net/texmaker/}}). This seemed the easiest way to learn LaTeX at the time, because all you have to do to get a readable pdf is to press \texttt{F1}.
|
||||
|
||||
But you don't need to go that route. You can do this entirely from the command line. Simply create a LaTeX document in any text editor, and save it with a \texttt{.tex} extension. From that point, simply run the following command in a terminal:
|
||||
|
||||
\begin{verbatim}
|
||||
$ latex file.tex
|
||||
\end{verbatim}
|
||||
|
||||
This command should generate the following files:
|
||||
|
||||
\begin{verbatim}
|
||||
file.dvi
|
||||
file.aux
|
||||
file.log
|
||||
\end{verbatim}
|
||||
|
||||
\texttt{file.aux} contains information your document needs to manage any cross-references in your document. \texttt{file.log} contains information about how your file was processed; if you run into errors, this is a good place to find a solution, or at least to find what to search the internet for. But it's the \texttt{file.dvi} file that we're interested in.
|
||||
|
||||
\texttt{.dvi} files are device independent files. They're a lot like PostScript or PDF, but without font embedding. To convert this to a pdf file, run the following command:
|
||||
|
||||
\begin{verbatim}
|
||||
$ dvipdf file.dvi
|
||||
\end{verbatim}
|
||||
|
||||
This should generate \texttt{file.pdf} which you can read in any document viewer. You may need to install \texttt{dvipdf}---on my system (Ubuntu 20.04) it was not installed.
|
||||
|
||||
You can also just run \texttt{pdflatex} (which again, you may have to install), which skips over making a \texttt{.dvi} file:
|
||||
|
||||
\begin{verbatim}
|
||||
$ pdflatex file.tex
|
||||
\end{verbatim}
|
||||
|
||||
This should generate the following files:
|
||||
|
||||
\begin{verbatim}
|
||||
file.aux
|
||||
file.log
|
||||
file.pdf
|
||||
\end{verbatim}
|
||||
|
||||
I have noticed that when I generate the pdf file using the former method, I get a much smaller file than I do the second time. As an experiment, I ran the \texttt{integral.tex} file I created earlier through both of these methods. Running the file through \texttt{latex} and then through \texttt{dvipdf} resulted in a pdf file that was only 7.0 kb in size. But when I ran it solely through \texttt{pdflatex}, I ended up with a pdf file that was 30.5 kb big. This is most likely due to a difference in compression methods, \footnote{See this for more information: \href{https://tex.stackexchange.com/questions/38145/why-does-pdflatex-produce-bigger-output-files-than-latexdvipdfm}{\texttt{https://tex.stackexchange.com/questions/38145/why-does-pdflatex-produce-bigger-output-files-than-latexdvipdfm}}} so this could make a difference for you if you are working with large documents.
|
||||
|
||||
Go forth and manage your mischief.
|
||||
|
||||
\subsection{Custom Page Sizes}
|
||||
|
||||
Okay, this is important enough that it deserves its own section.
|
||||
|
Loading…
Reference in New Issue
Block a user