Browse Source

Added section about LaTeX without a GUI

Kenneth John Odle 3 years ago
  1. 56


@ -63,9 +63,10 @@
% Style a blockquote
% 2021.11.22 -- Not really sure I need this anymore.
% See
\usepackage{setspace} % for \onehalfspacing and \singlespacing macros
% \usepackage{etoolbox}
% \usepackage{setspace} % for \onehalfspacing and \singlespacing macros
% See also
% 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:
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}
@ -328,8 +329,55 @@ As a big part of the reason I created this was to learn more about LaTeX, I'm ke
\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.
\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{}{\texttt{https://www \\}}). 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:
$ latex file.tex
This command should generate the following files:
\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:
$ dvipdf file.dvi
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:
$ pdflatex file.tex
This should generate the following files:
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{}{\texttt{}}} 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.