Compare commits

...

24 Commits

Author SHA1 Message Date
e0e694f900 Fix listings task 2023-04-28 17:26:58 +02:00
8f9ef296fd Adjust reference exercise 2023-04-28 16:57:04 +02:00
8ea59e8656 Fix date 2023-04-28 16:14:02 +02:00
4a9f04a652 Increase release number 2023-04-28 13:27:30 +02:00
4abe1f3ccb Remove ToDo 2023-04-28 13:21:10 +02:00
fe7d63f9f3 Add solution cover 2023-04-28 13:07:06 +02:00
1cc6d96ed3 Minor refactoring 2023-04-28 12:42:36 +02:00
bb2db7a0dc Update first chapters section 2023-04-28 12:28:33 +02:00
a029095b65 Reorder sections 2023-04-26 10:02:21 +02:00
b52d346a39 Fix Makefile: both project zips should work again 2023-04-23 14:54:42 +02:00
381d1845d0 add caption information 2023-04-21 11:22:05 +02:00
63e7f42658 Remove references to Citavi 2023-04-09 17:48:42 +02:00
4187e79408 Fix author names in author tag 2023-03-01 13:29:29 +01:00
5c9b705960 Add contributors 2023-03-01 13:25:35 +01:00
a78fe6e336 Replace occurrences of main.tex 2023-01-28 16:46:15 +01:00
f206d75505 Add new cover pages 2023-01-28 15:53:38 +01:00
d9238159dd Update README 2023-01-28 15:53:22 +01:00
9a99c0aee9 Start fixing the Makefile 2023-01-13 18:21:53 +01:00
5731eb3c45 Add exercise versions 2023-01-13 17:18:30 +01:00
3c699d5dd0 Remove exercise command 2023-01-13 16:35:09 +01:00
e4e731f044 Split script 2023-01-13 16:03:41 +01:00
6dfd17dc46 Add details on the literate option for listings 2023-01-03 11:08:25 +01:00
a074052ab7 Fix literate ß in listings 2023-01-03 10:58:00 +01:00
f3e18adcb4 Replace \mathrm by \text 2023-01-03 10:55:24 +01:00
45 changed files with 351 additions and 212 deletions

2
.gitignore vendored
View File

@ -79,7 +79,7 @@ _minted*
*.swp
*.swo
main.pdf
main-*.pdf
listings-mode.tex
exercise-mode.tex
public

View File

