From d8b0603d8c9c36d7d07d135fd83dec22521a4116 Mon Sep 17 00:00:00 2001 From: Kenneth Odle Date: Fri, 24 Jul 2026 18:25:23 -0400 Subject: [PATCH] Numerous styling changes --- chapters/1-titlepage.tex | 2 +- chapters/ch00-intro.tex | 13 +++++++++++++ chapters/ch01-images.tex | 37 +++++++++++++++++++++++++++++++++++++ parts/1-packages.tex | 7 +++++++ parts/2-memoir.tex | 4 ++++ parts/4-commands.tex | 9 +++++++-- ulc_001.tex | 19 ++++++++----------- 7 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 chapters/ch00-intro.tex create mode 100644 chapters/ch01-images.tex diff --git a/chapters/1-titlepage.tex b/chapters/1-titlepage.tex index afec37c..4af536d 100644 --- a/chapters/1-titlepage.tex +++ b/chapters/1-titlepage.tex @@ -8,7 +8,7 @@ \noindent{}{\color{green5}\rule[2mm]{\textwidth}{0.5pt}} \vspace{2mm} -{\large SUBTITLE} +{\large \textit{A Grimoire of Command Line Magic}} \vspace{5mm} Issue \#\kissue{} diff --git a/chapters/ch00-intro.tex b/chapters/ch00-intro.tex new file mode 100644 index 0000000..08e0242 --- /dev/null +++ b/chapters/ch00-intro.tex @@ -0,0 +1,13 @@ +\chapter{Introduction} + +What follows here is a compendium of commands and their options that I have found useful while using Linux on the command line. That is all. This started out as notes to myself and I decided to make it a zine, based on the good feedback I got from my hand-written zine \textit{Do it in the Terminal}. I have intended to make a sequel to that one for some time, but because the amount of information I can contain in a zine of that size is limited, I decided to go with one set in \LaTeX{} instead. + +\paragraph{Organization} This zine is organized by the \textit{output}. For example, if you want to get images out of a pdf file, you would look in the ``Images'' chapter. If you want to get text out of a pdf, you would look in the ``Text'' chapter. If you want to \textit{convert} something to a pdf, or you want to combine pdf files into one (or separate one into many), then you would look in the ``PDF'' chapter. + +\paragraph{Installation} Many, but not all, of these packages are included by default in many (but again, not all) Linux distros. If they are not included in your distro, you will need to install them. I have not included installation information for two main reasons. First, it would simply take up too much space, especially for something that generally can be easily found at the other end of a web search. Second, these methods may change over time, rendering the information contained here obsolete. + +\paragraph{``Why didn't you include information about command \textit{X}?''} Probably because I have never used it and am thus not familiar with it, or don't use it often enough to warrant inclusion here. But I may possibly include it in a future issue. + +\paragraph{``How can I send you corrections or suggestions for future issues?''} My contact information is listed in the ``Impressum'' on page ii. + +\paragraph{Filenames} To keep things simple, the input file will always be ``input'' in the example code, and likewise, the output file name will always be ``output''. If a file extension is not required, it will not be included. For example ``input.pdf'' means the input \textit{must} be a pdf file, whereas ``input'' means it can be any type of file the application can handle. \ No newline at end of file diff --git a/chapters/ch01-images.tex b/chapters/ch01-images.tex new file mode 100644 index 0000000..2bf3366 --- /dev/null +++ b/chapters/ch01-images.tex @@ -0,0 +1,37 @@ +\chapter{Images} + +\section{To Convert a PDF to an Image} + +\lettrine[]{U}{se} the \texttt{pdftoppm} command (from the \label{poppler-utils} \texttt{poppler-utils} package) to convert part or all of a pdf to an image. For example, to convert a pdf to a png: + +\begin{Verbatim}[] +pdftoppm input.pdf output -png +\end{Verbatim} + +This will convert each page in the pdf to a png using the format ``output-01.png'' where ``01'' is the page number. To convert a single page of a multipage pdf, use the \texttt{-f} flag to specify which page to use. For example, this will convert page 5 to a png: + +\begin{Verbatim}[] +pdftoppm input.pdf output -png -f 5 -singlefile +\end{Verbatim} + +To convert a range of pages, use the \texttt{-f} flag to specify the first page to convert and use the \texttt{-l} flag to specify the last page of the range: + +\begin{Verbatim}[] +pdftoppm input.pdf output -png -f 5 \l 10 -singlefile +\end{Verbatim} + +The default resolution is 150 dpi. To change this, use the \texttt{-rx} flag to specify the resolution along the x-axis, and the \texttt{-ry} flag to specify the resolution along the y-axis; + +\begin{Verbatim}[] +pdftoppm input.pdf output -png -rx 300 -ry 300 +\end{Verbatim} + +Doubling the resolution along both axes will increase the file size by an approximate factor of four, and will also increase the amount of detail in the image. + +\section{To Extract Images from a PDF File} + +\lettrine[findent=0mm]{T}{o} extract images from a pdf file, use the \texttt{pdfimages} command (also from package mention in \S \ref{poppler-utils} ). + +\section{This is just a test} + +And this is just some text. \ No newline at end of file diff --git a/parts/1-packages.tex b/parts/1-packages.tex index d6f631a..bde69af 100644 --- a/parts/1-packages.tex +++ b/parts/1-packages.tex @@ -1,5 +1,6 @@ %% Generic packages \usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} \usepackage{ninecolors} \usepackage{lettrine} % Drop caps \usepackage[object=vectorian]{pgfornament} @@ -9,5 +10,11 @@ \usepackage{wrapfig} \usepackage{float} % Allow floats in multicol environments \usepackage{tcolorbox} +\usepackage{fancyvrb} +\usepackage{aurical} % Font for section titles +%\usepackage{libertinus} % Font for section titles +%\usepackage{uncial} % Font for section titles +%\usepackage{Zallman} % Font for drop caps +\usepackage{EileenBl} % Font for drop caps \usepackage[hidelinks]{hyperref} diff --git a/parts/2-memoir.tex b/parts/2-memoir.tex index 238a79c..cd90c0c 100644 --- a/parts/2-memoir.tex +++ b/parts/2-memoir.tex @@ -6,6 +6,9 @@ \setlrmarginsandblock{12mm}{15mm}{*} \setulmarginsandblock{22mm}{20mm}{*} +% Command for uncial font +% \newcommand{\kfont}{\fontfamily{uncial}\selectfont} + %%% Chapter titles %% Specific to Memoir class \makechapterstyle{kchap}{ \renewcommand*{\chapterheadstart}{\vspace*{\beforechapskip}} @@ -22,6 +25,7 @@ \setlength{\beforechapskip}{0mm} \setlength{\midchapskip}{2mm} \setlength{\afterchapskip}{10mm} +\setsecheadstyle{\Fontlukas\slshape\bfseries\large}% Set \section style } \makechapterstyle{kfront}{ diff --git a/parts/4-commands.tex b/parts/4-commands.tex index 2c7c22d..6749adf 100644 --- a/parts/4-commands.tex +++ b/parts/4-commands.tex @@ -18,7 +18,7 @@ %%% Text decorations \newcommand{\kdec}{ \noindent{}\begin{center} - \pgfornament[scale=0.25,color=green6]{85} + \pgfornament[scale=0.1]{85} \end{center} } @@ -47,4 +47,9 @@ sharp corners=all, boxrule=0.75pt, colframe=gray8, -} \ No newline at end of file +} + +% Lettrine options +%\renewcommand{\LettrineFontHook}{\Zallmanfamily} %\color{green5}} % Initial font and color +\renewcommand{\LettrineFontHook}{\EileenBlfamily} %\color{green5}} % Initial font and color +%\renewcommand*{\DefaultLhang}{0.5} % Default lhang value \ No newline at end of file diff --git a/ulc_001.tex b/ulc_001.tex index 313e4cf..74a3017 100644 --- a/ulc_001.tex +++ b/ulc_001.tex @@ -21,9 +21,11 @@ \tableofcontents \clearpage % Delete if TOC runs to 2n pages +\iffalse % Comment out the list of figures \pagestyle{empty} \listoffigures \clearpage +\fi %%% Begin Contents @@ -32,18 +34,13 @@ \pagestyle{kpage} \chapterstyle{kchap} +% Chapter 0 is the introduction +\setcounter{chapter}{-1} + %%% Input chapters here -% \input{chapters/ch01} +\input{chapters/ch00-intro} +\input{chapters/ch01-images} % \input{chapters/ch02} % \input{chapters/ch03} -\end{document} - -%%% Chapter template -\chapter{} - -\begin{multicols*}{2} - -\lettrine[lraise=0.0, nindent=-0pt]{}{} - -\end{multicols*} \ No newline at end of file +\end{document} \ No newline at end of file