Compare commits

...

4 Commits

7 changed files with 38 additions and 30 deletions

View File

@ -1,6 +1,6 @@
# LaTeX Script by Fachschaft WIAI
This script introduces the most fundamental LaTeX mechanisms to get learners started. It is used both as a reference and as exercise material for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **two-day tutorial aimed at students from various backgrounds**. At the moment, it is only available in German. The following topics are covered:
This script introduces the most fundamental LaTeX mechanisms to get learners started. It is used both as a reference and as exercise material for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **two-day tutorial aimed at students from various backgrounds**. The following topics are covered:
* general introduction to the LaTeX system
* basic document structure
@ -56,11 +56,11 @@ latex-skript/
└── README.md
```
* **`main.tex`** is the entrypoint. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
* **`main.tex`** is the entry point. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
* **`content`** comprises the individual chapters of this script.
* Most chapters include a task that can be found in the **`exercises`** folder.
* **`public`** is the folder where all packed-up versions of the script are moved to, once they have been created using the `Makefile` and the command `make publication`. There are two zip archives of this repository (one containing only the exercises and one with solutions included) as well as three PDF versions (one with the content only, one with exercises, and one with exercises and solutions).
* `compile_listings` and `compile_commands` are two **utility bash scripts**. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their subfolders. Rendered listings remain in `listings` whereas tasks are moved to the **`graphics`** folder afterwards. The compiled tasks are necessary for students who receive the project archive, but should not be given the sourcecode of tasks, e.g., if an exercise demands them to code up a table based on a pre-coded example.
* `compile_listings` and `compile_commands` are two **utility bash scripts**. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their sub folders. Rendered listings remain in `listings` whereas tasks are moved to the **`graphics`** folder afterwards. The compiled tasks are necessary for students who receive the project archive, but should not be given the sourcecode of tasks, e.g., if an exercise demands them to code up a table based on a pre-coded example.
## Usage
@ -93,4 +93,4 @@ These are the main contributors so far:
## License
The LaTeX Script was created by Fachschaft WIAI, the Student Council of the faculty of Information Systems and Applied Computer Sciences at University of Bamberg. It is licensed under the creative commons licence “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Usage permissions beyond the scope of this license might be granted upon request.
The LaTeX Script has been assembled by the Student Council of the Faculty of Information Systems and Applied Computer Sciences (Fachschaft WIAI) at University of Bamberg. It is licensed under Creative Commons “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Upon request, allowances exceeding the limitations of this license may be granted.

View File

@ -1,4 +1,4 @@
\chapter{Basic Document Structure}
\chapter{Basic document structure}
\label{sec:basic-document-structure}
In essence, every \LaTeX{} document is composed of two parts: the first part is
@ -17,7 +17,7 @@ of our document, that is, the things that we will later see in our generated
Let's take a closer look at the preamble.
A minimal preamble should contain the following specifications:
\subsection{Document Class}\label{sec:document-class}
\subsection{Document class}\label{sec:document-class}
We can define a document class by using the command
\mintinline[breaklines,breakafter=\]]{latex}|\documentclass[<parameter>]{<document class>}|. The most
commonly used document classes that are supported by default are
@ -55,7 +55,7 @@ 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}
\subsection{Digression: packages}
\label{sec:packages}
\begin{minted}{latex}
\usepackage[<optionen>]{<paketname>}
@ -127,7 +127,7 @@ can be included by using the following command:
\foreignlanguage{<language>}{<text>}
\end{minted}
\section{Document Environment}
\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}}.
@ -158,7 +158,7 @@ In order to escape the backslash, the command
\mintinline{latex}{\textbackslash} must be used.\footnote{An overview of
additional special characters can be found in \cref{sec:special-characters}.}
\subsection{Sections and Chapters}
\subsection{Sections and chapters}
Continuous text can be structured by headings that divide the document into
sections and chapters. Needless to say, \LaTeX{} provides us with commands for
that.
@ -183,7 +183,7 @@ parameter in square brackets between the command and the actual title:
\section[Title in the TOC]{Actual Chapter Title}
\end{minted}
\subsection{Front Matter}
\subsection{Front matter}
A simple front matter can be created by using the command
\mintinline{latex}{\maketitle}. The values that get inserted into the front
matter must be specified within the preamble.

View File

@ -1,6 +1,8 @@
\chapter{How does \LaTeX function?}
\chapter{How does \LaTeX{} function?}
\label{sec:basic-functionality}
\todo{Really ``function'', not ``work''?}
Word processing and document creation programs use different approaches to create a document based on an edited file.
When working with Microsoft Word, the rule is: a document exported as \acro{PDF} looks exactly like the source document in Word. Where a graphic is placed in Word, it is also found in the \acro{PDF}. Adjustments to the appearance in MS Word and other popular programs thus result in a direct visual change in the resulting export. This type of formatting is called \emph{What you see is what you get} (\acro{WYSIWYG} for short). Content and structure are closely linked.
@ -24,7 +26,7 @@ For instance, if we want to change the way highlighting is done, we can configur
%Oxford komma wie?
If we want to generate a PDF document with LaTeX, we need at least two programs. One to create the source code, and a second to process the source code. The latter is the already mentioned compiler.
In principle, a simple text editing program is sufficient for creating the source code. Most operating systems already include such programs. Maybe you are already used to applications like Notepad++\footnote{Available at \url{https://notepad-plus-plus.org/}.}, these are usable as well. Then there are advanced programs like TeXstudio\footnote{Available at \url{https://www.texstudio.org/}.} or Texmaker\footnote{Available at \url{https://www.xm1math.net/texmaker/}.}, which integrate additional functions that facilitate the use of commands. You are free to choose.
In principle, a simple text editing program is sufficient for creating the source code. Most operating systems already include such programs. Maybe you are already used to applications like Notepad++\footnote{Available at \url{https://notepad-plus-plus.org/}.}, these are usable as well. Then there are advanced programs like \TeX{}studio\footnote{Available at \url{https://www.texstudio.org/}.} or Texmaker\footnote{Available at \url{https://www.xm1math.net/texmaker/}.}, which integrate additional functions that facilitate the use of commands. You are free to choose.
%Zum Kompilieren des Quelltexts wird, wie bereits erwähnt, ein Compiler benötigt. Der Compiler ist meist Teil einer Sammlung von Programmen und Paketen, die zusammen eine \LaTeX-Distribution bilden. Auf die Hilfsprogramme werden wir für den Moment nicht näher eingehen.\footnote{Eines dieser Hilfsprogramme kommt später im Kapitel \ref{sec:literature} zum Einsatz, wenn wir Literatur referenzieren.} Die enthaltenen Pakete stellen verschiedene Befehle zur Verfügung.

View File

@ -5,41 +5,46 @@
\chapter*{First steps with \LaTeX}
\addcontentsline{toc}{section}{First steps with \LaTeX}
This script serves as a short reference on handling \LaTeX{} and as exercise material für the \LaTeX{} workshop of the Fachschaft \acro{WIAI}.
This script serves as a short reference on handling \LaTeX{} and as exercise material for the \LaTeX{} workshop of the Fachschaft \acro{WIAI}.
Many tasks require you to modify the script on your own.
The project material with all of the source files and the lastest version of this script can be found on Github.\footnote{\url{https://github.com/fs-wiai/latex-script/releases}}
The project material with all of the source files and the latest version of this script can be found on Github.\footnote{\url{https://github.com/fs-wiai/latex-script/releases}}
Before we can dive into \LaTeX{}, we will obviously have to install it.
We will also need to do some configuration to be able to work with this project.
All of this will be explained in more detail in the following chapters.
Bit by bit, you will get an understanding of how to work with \LaTeX{}.
For now, just follow our instructions.
Please, make sure to install the \emph{compiler first} and the the \emph{editor afterwards}\textit{.}
Please, make sure to install the \emph{compiler first} and the \emph{editor afterwards}\textit{.}
\section*{Compiler}
Lets 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}} MacTex for MacOS\footnote{\url{http://tug.org/mactex/}} and TeXLive 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}.} In case you get to choose, it is best to install the full version with all packages.
\todo{Ist das Semikolon hier richtig? (F)}
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}.}
In case you get to choose, it is best to install the full version with all packages.
\section*{Editor}
As soon as you have installed the compiler, you can download an editor that you are going to use to write your \LaTeX{} documents.
Any editor will do (notepad++, Atom, VS Code, etc.).
However, for beginners, we do recommend to use a program that supports you with \LaTeX-specific features.
One of them is TeXstudio.\footnote{You find the latestt version on \url{https://www.texstudio.org/}.}
However, for beginners, we do recommend using a program that supports you with \LaTeX-specific features.
One of these programs is \TeX{}studio.\footnote{You find the latest version on \url{https://www.texstudio.org/}.}
\section*{Changing the compiler command}
\todo{Refactor after the code inclusion part is redone.}
To prevent errors during the compilation of our document, you have to change the compiler command.
In TeXstudio, click on the \emph{options} button and then on \emph{Configure TeXstudio \textellipsis}\todo{Need to find out what they are actually called in English. Maybe also add the correct steps for Mac (these dont apply)}.
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 dont apply)}.
A new window will open up.
Navigate to the \emph{commands} area and, at \emph{PdfLaTeX}, add the flag \mintinline{bash}{-shell-escape}.
Navigate to the \emph{Commands} area and, next to \emph{PdfLaTeX}, add the flag \mintinline{bash}{-shell-escape}.
In other words: The command for \emph{PdfLaTeX} should look like this:
\mint{bash}{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.
Looking at the directory, you should see a few new files.
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 other files are auxiliary files that the compiler uses, for example, to generate the table of contents.
You are now ready to go!

View File

@ -113,7 +113,7 @@ We already have presented a selection of packages. However, there are thousands
\noindent \texttt{beamer}, which is not a package, but another document class, can be used to create \textbf{slide shows}
with \LaTeX{}. Information on the document class and examples are available at Overleaf\footnote{\url{https://www.overleaf.com/learn/latex/Beamer}}, which brings us to the next section:
\section{Help and Information}
\section{Help and information}
\textbf{Wikibooks} provides you with a much more detailed introduction into \LaTeX{}. Note that the German version\footnote{\url{https://de.wikibooks.org/wiki/LaTeX-Kompendium}} is less complete than the English one.\footnote{\url{https://en.wikibooks.org/wiki/LaTeX}}
If required, both refer to additional packages.

View File

@ -23,7 +23,7 @@
\begin{tabular}{@{}lp{9cm}}
& \subsubsection*{Imprint} \\
& The \LaTeX{} Script (version 1.1 from October Xth, 2021) has been assembled by the Student Council of the Information Systems and Applied Computer Sciences Faculty (Fachschaft \acro{WIAI}) at the University of Bamberg. \\
& It is licensed unter Creative Commons \enquote{Attribution-ShareAlike 4.0 International} (CC BY-SA 4.0): \\
& It is licensed under Creative Commons \enquote{Attribution-ShareAlike 4.0 International} (CC BY-SA 4.0): \\
\href{http://creativecommons.org/licenses/by-sa/4.0/}{\includegraphics[height=.5cm]{graphics/cc-by-sa}} & \url{http://creativecommons.org/licenses/by-sa/4.0/} \\ \\
& Upon request, allowances exceeding the limitations of this license may be granted.
\end{tabular}

View File

@ -1,22 +1,22 @@
\chapter{What is \LaTeX?}
\label{sec:what-is-latex}
In the early 1960s, a rather talented American PhD student was asked by a big publishing company whether he wanted to write a book on compilers.
In the early 1960s, a rather talented American Ph.D. student was asked by a big publishing company whether he wanted to write a book on compilers.
He did.
Soon after he had begun with his research, he realised that he wanted to start with some foundations of computer science, so he asked the publishers if the book might be a little longer.
Soon after he had begun with his research, he realized that he wanted to start with some foundations of computer science, so he asked the publishers if the book might be a little longer.
They replied, \enquote{make it as long as you feel necessary.}
In 1968, the first volume was published, at that time still printed using mechanical typesetting.
This method was just disappearing then, and being replaced by new methods.
However, the author did not like the results of those new methods, so,
at the end of the 70s, he began to develop his own typesetting system \TeX
at the end of the 70s, he began to develop his own typesetting system \TeX{}
(pronounced as \emph{tech}\todo{is that a valid transliteration in english?}), named after the ancient Greek word \texttau$\mathrm{\acute{\varepsilon}}$\textchi\textnu\texteta{} (technē) meaning \emph{art, craft}.
Today, Donald Knuth (that is the former students name) is a retired professor of computer science and his compiler book has grown to become the multi-volume standard work \emph{The Art of Computer Programming}\,\,three volumes of which are still to be written, among them the one on compilers.
Unlike the book, however, \TeX{} is the rare occurrence of a software system that may actually be called \emph{complete} without meaning \emph{dead}.
Two more letters are needed for \LaTeX:
They are the initial two letters of the last name of Leslie Lamport, who, in the 80s, extended \TeX{} by a collection of small programs that made the entire system usable for us end users and are responsible for its widespread adoption.
They are the initial two letters of the last name of Leslie Lamport, who, in the 80s, extended \TeX{} by a collection of small programs that made the entire system usable for us end-users and are responsible for its widespread adoption.
The current version dates from the mid~90s.
Why are we telling you all of that?
@ -24,10 +24,11 @@ It explains some of the advantages that still distinguish \LaTeX{} today:
It is a mature, stable, and reliable system
that does typesetting in a typographically sophisticated way and mostly automatically.
As the \TeX{} code is stored in plaintext files (c.\,f. \cref{sec:basic-functionality}),
As the \TeX{} code is stored in plaintext files (cf. \cref{sec:basic-functionality}),
even more advantages arise:
You can structure your projects clearly (\cref{sec:project-structure}),
You can structure your projects clearly (cf. \cref{sec:project-structure}),
and whenever you undo changes in the source code, you can always rely on getting exactly the same output as before.
\todo{Klingt für mich, als würden Undos nichts bewirken. (F)}
On a larger scale, this does also work in connection with Git or other source code versioning tools.
Furthermore, you can trust your source code to be readable long-term, without any specific software.
It can always be opened with any program that supports plaintext.