@ -10,7 +10,7 @@ clean:
@echo Cleaning up temporary files.
@rm -rf public/*
@rm -rf temp/*
@rm -f {main,script-only}.{aux,loc,log,out,pdf,soc,toc}
@rm -f main-{script,exercises,solutions}.{aux,loc,log,out,pdf,soc,toc}
# Compile listings (only needed when listings have changed)
listings: listings/**/*
@ -21,10 +21,9 @@ tasks: exercises/**/*
./compile_tasks
# Compile a preview PDF containing all contents
preview: main.tex
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
preview: main-script.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape main.tex
pdflatex -shell-escape main-script.tex
@echo
@echo
@echo Run \'make publication\' to generate PDF and ZIP file for publication.
@ -42,51 +41,60 @@ publication-dir:
mkdir -p temp/
# Compile a printable PDF without exercises
publication-pdf-without-exercises: clean publication-dir main.tex
echo "\newcommand\exercisemode{none}" > exercise-mode.tex
publication-pdf-without-exercises: clean publication-dir main-script.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex
mv script-only.pdf public/
pdflatex -shell-escape main-script.tex
pdflatex -shell-escape main-script.tex
pdflatex -shell-escape main-script.tex
mv main-script.pdf public/
# Compile a printable PDF with exercises and without solutions
publication-pdf-with-exercises: clean publication-dir main.tex
echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex
publication-pdf-with-exercises: clean publication-dir main-exercises.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
mv script-with-exercises.pdf public/
pdflatex -shell-escape main-exercises.tex
pdflatex -shell-escape main-exercises.tex
pdflatex -shell-escape main-exercises.tex
mv main-exercises.pdf public/
# Compile a printable PDF with exercises and solutions
publication-pdf-with-solutions: clean publication-dir main.tex
echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex
# Compile a printable PDF with solutions
publication-pdf-with-solutions: clean publication-dir main-solutions.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
mv script-with-solutions.pdf public/
pdflatex -shell-escape main-solutions.tex
pdflatex -shell-escape main-solutions.tex
pdflatex -shell-escape main-solutions.tex
mv main-solutions.pdf public/
# Build a ZIP file without tasks
publication-zip-without-exercises: clean publication-dir
rm -rf temp/*
cp --parents main-script.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex temp/
cd temp && zip ../public/project-without-exercises * **/* **/**/*
# Build a ZIP file with tasks and without solutions
publication-zip-with-exercises: clean publication-dir main.tex
rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
publication-zip-with-exercises: clean publication-dir
rm -rf temp/* exercises/**/_*
cp --parents main-exercises.tex praeamble.tex commands.tex setup.tex graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage-exercises.tex imprint.tex first-steps-with-latex.tex temp/
cp --parents exercises/**/* temp/
rm -f temp/exercises/**/*.done.{tex,bib}
rm -f temp/exercises/**/*.done.{tex,bib,synctex.gz}
rm -f temp/exercises/**/*.rend.tex
rm -f temp/exercises/**/*.aux
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
sed -i 's/\.raw//g' temp/main-exercises.tex
cd temp && zip ../public/project-with-exercises * **/* **/**/*
# Build a ZIP file with tasks and solutions
publication-zip-with-solutions: clean publication-dir main.tex
rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
publication-zip-with-solutions: clean publication-dir
rm -rf temp/* exercises/**/_*
cp --parents main-solutions.tex praeamble.tex commands.tex setup.tex graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage-exercises.tex imprint.tex first-steps-with-latex.tex temp/
cp --parents exercises/**/* temp/
rm -f temp/exercises/**/*.raw.{tex,bib}
rm -f temp/exercises/**/*.raw.{tex,bib,synctex.gz}
rm -f temp/exercises/**/*.aux
find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \;
find temp/ -name '*.tex' -exec sed -i -e 's/(raw|done)//g' {} \;
sed -i 's/\.done//g' temp/main-solutions.tex
sed -i 's/\.done//g' temp/exercises/*/*.tex
cd temp && zip ../public/project-with-solutions * **/* **/**/*

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**. The following topics are covered:
The material contained in this repository introduces the most fundamental LaTeX mechanisms to get learners started. It comprises both a script and hands-on exercises for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **LaTeX introduction aimed at students from various backgrounds**. The following topics are covered:
* general introduction to the LaTeX system
* basic document structure
@ -10,37 +10,44 @@ This script introduces the most fundamental LaTeX mechanisms to get learners sta
* formatting paragraphs
* lists
* maths and formulas
* source code listings (`minted` + `listings`)
* graphics
* tables
* footnotes
* references
* literature management
* source code listings (`listings` with an optional `minted` part)
Most chapters contain exercises to be performed within the script itself, practically teaching the aspects that are introduced by the text.
Most chapters contain exercises to practically apply the aspects that are introduced by the text.
## Getting started
### For beginners
A PDF version of the script can be found [in the “releases” section](https://github.com/fs-wiai/latex-script/releases). It will give you an overview of how to approach any, but especially this LaTeX project. For this, have a look at the “First steps with LaTeX” section.
This project contains three different documents:
1. a **script** containing all of the chapters we cover in the workshop (`main-script`),
2. an **exercise script** with practical tasks to apply what you have learned (`main-exercises`), and
3. a **solution script** that you can refer to for your self-study (`main-solutions`).
A PDF version of all of these documents can be found [in the “releases” section](https://github.com/fs-wiai/latex-script/releases). You may use the script to delve into the realms of LaTeX on your own. It will give you an overview of how to approach any, but especially this LaTeX project. To get your hands dirty, have a look at the exercise script, especially the “First steps with LaTeX” section.
**Optionally**, the `minted` package can be used for source code listings. This requires some additional configuration (including the installation of [Python3](https://www.python.org/)). Please refer to the chapter on “Source code listings” in the aforementioned PDF file.
### Command line usage
The project can be compiled by running a LaTeX compiler on `main.tex`. A simple command would be:
Each document in this project can be compiled by running a LaTeX compiler on `main-script.tex` (or any of the other two main files, respectively). A simple command would be:
```sh
$ pdflatex main.tex
$ pdflatex main-script.tex
```
Run the command twice to generate the table of contents and other registers. Once the literature tasks are being worked on, compilation requires an additional call to BibTeX:
```sh
$ pdflatex main.tex
$ bibtex main.aux
$ pdflatex main.tex
$ pdflatex main.tex
$ pdflatex main-script.tex
$ bibtex main-script.aux
$ pdflatex main-script.tex
$ pdflatex main-script.tex
```
If you decide to use the optional `minted` package (see section above), don't forget to add the `--shell-escape` flag:
@ -49,6 +56,8 @@ If you decide to use the optional `minted` package (see section above), don't fo
$ pdflatex --shell-escape main.tex
```
Read more about the potentially dangerous implications of this flag in the script.
## Project Structure
```
@ -64,28 +73,46 @@ latex-script/
│   ├── basic-document-structure
│   ├── footnotes
│   └── …
├── first-steps-with-latex.tex
├── graphics
│   ├── benzene-ring.pdf
│   ├── cc-by-sa.png
│   └── …
├── imprint.tex
├── LICENSE
├── listings
│   ├── basic-document-structure
│   ├── formatting-paragraphs
│   └── …
├── main.tex
├── main-exercises.tex
├── main-script.tex
├── main-solutions.tex
├── Makefile
├── praeamble.tex
├── public
├── setup.tex
└── README.md
├── README.md
├── titlepage-exercises.tex
├── titlepage-solutions.tex
└── titlepage.tex
```
## Relevant files for learners
* **`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.
Please don't feel overwhelmed by the amount of files in this repository. You will get to know the most important parts of the project step by step by [following the script](https://github.com/fs-wiai/latex-script/releases) or our workshop. What's more, by using this larger projects you get accustomed to the complexity of real LaTeX projects bachelor's/master's theses and the like.
In this repository, we provide an exercise script in which you can practically apply what you have learned. These files will be needed:
* **`main-exercises.tex`** is the entry point for the exercise part. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
* **`exercises`** contains one sub-folder for each chapter. Within these folders, there are the LaTeX files you will have to modify to complete an exercise.
## Additional material
Besides the exercise part, we also provide the script detailing all of the information we give you during our workshop. This script can be used as a reference, a refresher, and a source of inspiration. Moreover, it is a practical example of how LaTeX can be brought to good use. This is why we offer you the full source code, structured like this:
* The **`content`** folder comprises the individual chapters of the script.
* They are bound together by **`main-script.tex`**, which also includes our preamble (`preamble.tex`) and our custom commands (`commands.tex`).
* Further folders (e.g., `listings` and `graphics`) contain additional resources like images and source code listings used in the script.
Please don't feel overwhelmed by the amount of files in this repository. You will get to know the most important parts of the project step by step by [following the script](https://github.com/fs-wiai/latex-script/releases) or our workshop. What's more, by using this larger project you get accustomed to the complexity of real LaTeX projects bachelor's/master's theses and the like.
## Further information for maintainers
@ -108,9 +135,12 @@ You are welcome to contribute to this project by creating issues, opening pull r
These are the main contributors so far:
* Evelyn Fradtschuk
* Jessica Klarmann
* Florian Knoch
* Theresa Knoll
* Christian Kremitzl
* Bernhard Luedtke
* Jochen Mehlich
## License

View File

@ -146,7 +146,7 @@
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ß}{{\ss}}1
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
@ -163,7 +163,7 @@
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ß}{{\ss}}1
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
@ -241,69 +241,3 @@
\end{figure}
}
% Exercise mode
% =============
% The exercise mode can be chosen by writing one of the following to the exercise-mode.tex file before compilation:
% \newcommand\exercisemode{none} % for a blank script without exercises
% \newcommand\exercisemode{exercises} % for a script with exercises only
% \newcommand\exercisemode{solutions} % for a script with solutions only
% \newcommand\exercisemode{any} % for a script containing all available material
% The following lines include that file or make \exercisemode default to 'any' so that any derivatives of this project will work even without the file.
\IfFileExists{exercise-mode.tex}{
\input{exercise-mode.tex}
}{
\newcommand\exercisemode{any}
}
% Exercises
% =========
% Includes the task.tex file within the given subfolder of exercises and adds a heading.
\newcommand\exercise[1]{
\ifthenelse{\equal{\exercisemode}{none}}{
% Exercises disabled.
}{
\newpage
\definecolor{latexblue}{rgb}{0.9,0.925,0.95}
\pagecolor{latexblue}
%\definecolor{latexblue}{rgb}{0.73,0.84,0.92}
\section*{Exercise \thechapter}
\addcontentsline{toc}{section}{Exercise}%
\input{exercises/#1/task.tex}
\newpage
\nopagecolor
}
}
% Exercise Material
% =================
% Takes a project-relative path, and inserts matching exercise material and/or solutions, depending on the exercise mode.
\newcommand\exercisematerial[1]{
% Mode 'exercises': raw material only
\ifthenelse{\equal{\exercisemode}{exercises}}{
\IfFileExists{#1.raw.tex}{
\input{#1.raw.tex}
}{}
}{}
% Mode 'solutions': completed material only
\ifthenelse{\equal{\exercisemode}{solutions}}{
\IfFileExists{#1.done.tex}{
\input{#1.done.tex}
}{}
}{}
% Mode 'any': all existing material. If both raw and completed material exist, headings are added for each.
\ifthenelse{\equal{\exercisemode}{any}}{
\IfFileExists{#1.raw.tex}{
\IfFileExists{#1.done.tex}{
\subsubsection*{Preview of the raw material}
}{}
\input{#1.raw.tex}
}{}
\IfFileExists{#1.done.tex}{
\IfFileExists{#1.raw.tex}{
\subsubsection*{Preview of the solution}
}{}
\input{#1.done.tex}
}{}
}{}
}

View File

@ -1,4 +1,4 @@
\chapter{References and Footnotes}
\chapter{References and footnotes}
\section{Footnotes}\label{sec:footnotes}

View File

@ -14,6 +14,8 @@ In order to be able to reference graphics, the package \texttt{graphicx} has to
\codeblock{latex}{listings/graphics/image-size.tex}
With the \mono{caption} command you can also add a caption to the image. Note that you can provide an alternative caption in square brackets, if you want.
\section{Positioning}
\label{sec:graphics-placement}
One interesting aspect of the what-you-get-is-what-you-mean paradigm is the way how graphics can be positioned.

View File

@ -27,8 +27,8 @@ This is the identifier that we will use to reference the entry in our \LaTeX{} d
Bib\TeX{} keys can be chosen freely, but have to be unique.
Typically, they will consist of a combination of authors, publication dates, and topics.\newpage
\textbf{Bibliography files} can be compiled manually, yet it is more common to use programs like JabRef,\footnote{Cf. \url{https://www.jabref.org/}.} Zotero\footnote{Cf. \url{https://www.zotero.org/}.} or the widely-used software Citavi\footnote{Vgl. \url{https://www.citavi.com/de}.}.
While JabRef operates directly on your bibliography file, Zotero and Citavi projects\footnote{Vgl. \url{https://www1.citavi.com/sub/manual5/de/exporting_to_bibtex.html}.} can be exported to bibliography files to use them in \LaTeX{} documents.
\textbf{Bibliography files} can be compiled manually, yet it is more common to use programs like JabRef\footnote{Cf. \url{https://www.jabref.org/}.} or Zotero\footnote{Cf. \url{https://www.zotero.org/}.}.
While JabRef operates directly on your bibliography file, Zotero projects\footnote{Vgl. \url{https://guides.library.iit.edu/c.php?g=720120&p=6296986}.} can be exported to bibliography files to use them in \LaTeX{} documents.
\textbf{Bibliography entries} are provided by many academic search engines, including Google Scholar (cf. \cref{fig:google-scholar-bibtex}).
When using them, make sure that the entries are cohesive across your reference collection and complete with regard to their attributes.

View File

@ -78,6 +78,6 @@ Line breaks are denoted by two backslashes.
Sometimes sets have to be defined in terms of textual descriptions or longer function names.
The \LaTeX{} math mode assumes that letters are variables rather than text, which creates problems when they are indeed supposed to be entire words.
For this case, there is the \code{latex}{\textbackslash mathrm\{\}} command (\enquote{math roman}, c.\,f. \cref{lst:set-builder-notation}).
For this case, there is the \code{latex}{\textbackslash text\{\}} command (c.\,f. \cref{lst:set-builder-notation}).
\example{lst:set-builder-notation}{maths/set-builder-notation}{Problems arising from intensional set notation and their solution}

View File

@ -28,5 +28,5 @@ Its renderings are of rather peculiar appearance.
With some amount of configuration, we can overcome the most disturbing default settings.
Although \pkg{listings} is not shipped with any pre-defined themes, you can define your own and use them throughout your project with the \mono{lstdefinestyle} command.\footnote{Have a look at it in the package documentation. For the very impatient, here is a solarized theme for \pkg{listings}: \url{https://github.com/jez/latex-solarized}}
The package is also a bit older than its alternative, causing \acro{UTF8} special characters to break.
If this happens to you, have a look at the \mono{literate} option of the \pkg{listings} commands.
The package is also a bit older than its alternative, causing \acro{UTF-8} special characters to break.
If this happens to you, have a look at the \mono{literate} option of the \pkg{listings}\footnote{The \LaTeX{} WikiBook offers a good starter for the \mono{literate} option covering the most frequent special characters: \url{https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings\#Encoding_issue}} commands.

View File

@ -26,7 +26,7 @@ Once the installation is complete, you are ready to include the \LaTeX{} package
There is one last adjustment needed before you can actually compile your documents---we will have to adjust the compile command.
Out of the box, your editor will probably execute the following command after you clicked the green compile arrow:
\shell{pdflatex main.tex}
\shell{pdflatex main-exercises.tex}
\noindent The exact command can be found and configured in \TeX{}studio under Options\,\,Configure \TeX{}studio\,\,Commands.
It is stated next to the Pdf\LaTeX{} label.

View File

@ -1,3 +1,5 @@
\section{Structure your document and text}
\begin{enumerate}
\item In the directory \file{exercises/basic-document-structure}, you can find a file named \file{document-structure.tex}. Wrap the text of the file in a \code{latex}{document} environment and add the following preamble. Afterwards, compile the document.
\codeblock{latex}{./exercises/basic-document-structure/preamble.code.tex}
@ -13,5 +15,3 @@
a table of contents for your document.
\item Afterwards, comment out the preamble, the document environment, and the table of contents.
\end{enumerate}
\exercisematerial{exercises/basic-document-structure/document-structure}

View File

@ -1,6 +1,6 @@
Java is an object-oriented programming language, that appeared in
Java is an object-oriented programming language that appeared in
1995. The most recent version of the programming language is
version 16\footnote{March 2021}. In order to write Java programs,
version 20\footnote{March 2023}. In order to write Java programs,
one needs to install the so-called \emph{Java Development Kit
(JDK)}.\footnote{\url{https://www.oracle.com/java/technologies/javase-downloads.html}}
Java programs can be written independently from the operating

View File

@ -1 +1 @@
Java is an object-oriented programming language, that appeared in 1995. The most recent version of the programming language is version 16 (March 2021). In order to write Java programs, one needs to install the so-called \emph{Java Development Kit (JDK)}. Java programs can be written independently from the operating system that one uses.
Java is an object-oriented programming language that appeared in 1995. The most recent version of the programming language is version 20 (March 2023). In order to write Java programs, one needs to install the so-called \emph{Java Development Kit (JDK)}. Java programs can be written independently from the operating system that one uses.

View File

@ -1,20 +1,8 @@
\section*{Exercise \thechapter .1}
Make the text \enquote{March 2021} of the file
\section{Footnotes and references}
\subsection{Inserting footnotes}
Make the text \enquote{March 2023} of the file
\file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in
parentheses. Additionally, insert a clickable URL to the Java Development Kit
as footnote.
\texttt{https://www.oracle.com/java/technologies/javase-downloads.html}
\exercisematerial{exercises/footnotes/footnotes}
\section*{Exercise \thechapter .2}
In file \file{exercises/references/references.tex}, replace \enquote{in the
figure} and \enquote{the following source code listing} with suited references.
Use the command \code{latex}{\textbackslash cref}. Do not forget to first
introduce labels for the elements that you want to reference. To do so, first
of all, wrap the source code listing in a \code{latex}{listing} environment.
Also, insert a caption for the source code listing.
Make sure to use suitable prefixes before the labels.
\exercisematerial{exercises/references/references}
as footnote: \\ \texttt{https://www.oracle.com/java/technologies/javase-downloads.html}

View File

@ -1,9 +1,8 @@
\section{Inserting graphics}
In the \file{exercises/graphics} directory you can find an image file
\file{latex-logo.png}. Insert the image into the
\file{exercises/graphics/graphics.tex} file. Make sure that the image is placed
exactly where you have specified it. On top of that, the picture shall be
centered, and a caption shall be added. Adapt the image width to the text width
(\code{latex}{\textbackslash textwidth}).
\exercisematerial{exercises/graphics/graphics}
(\code{latex}{\textbackslash textwidth}). On top of that, add a caption to the image.

View File

@ -1,7 +1,7 @@
\section{Adding enumerations}
Format the recipe you can find in \file{exercises/lists/lists.tex} as an
unordered list (\code{latex}{itemize}) with sub-lists \emph{Ingredients}
and \emph{Instructions}.
Within these, there shall be an unordered list of ingredients and an ordered list of
instructions, respectively.
\exercisematerial{exercises/lists/lists}

View File

@ -1,3 +1,5 @@
\section{Creating and inserting references}
\begin{enumerate}
\item Create a new Bib\TeX{} file called \file{literature.bib} in the \file{exercises/literature} folder.
\item Use Google Scholar or \url{dblp.org} to retrieve Bib\TeX{} entries for the following \LaTeX{}
@ -15,5 +17,3 @@
\item \textbf{Note}: If compiling fails, it may help to remove all auxiliary
files \\(\mono{main.aux/bbl/blg/loc/out/pdf/soc/toc}) before compiling again.
\end{enumerate}
\exercisematerial{exercises/literature/literature}

View File

@ -16,7 +16,7 @@ $$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
$$n! = \prod_{i=1}^{n} i$$
% Set of all odd natural numbers
$$\{ x \mid x \in \mathds{N}, \mathrm{odd}(x) \}$$
$$\{ x \mid x \in \mathds{N}, \text{odd}(x) \}$$
% Elimination $\neg\exists x$
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$

View File

@ -1,2 +1,4 @@
% Replace this graphic by the corresponding formulas:
Replace this graphic by the corresponding formulas:
\vspace{1cm} % some additional spacing before the image
\includegraphics{graphics/math-formulas.rend-crop.pdf}

View File

@ -36,7 +36,7 @@ $$n! = \prod_{i=1}^{n} i$$ \\
~ \\
\textbf{Set of all odd natural numbers}
$$\{ x \mid x \in \mathds{N}, \mathrm{odd}(x) \}$$
$$\{ x \mid x \in \mathds{N}, \text{odd}(x) \}$$
~ \\
\textbf{Elimination $\neg\exists x$}

View File

@ -1,4 +1,4 @@
Use \LaTeX{} math mode to typeset the following formulas.
Pay attention to the size of brackets.
\section{Typesetting mathematics}
\exercisematerial{exercises/maths/math-formulas}
Use \LaTeX{}'s math mode to typeset the following formulas.
Pay attention to the size of brackets. Prioritize those formulas that appear to be most useful and/or interesting to you.

View File

@ -1,4 +1,4 @@
\section{A structured project}
Within the directory \file{exercises/project-structure} you can find the file
\file{main.tex}.
\exercisematerial{exercises/project-structure/tasks}

View File

@ -9,9 +9,5 @@ C\# is an object-oriented programming language that was developed by Microsoft i
\cref{lst:csharphelloworld} shows a program that prints the text \enquote{Hello LaTeX friends!} to the console. Like Java, C\# makes use of classes and main methods to build executable applications.
\begin{listing}[H]
\caption{A simple C\# program}
\label{lst:csharphelloworld}
\lstset{language=csharp}
\lstinputlisting{exercises/references/HelloLateXFriends.cs}
\end{listing}
\lstinputlisting[label=lst:csharphelloworld, caption=Hello World in C\#]{exercises/references/HelloLateXFriends.cs}

View File

@ -0,0 +1,11 @@
% same chapter as footnotes
\subsection{Inserting references}
In file \file{exercises/references/references.tex}, replace \enquote{in the
figure} and \enquote{the following source code listing} with suited references.
Use the command \code{latex}{\textbackslash cref}. Do not forget to first
introduce labels for the elements that you want to reference.
Make sure to use suitable prefixes before the labels.
For source code listings, adding labels and captions is a bit different.
Try to apply the knowledge you gained so far to retrieve the correct version of the \code{\lstinputlisting} command.

View File

@ -3,5 +3,6 @@
numbers=left, % line numbers
showstringspaces=false, % spaces in strings
keywordstyle=\color{blue}, % keyword color
basicstyle=\ttfamily\small % overall font and size
basicstyle=\ttfamily\small, % overall font and size
literate={ä}{{\"a}}1 {ß}{{\ss}}1 % special characters
]{exercises/source-code-listings/Source.java}

View File

@ -0,0 +1 @@
Your listings go here.

View File

@ -1,3 +1,5 @@
\section{Listings}
In the folder \file{exercises/source-code-listings}, you will find a file called \file{Source.java}.
We will now include it into our document and adjust its display to fit our needs.
If you have questions, consult the \pkg{minted} or \pkg{listings} package documentation.
@ -7,6 +9,7 @@ If you have questions, consult the \pkg{minted} or \pkg{listings} package docume
\begin{enumerate}
\item Include the file into \\
\file{exercises/source-code-listings/source-code-listings.tex}.
\item Enable special characters via the \code{latex}{literate} option.
\item Activate syntax highlighting by stating the programming language Java.
\item Add line breaks and line numbers.
\item Use the theme \code{latex}{native}.
@ -27,8 +30,6 @@ If you have questions, consult the \pkg{minted} or \pkg{listings} package docume
\item Don't show special characters for spaces in strings.
\end{enumerate}
\exercisematerial{exercises/source-code-listings/source-code-listings}
% Reset experiments from exercise material if minted is used
\ifthenelse{\equal{\listingsmode}{minted}}{%
\usemintedstyle{default}

View File

@ -1,7 +1,8 @@
% breakanywhere doesn't seem to work.
\section{Insert special characters}
For this task, we are using the file \file{exercises/special-characters.tex}.
To be able to see your results here within the script,
compile the \file{main.tex} file.
To be able to see your results here within the exercise script,
compile the \file{main-exercises.tex} file.
This applies for the subsequent tasks, as well.
\begin{enumerate}
@ -12,6 +13,3 @@ This applies for the subsequent tasks, as well.
\item Add quotation marks around the words \emph{Studi-Ticket} and
\emph{Studi-Karte} using the \code{latex}{\textbackslash enquote} command.
\end{enumerate}
\exercisematerial{exercises/special-characters/special-characters}

View File

@ -1,10 +1,8 @@
\section{Typesetting tables}
The following list shows some key data about a few courses of the \acro{WIAI} faculty.
However, the overview is not as clear as it could be.
To improve it, convert the list into a table with columns for \emph{name}, \emph{abbreviation} and \emph{term}.
Insert an additional \emph{centered column} that numbers the courses.
Add a caption to the table.
You find the table in \file{exercises/tables/tables.tex}.
\exercisematerial{exercises/tables/tables}

View File

@ -1,3 +1,5 @@
\section{Emphasising text}
\begin{enumerate}
\item In \file{exercies/text-markup/markup.tex}, emphasize the words
``recursion'' and ``recursive.''
@ -5,5 +7,3 @@
\item Of course, you can also experiment with the other commands that you learned for text markup. However, you might want to remove them afterwards to keep your document nice and tidy.
\end{enumerate}
\exercisematerial{exercises/text-markup/markup}

View File

@ -5,10 +5,8 @@
\chapter*{First steps with \LaTeX}
\addcontentsline{toc}{section}{First steps with \LaTeX}
This script serves as a short \LaTeX{} reference and as exercise material for the Fachschaft \acro{WIAI} \LaTeX{} workshop.
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}}
The following instructions will equip you with the programs necessary to create documents with \LaTeX{}---they will be explained in the following chapters.
This document\footnote{Find the latest version of this document on Github: \url{https://github.com/fs-wiai/latex-script/releases}} contains exercises to practically apply learnings from the Fachschaft \acro{WIAI}'s \LaTeX{} workshop.
The following instructions will equip you with the programs necessary to create documents with \LaTeX{}---they are explained in the workshop and the main script.
Please, make sure to install the \emph{compiler first} and the \emph{editor afterwards}\textit{.}
\section*{Compiler}
@ -26,9 +24,9 @@ Any editor will do (notepad++, Atom, VS Code, etc.).
However, for beginners, we recommend using \TeX{}studio,\footnote{You find the latest version on \url{https://www.texstudio.org/}.} a program that supports you with \LaTeX-specific features.
\section*{Compiling for the first time}
Open up the file \file{main.tex} in \TeX{}studio.
Open up the file \file{main-exercises.tex} in \TeX{}studio.
It can be found in our project directory.
By pressing \includegraphics[width=.8em]{graphics/faForward.png}, it is converted into a a file called \file{main.pdf}.
By pressing \includegraphics[width=.8em]{graphics/faForward.png}, it is converted into a a file called \file{main-exercises.pdf}.
You should be able to find the latter by looking at the project directory in your file explorer.
If your installation is not working yet, \TeX{}studio will show you an error message.
Feel free to contact us in this case.\footnote{Find us at \url{https://www.uni-bamberg.de/wiai/fs}.}

Binary file not shown.

BIN
graphics/cover-script.pdf Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,3 @@
\thispagestyle{empty}
\includepdf{graphics/cover.pdf}
\newpage
\thispagestyle{empty}
@ -10,7 +6,7 @@
\begin{tabular}{@{}lp{9cm}}
& \subsubsection*{Imprint} \\
& The \LaTeX{} Script (version 1.2 from June 18th, 2022) has been assembled by the Student Council of the Information Systems and Applied Computer Sciences Faculty (Fachschaft \acro{WIAI}) at the University of Bamberg. \\
& The \LaTeX{} Script (version 1.4 from April 28th, 2023) 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 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.

View File

@ -1,4 +1,4 @@
\begin{align*}
\left\lbrace x \mid tiefe(x) \geq 20 \right\rbrace \\
\left\lbrace x \mid \mathrm{tiefe}(x) \geq 20 \right\rbrace
\left\lbrace x \mid \text{tiefe}(x) \geq 20 \right\rbrace
\end{align*}

91
main-exercises.tex Normal file
View File

@ -0,0 +1,91 @@
\input{setup.tex} % Setup
\input{praeamble.tex} % Preamble
\input{commands.tex} % Custom commands
\title{Script for the Fachschaft \acro{WIAI} \LaTeX{} Workshop}
\author{Evelyn Fradtschuk \and Jessica Klarmann \and Florian Knoch \and Theresa Knoll \and Christian Kremitzl \and Bernhard Luedtke \and Jochen Mehlich}
\begin{document}
\selectlanguage{english}
\frenchspacing
% Custom headline prefix
\renewcommand{\thesection}{E\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}
% Title page
\input{titlepage-exercises.tex}
% or simply
% \maketitle
\thispagestyle{empty}
\newpage
\setcounter{page}{1} % Don't count title page.
\setcounter{tocdepth}{2}
\tableofcontents
\newpage
\input{first-steps-with-latex.tex}
% Align exercise numbers with chapters
\setcounter{section}{2}
\input{exercises/basic-document-structure/task}
\subsubsection*{Modify the content below}
\input{exercises/basic-document-structure/document-structure.raw}
\newpage
\input{exercises/project-structure/task}
\subsubsection*{Modify the content below}
\input{exercises/project-structure/tasks.raw}
\newpage
\input{exercises/special-characters/task}
\subsubsection*{Modify the content below}
\input{exercises/special-characters/special-characters.raw}
\newpage
\input{exercises/text-markup/task}
\subsubsection*{Modify the content below}
\input{exercises/text-markup/markup.raw}
\newpage
\input{exercises/lists/task}
\subsubsection*{Modify the content below}
\input{exercises/lists/lists.raw}
\newpage
\input{exercises/maths/task}
\subsubsection*{Modify the content below}
\input{exercises/maths/math-formulas.raw}
\newpage
\input{exercises/graphics/task}
\subsubsection*{Modify the content below}
\input{exercises/graphics/graphics.raw}
\newpage
\input{exercises/tables/task}
\subsubsection*{Modify the content below}
\input{exercises/tables/tables.raw}
\newpage
\input{exercises/footnotes/task}
\subsubsection*{Modify the content below}
\input{exercises/footnotes/footnotes.raw}
\newpage
\input{exercises/references/task}
\subsubsection*{Modify the content below}
\input{exercises/references/references.raw}
\newpage
\input{exercises/literature/task}
\subsubsection*{Modify the content below}
\input{exercises/literature/literature.raw}
\newpage
\input{exercises/source-code-listings/task}
\subsubsection*{Modify the content below}
\input{exercises/source-code-listings/source-code-listings.raw}
\end{document}

View File

@ -3,14 +3,14 @@
\input{commands.tex} % Custom commands
\title{Script for the Fachschaft \acro{WIAI} \LaTeX{} Workshop}
\author{Evelyn Fradtschuk \and Florian Knoch \and Christian Kremitzl \and Bernhard Luedtke}
\author{Evelyn Fradtschuk \and Jessica Klarmann \and Florian Knoch \and Theresa Knoll \and Christian Kremitzl \and Bernhard Luedtke \and Jochen Mehlich}
\begin{document}
\selectlanguage{english}
\frenchspacing
% Title page
\input{content/titlepage.tex}
\input{titlepage.tex}
% or simply
% \maketitle
\thispagestyle{empty}
@ -20,31 +20,19 @@
\tableofcontents
\newpage
\input{content/first-steps-with-latex.tex}
\input{content/why-use-latex.tex}
\input{content/basic-functionality.tex}
\input{content/basic-document-structure.tex}
\exercise{basic-document-structure}
\input{content/project-structure.tex}
\exercise{project-structure}
\input{content/special-characters.tex}
\exercise{special-characters}
\input{content/text-markup.tex}
\exercise{text-markup}
\input{content/lists.tex}
\exercise{lists}
\input{content/maths.tex}
\exercise{maths}
\input{content/graphics.tex}
\exercise{graphics}
\input{content/tables.tex}
\exercise{tables}
\input{content/source-code-listings.tex}
\exercise{source-code-listings}
\input{content/footnotes.tex}
\exercise{footnotes}
\input{content/literature.tex}
\exercise{literature}
\input{content/source-code-listings.tex}
\input{content/prospects.tex}
\end{document}

79
main-solutions.tex Normal file
View File

@ -0,0 +1,79 @@
\input{setup.tex} % Setup
\input{praeamble.tex} % Preamble
\input{commands.tex} % Custom commands
\title{Script for the Fachschaft \acro{WIAI} \LaTeX{} Workshop}
\author{Evelyn Fradtschuk \and Jessica Klarmann \and Florian Knoch \and Theresa Knoll \and Christian Kremitzl \and Bernhard Luedtke \and Jochen Mehlich}
\begin{document}
\selectlanguage{english}
\frenchspacing
% Custom headline prefix
\renewcommand{\thesection}{E\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}
% Title page
\input{titlepage-solutions.tex}
% or simply
% \maketitle
\thispagestyle{empty}
\newpage
\setcounter{page}{1} % Don't count title page.
\setcounter{tocdepth}{2}
\tableofcontents
\newpage
\input{first-steps-with-latex.tex}
% Align exercise numbers with chapters
\setcounter{section}{2}
\input{exercises/basic-document-structure/task}
\input{exercises/basic-document-structure/document-structure.done}
\newpage
\input{exercises/project-structure/task}
\input{exercises/project-structure/tasks.done}
\newpage
\input{exercises/special-characters/task}
\input{exercises/special-characters/special-characters.done}
\newpage
\input{exercises/text-markup/task}
\input{exercises/text-markup/markup.done}
\newpage
\input{exercises/lists/task}
\input{exercises/lists/lists.done}
\newpage
\input{exercises/maths/task}
\input{exercises/maths/math-formulas.done}
\newpage
\input{exercises/graphics/task}
\input{exercises/graphics/graphics.done}
\newpage
\input{exercises/tables/task}
\input{exercises/tables/tables.done}
\newpage
\input{exercises/footnotes/task}
\input{exercises/footnotes/footnotes.done}
\newpage
\input{exercises/references/task}
\input{exercises/references/references.done}
\newpage
\input{exercises/literature/task}
\input{exercises/literature/literature.done}
\newpage
\input{exercises/source-code-listings/task}
\input{exercises/source-code-listings/source-code-listings.done}
\end{document}

View File

@ -49,6 +49,9 @@
% Literature
\usepackage{natbib}
% Line wraps in monospace font
\usepackage[htt]{hyphenat}
% Tracking changes
\usepackage{changes}
\definechangesauthor[color=blue, name={Christian}]{C}

5
titlepage-exercises.tex Normal file
View File

@ -0,0 +1,5 @@
\thispagestyle{empty}
\includepdf{graphics/cover-exercises.pdf}
\input{imprint}

5
titlepage-solutions.tex Normal file
View File

@ -0,0 +1,5 @@
\thispagestyle{empty}
\includepdf{graphics/cover-solutions.pdf}
\input{imprint}

5
titlepage.tex Normal file
View File

@ -0,0 +1,5 @@
\thispagestyle{empty}
\includepdf{graphics/cover-script.pdf}
\input{imprint}