drop slides 5 to 8

This commit is contained in:
Fradtschuk 2022-10-03 22:08:19 +02:00
parent a7401228c8
commit 5ead271cdc

View File

@ -65,75 +65,3 @@ Compile the script for the first time
<div class="box warning"> <div class="box warning">
Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files. Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files.
</div> </div>
@slide(layout=content-and-preview)
@title
Listings
@content
We have multiple examples of LaTeX source code in the script. As a default setting, we use the package **listings** for displaying them.
* However, the package **minted** generates more appealing listings.
* Minted requires additional configuration, like the installation of the programming language **Python&nbsp;3** and the package **Pygments**
* The following slides explain how to use `minted` for this LaTeX project
@preview
![](svg/chapter-10/minted-overview-english-crop.svg){ .thin-padding}
@slide(layout=content-only)
@title
Installation of Python 3
@content
* Check if Python is already installed on your operating system using a command prompt:
``` {.lang-sh .hljs}
python --version
```
* If installed, the output should look similar to this (the exact version may deviate):
``` {.lang-sh .hljs}
Python 3.10.6
```
* If not installed, follow the instructions for your operating sytem on the **[website](https://www.python.org/)**.
* Make sure to enable the option to add Python to your PATH, if possible.
* Run the above-mentioned command to ensure the installation was successful.
@slide(layout=content-only)
@title
`Pygments` and compiler command settings
@content
* Install the **Pygments** by executing the following command in a command prompt:
<code>pip install Pygments</code>
* In TeXstudio, navigate to Options → Configure TeXstudio → Commands
* Next to the PdfLaTeX label, add the ``shell-escape`` flag to the compiler command:
<code>pdflatex -synctex=1 -interaction=nonstopmode **\-\-shell-escape** %.tex</code>
<div class="box warning">
Passing the flag ``--shell-escape`` to your compiler can be a potential security risk. **Only do it for documents you trust!**
</div>
@slide(layout=content-and-preview)
@title
Change the listings mode
@content
In order to compile the script using `minted`, the listings mode has to be changed.
* Create a new file in the root directory of the project archive, named `listings-mode.tex`
* Insert the following command into the newly created file
``` {.lang-tex .tex .hljs}
\newcommand\listingsmode{minted}
```
* Compile `main.tex` again by pressing <span class="emoji"></span>
@preview
<figure>
![](images/code-listing-default.png)
![](images/code-listing-minted.png)
</figure>
<figcaption>``listings`` (top) vs. ``minted`` (bottom)</figcaption>