diff --git a/commands.tex b/commands.tex index c8ff9a6..36c776f 100644 --- a/commands.tex +++ b/commands.tex @@ -34,6 +34,54 @@ \rule{\widefigurewidth}{0.4pt} } +% Shell command +% ============== +% Mono-spaced text without syntax highlighting. +% Intended for full commands. Wrapped by empty lines. +\newcommand\shell[1]{% +\vspace{.5cm} +\noindent \hspace*{-1em}{\color{lightgray}\texttt{\$ }}\texttt{#1} +\vspace{.5cm} +} + +% Command parts +% =================== +% Mono-spaced text without syntax highlighting. +% Intended for parts of shell commands. +% Displayed inline. +\newcommand\sh[1]{% + \texttt{#1}% +} + +% Package names +% ============= +% Mono-spaced text without syntax highlighting. +% Intended for LaTeX package names. +\newcommand\pkg[1]{% + \texttt{#1}% +} + +% File paths +% ========== +% Mono-spaced text without syntax highlighting. +% Intended for file names and paths. +\newcommand\file[1]{% + \texttt{#1}% +} + +% Inline code +% =========== +% Code snippets with syntax highlighting. +% TODO: Fix special character mess. +% +% Arguments: +% 1. Language. +% 2. Source code. +\newcommand\code[2]{% + % \mintinline{#1}{#2} + \texttt{#2}% +} + % Simple code examples % ==================== % Box for example code next to the rendered example. diff --git a/content/basic-document-structure.tex b/content/basic-document-structure.tex index 2fa0dd9..0c98d02 100644 --- a/content/basic-document-structure.tex +++ b/content/basic-document-structure.tex @@ -14,23 +14,24 @@ A minimal preamble should contain the following specifications: \subsection{Document class}\label{sec:document-class} We can define a document class by using the command \mintinline[breaklines,breakafter=-,breakaftersymbolpre={}]{latex}|\documentclass[]{}|. -The most commonly used document classes that are supported by default are \mintinline{latex}{article} for short documents, and \mintinline{latex}{report} for longer ones. -Furthermore, you can use \mintinline{latex}{book} for books, \mintinline{latex}{beamer}\footnote{We do not cover making presentations in \LaTeX{} in this tutorial. However, if you are interested in the topic, we recommend this introduction on Overleaf: \url{https://www.overleaf.com/learn/latex/Beamer}} for presentations, and \mintinline{latex}{letter}\footnote{We also do not cover letters in this script. An introduction can be found on WikiBooks: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} for letters. +\todo{Wie sollen wir das abbilden?} +The most commonly used document classes that are supported by default are \pkg{article} for short documents, and \pkg{report} for longer ones. +Furthermore, you can use \pkg{book} for books, \pkg{beamer}\footnote{We do not cover making presentations in \LaTeX{} in this tutorial. However, if you are interested in the topic, we recommend this introduction on Overleaf: \url{https://www.overleaf.com/learn/latex/Beamer}} for presentations, and \mintinline{latex}{letter}\footnote{We also do not cover letters in this script. An introduction can be found on WikiBooks: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} for letters. In addition to the standard document classes, the \acro{KOMA} script classes have been developed. They provide alternatives to the document classes mentioned above: -In lieu of \mintinline{latex}{article} you can use \mintinline{latex}{scrartcl}, \mintinline{latex}{report} is replaced by \mintinline{latex}{scrreprt},\footnote{Those vowels are indeed missing, do not try to insert them.} and \mintinline{latex}{scrbook} can be used instead of \mintinline{latex}{book}. -As a replacement for \mintinline{latex}{letter}, one can use \mintinline{latex}{scrlttr2}. -A complete list of all \acro{KOMA} script classes is available online.\footnote{Available at: \url{https://komascript.de/omascriptbestandteile}} +In lieu of \pkg{article} you can use \pkg{scrartcl}, \pkg{report} is replaced by \pkg{scrreprt},\footnote{Those vowels are indeed missing, do not try to insert them.} and \pkg{scrbook} can be used instead of \pkg{book}. +As a replacement for \pkg{letter}, one can use \pkg{scrlttr2}. +A complete list of all \acro{KOMA} script classes is available online.\footnote{Available at: \url{https://komascript.de/komascriptbestandteile}} By using \acro{KOMA} document classes, the layout of the generated \acro{PDF} document is changed. On top of that, they provide additional functionalities. The standard document classes are designed according to US-American conventions whereas \acro{KOMA} classes adhere to European norms, e.\,g., for writing letters. -Each \mintinline{latex}{\documentclass} command can hold optional parameters in +Each \code{latex}{\textbackslash documentclass} command can hold optional parameters in square brackets. -\mintinline{latex}{\documentclass[10pt,a5paper,landscape]{scrartcl}}, for instance, configures a \acro{KOMA} script article and sets its font size to 10\,pt,\footnote{The standard font size is 12\,pt.} the page size to A5,\footnote{The default case would be A4.} and the orientation of the page to landscape. +\code{latex}{\textbackslash documentclass[10pt,a5paper,landscape]\{scrartcl\}}, for instance, configures a \acro{KOMA} script article and sets its font size to 10\,pt,\footnote{The standard font size is 12\,pt.} the page size to A5,\footnote{The default case would be A4.} and the orientation of the page to landscape. The language can be passed as an optional parameter, too (cf. \cref{sec:language}). \subsection{Digression: packages} @@ -58,22 +59,22 @@ It is an American character encoding and therefore does not contain German umlau Instead, \acro{UTF-8}\footnote{cf. \url{https://en.wikipedia.org/wiki/UTF-8}} can be used as a universal character encoding. In \LaTeX{}, we need to specify two character encodings: -The input encoding (\mintinline{latex}{inputenc}), which refers to our source code, and the font encoding (\mintinline{latex}{fontenc}), which determines what the content of our \acro{PDF} document looks like.\footnote{Details on \mintinline{latex}{fontenc} can be found at: \url{https://tex.stackexchange.com/questions/108417/font-encoding-in-latex}} -\mintinline{latex}{T1} is an encoding that tries to cover most European languages with a limited number of characters. +The input encoding (\sh{inputenc}), which refers to our source code, and the font encoding (\sh{fontenc}), which determines what the content of our \acro{PDF} document looks like.\footnote{Details on \sh{fontenc} can be found at: \url{https://tex.stackexchange.com/questions/108417/font-encoding-in-latex}} +\pkg{T1} is an encoding that tries to cover most European languages with a limited number of characters. \subsection{Language}\label{sec:language} \begin{minted}{latex} \usepackage[ngerman]{babel} \end{minted} -The package \mintinline{latex}{babel} provides language-specific information (e.\,g., on hyphenation, special characters, changing fonts, translation of labels\footnote{cf. \cref{sec:references}} like \enquote{Chapter,} \enquote{Table of Contents,} or \enquote{Figure.} +The package \pkg{babel} provides language-specific information (e.\,g., on hyphenation, special characters, changing fonts, translation of labels\footnote{cf. \cref{sec:references}} like \enquote{Chapter,} \enquote{Table of Contents,} or \enquote{Figure.} The desired language can be passed as an optional parameter. -\mintinline{latex}{ngerman}, for instance, is used for the new German spelling. -Some packages require that the language is already passed as an optional parameter in the \mintinline{latex}{\documentclass} command. -In this case, just leave out the optional parameter for the language within the \mintinline{latex}{babel} inclusion command. +\pkg{ngerman}, for instance, is used for the new German spelling. +Some packages require that the language is already passed as an optional parameter in the \code{latex}{\textbackslash documentclass} command. +In this case, just leave out the optional parameter for the language within the \pkg{babel} inclusion command. We can also use multiple languages in our document. To do so, we pass the languages, separated by commas, as an optional parameter to the babel inclusion command. -Within our document, we can switch between languages with the \mintinline{latex}{\selectlanguage{}} command. +Within our document, we can switch between languages with the \code{latex}{\textbackslash selectlanguage\{\}} command. Alternatively, foreign-language text can be declared by using the following command: \begin{minted}{latex} @@ -81,13 +82,13 @@ Alternatively, foreign-language text can be declared by using the following comm \end{minted} \section{Document environment} -The actual content of the \acro{PDF} document needs to be put between \mintinline{latex}{\begin{document}} and \mintinline{latex}{\end{document}}. +The actual content of the \acro{PDF} document needs to be put between \code{latex}{\textbackslash begin\{document\}} and \code{latex}{\textbackslash end\{document\}}. \subsection{Continuous text} The easiest content that we can integrate into the document environment is continuous text. We can write it directly into our source code. Line breaks and multiple consecutive spaces are ignored by \LaTeX{}. -Blank lines create a new paragraph, that is indented by default.\footnote{The automatic indentation of new paragraphs can be prevented by using the command \mintinline{latex}{\noindent}.} +Blank lines create a new paragraph, that is indented by default.\footnote{The automatic indentation of new paragraphs can be prevented by using the command \code{latex}{\textbackslash noindent}.} Manual line breaks can be enforced with two backslashes (\textbackslash\textbackslash). This should be avoided, though. @@ -106,7 +107,7 @@ The commands that are depicted in \cref{lst:headlines} can be used with any docu \Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Heading Levels} -Some document classes provide additional commands. In a \texttt{report}, you get \mintinline{latex}{\chapter{Chapter}}, and in a \texttt{book}, additionally \mintinline{latex}{\part{Part}}. +Some document classes provide additional commands. In a \pkg{report}, you get \code{late}{\textbackslash chapter\{Chapter\}}, and in a \pkg{book}, additionally \code{latex}{\textbackslash part\{Part\}}. You can mark the command with an asterisk if you want to omit the numbering of a section and exclude it from the table of contents:\footnote{cf. \cref{sec:table-of-contents}} \begin{minted}{latex} @@ -120,20 +121,20 @@ An alternative title for the table of contents can be declared as an optional pa \end{minted} \subsection{Front matter} -A simple front matter can be created by using the command \mintinline{latex}{\maketitle}. +A simple front matter can be created by using the command \code{latex}{\textbackslash maketitle}. The values to be inserted into the front matter must be specified within the preamble. -Multiple authors are joined by \mintinline{latex}{\and}. -If the date is not specified by the \mintinline{latex}{\date} command, the current date will be inserted by default. +Multiple authors are joined by \code{latex}{\textbackslash and}. +If the date is not specified by the \code{latex}{\textbackslash date} command, the current date will be inserted by default. The design of the front matter depends on the specified document class. \Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{The front matter} \subsection{Indices}\label{sec:table-of-contents} -The command \mintinline{latex}{\tableofcontents} generates an automatically numbered table of contents by making use of the above-mentioned commands for dividing our text into sections and chapters (this can bee seen in \cref{lst:main-file} on \cpageref{lst:main-file}). +The command \code{latex}{\textbackslash tableofcontents} generates an automatically numbered table of contents by making use of the above-mentioned commands for dividing our text into sections and chapters (this can bee seen in \cref{lst:main-file} on \cpageref{lst:main-file}). The numbering style and depth, and many other options can, of course, be specified manually.\footnote{We recommend the following blogpost: \url{https://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/}} For \LaTeX{} to create our table of contents properly, the project has to be compiled twice. -Besides the table of contents, you can also generate a \mintinline{latex}{\listoffigures} (list of figures) and a \mintinline{latex}{\listoftables} (list of tables). +Besides the table of contents, you can also generate a \code{latex}{\textbackslash listoffigures} (list of figures) and a \code{latex}{\textbackslash listoftables} (list of tables). The captions of your figures and tables will appear within those indices.\footnote{cf. \cref{sec:graphics} (Graphics) and \cref{sec:tables} (Tables) for more information on captions} diff --git a/content/basic-functionality.tex b/content/basic-functionality.tex index 947c828..3112de8 100644 --- a/content/basic-functionality.tex +++ b/content/basic-functionality.tex @@ -21,9 +21,9 @@ When all the source code has been processed by the compiler, we get the final do There are different export options, but most of the time we output the document as a \acro{PDF}\,---\,just like in Word. As a brief example for a command, we shall use the emphasis of words or sentences. -The command is \mintinline{latex}{\emph{}}. +The command is \code{latex}{\textbackslash emph\{\}}. We write the text we want to emphasize inside the curly braces in the source code, like this: -\mintinline{latex}{\emph{Good morning!}}. +\code{latex}{\textbackslash emph\{Good morning!\}}. In the resulting \acro{PDF}, this text will appear in italics: \emph{Good morning!} There is no trace of the command identifier and the special characters. You can see, we are not writing italic text inside the source code, we just tell the compiler that certain words should be emphasized by the use of a command. @@ -31,7 +31,7 @@ You can see, we are not writing italic text inside the source code, we just tell This simple example illustrates a strength of the \acro{WYGIWYM} principle. We mark text elements on a semantic level and can make the associated typographic adjustments centrally\,---\,or let \LaTeX{} do the configuration itself. For instance, if we want to change the way highlighting is done, we can configure this once. -At all places where \mintinline{latex}{\emph{}} is used, the final result will be adjusted accordingly. +At all places where \code{latex}{\textbackslash emph\{\}} is used, the final result will be adjusted accordingly. There is no need to make adjustments at each occurrence of an emphasized word. The principle is similar to style sheets in office programs, although more consistent and powerful. @@ -77,11 +77,11 @@ Some examples are shown in \cref{tbl:latex-commands}. \toprule Command & Effect \\ \midrule - \mintinline{latex}{\newpage} & inserts a new page \\ - \mintinline{latex}{\textbf{Text}} & prints the text in bold font \\ - \mintinline{latex}{\usepackage[utf8]{inputenc}} & sets the text encoding to \acro{UTF-8} \\ - \mintinline{latex}{\documentclass[a4paper,12pt]{article}} & specifies the document class \\ - \mintinline{latex}{\frac{3}{4}} & inserts a mathematical fraction \\ + \code{latex}{\textbackslash newpage} & inserts a new page \\ + \code{latex}{\textbackslash textbf\{Text\}} & prints the text in bold font \\ + \code{latex}{\textbackslash usepackage[utf8]\{inputenc\}} & sets the text encoding to \acro{UTF-8} \\ + \code{latex}{\textbackslash documentclass[a4paper,12pt]\{article\}} & specifies the document class \\ + \code{latex}{\textbackslash frac\{3\}\{4\}} & inserts a mathematical fraction \\ \bottomrule \end{tabular} } @@ -91,7 +91,7 @@ Some examples are shown in \cref{tbl:latex-commands}. If a command allows multiple optional parameters that accept similar inputs, it is sometimes necessary to specify which parameter is meant. For example, the command for embedding graphics accepts optional parameters for width and height. -If \mintinline{tex}|[12cm, 4cm]| were entered, it would be unclear which value is intended for which parameter. +If \sh{[12cm, 4cm]} were entered, it would be unclear which value is intended for which parameter. To make the assignment more concrete, it is possible to specify the parameters explicitly: \begin{minted}{tex} \includegraphics[width=12cm, height=4cm]{picture.png} diff --git a/content/first-steps-with-latex.tex b/content/first-steps-with-latex.tex index a718cc8..183d00c 100644 --- a/content/first-steps-with-latex.tex +++ b/content/first-steps-with-latex.tex @@ -21,8 +21,8 @@ Let’s start with the compiler. (Seriously!) We will need it to convert the source code that we are going to write into a \acro{PDF}. There are different compilers for different operating systems; -for example, MikTeX for Windows,\footnote{\url{https://miktex.org/download}} Mac\TeX{} for macOS,\footnote{\url{http://tug.org/mactex/}} and \TeX{}Live for Linux distributions.\footnote{If you are using a Debian-based Linux distribution, you can install the compiler by executing \mintinline{bash}{sudo apt install texlive-full} -For other distributions, you find instructions on \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.} +for example, MikTeX for Windows,\footnote{\url{https://miktex.org/download}} Mac\TeX{} for macOS,\footnote{\url{http://tug.org/mactex/}} and \TeX{}Live for Linux distributions.\footnote{If you are using a Debian-based Linux distribution, you can install the compiler by executing \sh{sudo apt install texlive-full} +For other distributions, you find instructions on \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.} In case you get to choose, it is best to install the full version with all packages. \section*{Editor} @@ -36,14 +36,15 @@ One of these programs is \TeX{}studio.\footnote{You find the latest version on \ To prevent errors during the compilation of our document, you have to change the compiler command. In \TeX{}studio, click on the \emph{Options} button and then on \emph{Configure \TeX{}studio \textellipsis}\todo{Add the correct steps for Mac (these don’t apply)}. A new window will open up. -Navigate to the \emph{Commands} area, and, next to \texttt{pdflatex}, add the flag \mintinline{bash}{-shell-escape}. -In other words: The command for \texttt{pdflatex} should look like this: -\mint{bash}{pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex} +Navigate to the \emph{Commands} area, and, next to \sh{pdflatex}, add the flag \sh{-shell-escape}. +In other words: The command for \sh{pdflatex} should look like this: + +\shell{pdflatex -synctex=1 -interaction=nonstopmode -shell-escape \%.tex} \section*{Compiling for the first time} -Open up the file \mintinline{bash}{main.tex} in the root directory of the project and compile it by pressing \faForward. +Open up the file \file{main.tex} in the root directory of the project and compile it by pressing \faForward. Looking at the directory in your file explorer, you should see a few new files. -The \mintinline{bash}{main.pdf} file contains the compiled document. +The \file{main.pdf} file contains the compiled document. The other files are auxiliary files that the compiler uses, for example, to generate the table of contents. You are now ready to go! diff --git a/content/footnotes.tex b/content/footnotes.tex index b9f7705..2fa55ef 100644 --- a/content/footnotes.tex +++ b/content/footnotes.tex @@ -2,17 +2,17 @@ \label{sec:footnotes} Whenever we want to include footnotes into our \LaTeX{} document, we can use -the command \mintinline{latex}{\footnote{}}. At the position where we use +the command \code{latex}{\textbackslash footnote{}}. At the position where we use the command, the correct number will be inserted automatically, and the text within the curly braces will appear in the footer. In combination with the -package \mintinline{latex}{hyperref}, \acro{URL}s within footnotes become -clickable.\footnote{if we use the command \mintinline{latex}{\url{…}}} +package \pkg{hyperref}, \acro{URL}s within footnotes become +clickable.\footnote{if we use the command \code{latex}{\textbackslash url{…}}} We can see examples for that in the whole document. -The package \mintinline{latex}{footmisc} provides us with additional options for how to display footnotes. They can be passed as optional parameters to the command \mintinline{latex}{\usepackage}: +The package \pkg{footmisc} provides us with additional options for how to display footnotes. They can be passed as optional parameters to the command \code{latex}{\textbackslash usepackage}: \begin{itemize} - \item \mintinline{latex}{\usepackage[perpage]{footmisc}} ensures that the count of footnotes begins at 1 for each new page. - \item \mintinline{latex}{\usepackage[para]{footmisc}} lets the footnotes within the footer appear as continuous text (i.\,e., the footnotes can also appear next to each other). - \item \mintinline{latex}{\usepackage[symbol]{footmisc}} causes a numbering with symbols (e.\,g., \textdagger, \textdaggerdbl) instead of numbers. + \item \code{latex}{\textbackslash usepackage[perpage]\{footmisc\}} ensures that the count of footnotes begins at 1 for each new page. + \item \code{latex}{\textbackslash usepackage[para]\{footmisc\}} lets the footnotes within the footer appear as continuous text (i.\,e., the footnotes can also appear next to each other). + \item \code{latex}{\textbackslash usepackage[symbol]\{footmisc\}} causes a numbering with symbols (e.\,g., \textdagger, \textdaggerdbl) instead of numbers. \end{itemize} diff --git a/content/formatting-paragraphs.tex b/content/formatting-paragraphs.tex index 7979b60..ca0a0c9 100644 --- a/content/formatting-paragraphs.tex +++ b/content/formatting-paragraphs.tex @@ -5,10 +5,10 @@ \label{sec:ragged-alignment} By default, \LaTeX{} sets continuous text in full justification. However, we can also switch to ragged alignment by using the commands -\mintinline{tex}|\raggedright|, \mintinline{tex}|\raggedleft|, and -\mintinline{tex}|\centering|. +\code{latex}{\textbackslash raggedright}, \code{latex}{\textbackslash raggedleft}, and +\code{latex}{\textbackslash centering}. These commands influence the environment that they are used in, e.\,g., the -\texttt{document} environment. Correspondingly, the text within the whole +\sh{document} environment. Correspondingly, the text within the whole document is affected. Alternatively, we can use dedicated environments in order to influence the formatting @@ -20,9 +20,9 @@ alignment} \section*{Indentation and spacing} \label{sec:indents-and-parskips} Usually, we illustrate a new paragraph by indenting the first line of it -(\mintinline{tex}{\parindent}). +(\code{latex}{\textbackslash parindent}). Alternatively, paragraph spacing, i.\,e., vertical space between paragraphs, -can be used (\mintinline{tex}{\parskip}). +can be used (\code{latex}{\textbackslash parskip}). For both variants, there are adjustable parameters: \begin{minted}{tex} \setlength{\parindent}{0pt} @@ -32,7 +32,7 @@ For both variants, there are adjustable parameters: } \end{minted} -\noindent We can use \mintinline{tex}{\noindent} to turn off the indentation for only one +\noindent We can use \code{latex}{\textbackslash noindent} to turn off the indentation for only one paragraph. For the first paragraph after a heading, there is usually no indentation. diff --git a/content/graphics.tex b/content/graphics.tex index 96d7e03..4f75e3b 100644 --- a/content/graphics.tex +++ b/content/graphics.tex @@ -15,7 +15,7 @@ In order to be able to reference graphics, the package \texttt{graphicx} has to \end{figure} \end{minted} -\noindent The command \mintinline{latex}{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, as illustrated by the following example: +\noindent The command \sh{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, as illustrated by the following example: \begin{minted}{latex} \includegraphics[width=0.5\textwidth,height=5cm]{} @@ -58,5 +58,5 @@ On top of that, we can limit the positioning of our image more or less rigorousl Besides the vertical positioning, also the horizontal orientation may be of importance. By default, graphics are left-justified. -The command \mintinline{latex}{\centering} centers all following objects in the current environment. -If we want the centering to affect only one object, we can alternatively wrap it with \mintinline{latex}{\begin{center}} and \mintinline{latex}{\end{center}}. +The command \code{latex}{\textbackslash centering} centers all following objects in the current environment. +If we want the centering to affect only one object, we can alternatively wrap it with \code{latex}{\textbackslash begin\{center\}} and \code{latex}{\textbackslash end\{center\}}. diff --git a/content/lists.tex b/content/lists.tex index aab3816..6a9e24c 100644 --- a/content/lists.tex +++ b/content/lists.tex @@ -6,18 +6,18 @@ For each of these types, there are dedicated environments whose structure is ver \example{lst:unordered-list}{lists/nested-list}{Examplary unordered list} -In \cref{lst:unordered-list-code}, different list items (\mintinline{latex}{\item}) are framed by an \mintinline{latex}{itemize} environment. +In \cref{lst:unordered-list-code}, different list items (\code{latex}{\textbackslash item}) are framed by an \sh{itemize} environment. Within a list item, we can open a new list environment to create a nested list. -If we replace \mintinline{latex}{itemize} by \mintinline{latex}{enumerate}, the list becomes ordered without changing the source code any further. -To make use of the less common description lists, we have to specify the environment \mintinline{latex}{description}. +If we replace sh{itemize} by sh{enumerate}, the list becomes ordered without changing the source code any further. +To make use of the less common description lists, we have to specify the environment \sh{description}. Moreover, the items need to be extended by the term to be defined, put in brackets (\cref{lst:description-list}). \Example{lst:description-list}{lists/description-list}{lists/description-list_crop}{Exemplary description list} -The exuberant spacing between list items can be reduced by utilizing the \mintinline{latex}{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} package. -To do so, we simply adjust the environment name: \mintinline{latex}{compactitem} replaces \mintinline{latex}{itemize}, \mintinline{latex}{compactenum} replaces \mintinline{latex}{enumerate}, and \mintinline{latex}{compactdesc} replaces \mintinline{latex}{description}. -If the list ought to appear within a text body, \mintinline{latex}{paralist} provides the extra environments \mintinline{latex}{inparaenum} and \mintinline{latex}{inparaitem}. +The exuberant spacing between list items can be reduced by utilizing the \sh{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} package. +To do so, we simply adjust the environment name: sh{compactitem} replaces sh{itemize}, sh{compactenum} replaces sh{enumerate}, and sh{compactdesc} replaces sh{description}. +If the list ought to appear within a text body, \pkg{paralist} provides the extra environments \sh{inparaenum} and \sh{inparaitem}. -We can customize bullet and list numbering styles via the \mintinline{latex}{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} package. -\mintinline{latex}{\begin{enumerate}[label=\roman*]} produces a list with Roman numerals. -The parameter \mintinline{latex}{[label=\alph*]} inserts alphabetical numbering. +We can customize bullet and list numbering styles via the \pkg{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} package. +\code{latex}{\textbackslash begin\{enumerate\}[label=\textbackslash roman*]} produces a list with Roman numerals. +The parameter \code{latex}{[label=\textbackslash alph*]} inserts alphabetical numbering. diff --git a/content/literature.tex b/content/literature.tex index 194b6a7..661e523 100644 --- a/content/literature.tex +++ b/content/literature.tex @@ -4,7 +4,7 @@ For typesetting our first thesis in \LaTeX{}, the last core functionality to learn is citing literature. Our references are gathered in a bibliography file. Once we reference one of its entries from our \LaTeX{} document, Bib\TeX{} (a -program similar to the standard \texttt{pdflatex} compiler) +program similar to the standard \sh{pdflatex} compiler) can insert automatically generated citations. It will format them in a bibliography style of our choice. @@ -28,7 +28,7 @@ An exemplary item can be seen in \cref{lst:bibfile-sample-entry}. \label{lst:bibfile-sample-entry} \end{figure} -The type of the bibliography entry is specified after the opening \texttt{@} sign (e.\,g., article, book, proceedings, …). +The type of the bibliography entry is specified after the opening \sh{@} sign (e.\,g., article, book, proceedings, …). What follows is a list of important attributes like title and author. Whether they are required or not depends on the type of the entry. In any case, we will need the first entry after the opening braces: the Bib\TeX{} key. @@ -52,26 +52,26 @@ A high-quality (although, unfortunately, incomplete) source for Bib\TeX{} entrie \section{Citing} Bib\TeX{} extends \LaTeX{} by several commands (cf. \cref{tbl:bibtex-commands}). -Make sure to include the \mintinline{sh}{natbib} package for this purpose. +Make sure to include the \pkg{natbib} package for this purpose. \begin{table}[H] \centering \begin{tabular}{ll} \toprule Function & Command \\ \midrule - Citing sources & \mintinline{latex}{\cite{}} \\ - Citing pages & \mintinline{latex}{\cite[p. 15]{}} \\ - Custom citations & \mintinline{latex}{\cite[][]{}} \\ - Including the bibliography & \mintinline{latex}{\bibliography{}} \\ - Setting the bibliography style & \mintinline{latex}{\bibliographystyle{