diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..dc03c09f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "LaTeX", + "image": "registry.gitlab.com/islandoftex/images/texlive:latest", + "customizations": { + "vscode": { + "extensions": [ + "james-yu.latex-workshop", + "tecosaur.latex-utilities", + "ltex-plus.vscode-ltex-plus", + "jabref.jabref-4-vscode", + "davidanson.vscode-markdownlint" + ], + "settings": { + "latex-workshop.docker.enabled": false + } + } + } +} diff --git a/.latexmkrc b/.latexmkrc index 7011912a..513db891 100644 --- a/.latexmkrc +++ b/.latexmkrc @@ -6,6 +6,14 @@ $pdflatex = 'lualatex --file-line-error --synctex=-1 %O %S'; # automatically call lualatex/pdflatex (instead of latex) $pdf_mode = 1; +# The "realmainfile" option of currfile (loaded for the examples) reads the recorder +# file (.fls), so latexmk takes it for a source file. Its content differs between +# runs (e.g., the font cache LuaLaTeX creates on the first run), which causes +# needless reruns and, after five of them, exit code 12 without any error in the +# log. Ignore the recorder file when checking whether a rerun is needed; this is +# a no-op when nothing reads it. +$hash_calc_ignore_pattern{'fls'} = '^'; + # replaces main.pdf by jobname.pdf # Note: -pvc may then not find the PDF. #$jobname = 'thesis'; diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ebfc8c..4bb0a6ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/). From 2025-01-26 onwards, versioning is done using [Calendar Versioning](https://calver.org/). +## [Unreleased] + +### Added + +- LuaLaTeX: [linebreaker](https://ctan.org/pkg/linebreaker) sets a paragraph again with more tolerance when a line would run into the margin. +- README: "Further information" links common questions of LaTeX beginners (often referenced questions on TeX.SE, Barbara Beeton's "What every LaTeX newbie should know"). +- Progress bars below headings show how far each chapter is written: `\progress{60}` below a heading draws a bar filled to 60 %; `\showprogressfalse` hides all bars for the submitted version. +- A commented-out line in the preamble switches to serif headings (classic English book style); sans-serif stays the default. +- [fewerfloatpages](https://ctan.org/pkg/fewerfloatpages) avoids pages that contain only a few floats. +- `.devcontainer/devcontainer.json`: open the repository in VS Code ("Reopen in Container") or in GitHub Codespaces to work inside the TeX Live image, without a local LaTeX installation. + +### Changed + +- LuaLaTeX: widows and orphans are removed by [lua-widow-control](https://ctan.org/pkg/lua-widow-control), which keeps pages full by lengthening or shortening a paragraph by one line; pdfLaTeX keeps [nowidow](https://ctan.org/pkg/nowidow). +- Long URLs may break after any character ([xurl](https://ctan.org/pkg/xurl)), so they no longer run into the margin. +- The running header and the page number are typeset in a smaller font. +- `docs/latex-setup.md` recommends Docker for compiling and VS Code for editing (linking to the README); the MiKTeX and Ubuntu hints stay as the traditional setup and TeXstudio is the last alternative. +- `docs/latex-setup.md` no longer mentions Ubuntu 16.04. +- The README and `docs/latex-setup.md` recommend the [JabRef beta version](https://github.com/JabRef/jabref/releases), because the stable version 5.15 is too old. + +### Removed + +- The switched-off [spelling](https://ctan.org/pkg/spelling) package is no longer loaded. + +### Fixed + +- latexmk no longer reruns LaTeX just because the recorder file (`.fls`) changed, which could end in exit code 12 without any error in the log (seen with LuaLaTeX in a fresh Docker container): `.latexmkrc` ignores the `.fls`, which currfile reads for the example listings. + ## [2026-10-19] ### Added diff --git a/README.md b/README.md index e26d8cff..34f987fd 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,8 @@ Thus, `minted` works out of the box - also on Windows, without a separate Python 1. Optional: Let VS Code compile in the container, see ["VS Code configuration"](#vs-code-configuration). +No Docker at hand? Open the repository in [GitHub Codespaces](https://github.com/features/codespaces) and compile in the browser. + If you need additional tools in the image, extend the generated `Dockerfile`, build it with `docker build -t ltg .`, and use `ltg` instead of the image name. ### Traditional @@ -479,12 +481,13 @@ We are collecting alternatives at the issue [#25](https://github.com/latextempla ## Further information - Why the templates use which packages: [decision records of the template generator](https://github.com/latextemplates/generator-latex-template/tree/main/docs/decisions) -- Other templates: +- Common questions of LaTeX beginners: the list of [often referenced questions on TeX.SE](https://tex.meta.stackexchange.com/q/2419/9075) and Barbara Beeton: [What every LaTeX newbie should know](https://tug.org/tug2023/files/fr-04-beeton-newbie/beeton-newbie-preprint.pdf) (TUG 2023). - For German users, go to . - Frank Mittelbach with Ulrike Fischer: [The LaTeX Companion](https://www.latex-project.org/news/2023/03/17/TLC3/) is the ultimate guide for LaTeX: The authors went through all packages offered by [CTAN](https://ctan.org/), selected the most promising ones, described them, and provide minimal working example for each of it. - Lutz Hering, Heike Hering: [How to Write Technical Reports](https://doi.org/10.1007/978-3-540-69929-3), Springer, 2010; also available in German [Technische Berichte - verständlich gliedern, gut gestalten, überzeugend vortragen](https://doi.org/10.1007/978-3-8348-8317-9). - Highly recommended, because it guides through all aspects of a report (such as a Master Thesis). - Marcus Deininger et al.: [Studienarbeiten - Ein Leitfaden zur Erstellung, Durchführung und Präsentation wissenschaftlicher Abschlussarbeiten am Beispiel Informatik](https://vdf.ch/studienarbeiten.html?author_id=2877), vdf. - Recommended as guideline for planning and working on the whole thesis. - Charles Lipson, [Cite Right, Second Edition: A Quick Guide to Citation Styles--MLA, APA, Chicago, the Sciences, Professions, and More](http://www.press.uchicago.edu/ucp/books/book/chicago/C/bo10702043.html), Chicago Guides to Writing, Editing, and Publishing, 2011. - Recommended in case you are unsure about how to correctly cite something. +- Other templates: ## License diff --git a/Texlivefile b/Texlivefile index 36f1db9a..d5bb258a 100644 --- a/Texlivefile +++ b/Texlivefile @@ -49,6 +49,7 @@ etexcmds etoolbox everyshi fgruler +fewerfloatpages fifo-stack filehook fixmath @@ -90,6 +91,7 @@ lccaps letltxmacro libertine libertinus-fonts +linebreaker lineno lipsum listings @@ -100,9 +102,9 @@ luacode lualatex-math luamplib metapost +lua-widow-control luatex85 luatexbase -luaxml ly1 marginnote markdown @@ -143,6 +145,7 @@ pgf-umlsd pict2e placeins plantuml +progressbar psnfss ragged2e refcount @@ -157,7 +160,6 @@ siunitx snapshot soul soulpos -spelling stringenc sttools subfig @@ -190,6 +192,7 @@ xifthen xkeyval xpatch xstring +xurl zref zref-clever zref-vario diff --git a/chapters-de/10 - einleitung.tex b/chapters-de/10 - einleitung.tex index 5fb72535..1897b6f7 100644 --- a/chapters-de/10 - einleitung.tex +++ b/chapters-de/10 - einleitung.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Introduction}\label{sec:introduction} %%% =============================================================================== +\progress{10} \emph{Purpose and scope of your entire report}. The purpose of your entire report is to make a \emph{scientific argument using the scientific method}. diff --git a/chapters-de/20 - hintergrund.tex b/chapters-de/20 - hintergrund.tex index 40ffc10d..0475f7f8 100644 --- a/chapters-de/20 - hintergrund.tex +++ b/chapters-de/20 - hintergrund.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Background (SM1)}\label{sec:background} %%% =============================================================================== +\progress{15} \emph{Purpose and scope}. The background chapter has multiple roles. diff --git a/chapters-de/30 - problemdarstellung.tex b/chapters-de/30 - problemdarstellung.tex index 1e30d888..c7e25ba9 100644 --- a/chapters-de/30 - problemdarstellung.tex +++ b/chapters-de/30 - problemdarstellung.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Problem Exposition (optional)}\label{sec:problem-exposition} %%% =============================================================================== +\progress{10} \emph{Purpose and scope}. Introduce the problem context in more detail if \zcref{sec:introduction:topic} does not provide all necessary information about the problem to follow the rest of the report. diff --git a/chapters-de/40 - erstes kapitel.tex b/chapters-de/40 - erstes kapitel.tex index 61cf5b58..c7d4aa34 100644 --- a/chapters-de/40 - erstes kapitel.tex +++ b/chapters-de/40 - erstes kapitel.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{First Real Chapter addressing first Research Problem}\label{sec:problem1} %%% =============================================================================== +\progress{0} \emph{Purpose and scope}. After you stated research context (SM1), research problem (SM2), and research method (SM3) in \zcref{sec:introduction} and possibly \zcref{sec:problem-exposition}, the remainder of your entire report addresses execution (SM4), results (SM5), and interpretation (SM6). @@ -18,6 +19,7 @@ \chapter{First Real Chapter addressing first Research Problem}\label{sec:problem % --------------------------------------------------------------------------------- \section{First Sub-Problem}\label{sec:problem1:subproblem1} % --------------------------------------------------------------------------------- +\progress{10} \emph{The first paragraph describes the first sub-problem and develops the requirements a solution has to satisfy (SM2 for this section).} The requirements have to be based on the knowledge and reasoning developing in the preceding chapters and sections. @@ -60,6 +62,7 @@ \section{First Sub-Problem}\label{sec:problem1:subproblem1} % --------------------------------------------------------------------------------- \section{Second Sub-Problem}\label{sec:problem1:subproblem2} % --------------------------------------------------------------------------------- +\progress{0} You now build on the solution to the first sub-problem of \zcref{sec:problem1:subproblem1} (SM1) and recall second sub-problem (SM2, you detailed in the introduction of this chapter) and follow the same pattern as before (SM3-SM6). diff --git a/chapters-de/50 - zweites kapitel.tex b/chapters-de/50 - zweites kapitel.tex index 05d5f139..4a602b7f 100644 --- a/chapters-de/50 - zweites kapitel.tex +++ b/chapters-de/50 - zweites kapitel.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Second Real Chapter}\label{sec:sub-problem2} %%% =============================================================================== +\progress{0} Have a short chapter introduction that recalls what you already achieved in \zcref{sec:problem1} and explain the second research problem of your thesis. The problem has to show up in the introduction in \zcref{sec:introduction:research-question} or in \zcref{sec:problem-exposition:research-problems} already. diff --git a/chapters-de/60 - evaluation.tex b/chapters-de/60 - evaluation.tex index b07e453b..76a0f55b 100644 --- a/chapters-de/60 - evaluation.tex +++ b/chapters-de/60 - evaluation.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Evaluation}\label{sec:evaluation} %%% =============================================================================== +\progress{0} \emph{Purpose and scope}. The evaluation chapter should be the most formal and rigorously structured chapter of your thesis as the validity of your evaluation argument depends on it. diff --git a/chapters-de/90 - zusammenfassung.tex b/chapters-de/90 - zusammenfassung.tex index 60e1334f..7c4ec4ed 100644 --- a/chapters-de/90 - zusammenfassung.tex +++ b/chapters-de/90 - zusammenfassung.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Zusammenfassung und Ausblick}\label{sec:conclusion} %%% =============================================================================== +\progress{0} Your conclusions are more than a factual summary of your work: they position, interpret, and defend your findings against the state of the art that you discussed in \zcref{sec:introduction:state-of-art}. You specifically outline which concrete findings or methodological contributions advance our knowledge towards the general objective you introduced in \zcref{sec:introduction:topic}. diff --git a/chapters-en/10 - introduction.tex b/chapters-en/10 - introduction.tex index a985e814..92de286a 100644 --- a/chapters-en/10 - introduction.tex +++ b/chapters-en/10 - introduction.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Introduction}\label{sec:introduction} %%% =============================================================================== +\progress{10} \emph{Purpose and scope of your entire report}. The purpose of your entire report is to make a \emph{scientific argument using the scientific method}. diff --git a/chapters-en/20 - background.tex b/chapters-en/20 - background.tex index 40ffc10d..0475f7f8 100644 --- a/chapters-en/20 - background.tex +++ b/chapters-en/20 - background.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Background (SM1)}\label{sec:background} %%% =============================================================================== +\progress{15} \emph{Purpose and scope}. The background chapter has multiple roles. diff --git a/chapters-en/30 - problem exposition.tex b/chapters-en/30 - problem exposition.tex index 1e30d888..c7e25ba9 100644 --- a/chapters-en/30 - problem exposition.tex +++ b/chapters-en/30 - problem exposition.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Problem Exposition (optional)}\label{sec:problem-exposition} %%% =============================================================================== +\progress{10} \emph{Purpose and scope}. Introduce the problem context in more detail if \zcref{sec:introduction:topic} does not provide all necessary information about the problem to follow the rest of the report. diff --git a/chapters-en/40 - first real chapter.tex b/chapters-en/40 - first real chapter.tex index 61cf5b58..c7d4aa34 100644 --- a/chapters-en/40 - first real chapter.tex +++ b/chapters-en/40 - first real chapter.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{First Real Chapter addressing first Research Problem}\label{sec:problem1} %%% =============================================================================== +\progress{0} \emph{Purpose and scope}. After you stated research context (SM1), research problem (SM2), and research method (SM3) in \zcref{sec:introduction} and possibly \zcref{sec:problem-exposition}, the remainder of your entire report addresses execution (SM4), results (SM5), and interpretation (SM6). @@ -18,6 +19,7 @@ \chapter{First Real Chapter addressing first Research Problem}\label{sec:problem % --------------------------------------------------------------------------------- \section{First Sub-Problem}\label{sec:problem1:subproblem1} % --------------------------------------------------------------------------------- +\progress{10} \emph{The first paragraph describes the first sub-problem and develops the requirements a solution has to satisfy (SM2 for this section).} The requirements have to be based on the knowledge and reasoning developing in the preceding chapters and sections. @@ -60,6 +62,7 @@ \section{First Sub-Problem}\label{sec:problem1:subproblem1} % --------------------------------------------------------------------------------- \section{Second Sub-Problem}\label{sec:problem1:subproblem2} % --------------------------------------------------------------------------------- +\progress{0} You now build on the solution to the first sub-problem of \zcref{sec:problem1:subproblem1} (SM1) and recall second sub-problem (SM2, you detailed in the introduction of this chapter) and follow the same pattern as before (SM3-SM6). diff --git a/chapters-en/50 - second real chapter.tex b/chapters-en/50 - second real chapter.tex index 05d5f139..4a602b7f 100644 --- a/chapters-en/50 - second real chapter.tex +++ b/chapters-en/50 - second real chapter.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Second Real Chapter}\label{sec:sub-problem2} %%% =============================================================================== +\progress{0} Have a short chapter introduction that recalls what you already achieved in \zcref{sec:problem1} and explain the second research problem of your thesis. The problem has to show up in the introduction in \zcref{sec:introduction:research-question} or in \zcref{sec:problem-exposition:research-problems} already. diff --git a/chapters-en/60 - evaluation.tex b/chapters-en/60 - evaluation.tex index b07e453b..76a0f55b 100644 --- a/chapters-en/60 - evaluation.tex +++ b/chapters-en/60 - evaluation.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Evaluation}\label{sec:evaluation} %%% =============================================================================== +\progress{0} \emph{Purpose and scope}. The evaluation chapter should be the most formal and rigorously structured chapter of your thesis as the validity of your evaluation argument depends on it. diff --git a/chapters-en/90 - conclusion.tex b/chapters-en/90 - conclusion.tex index 308abc71..ceae5ede 100644 --- a/chapters-en/90 - conclusion.tex +++ b/chapters-en/90 - conclusion.tex @@ -1,6 +1,7 @@ %%% =============================================================================== \chapter{Conclusion and Outlook}\label{sec:conclusion} %%% =============================================================================== +\progress{0} Your conclusions are more than a factual summary of your work: they position, interpret, and defend your findings against the state of the art that you discussed in \zcref{sec:introduction:state-of-art}. You specifically outline which concrete findings or methodological contributions advance our knowledge towards the general objective you introduced in \zcref{sec:introduction:topic}. diff --git a/docs/latex-setup.md b/docs/latex-setup.md index 43c68ab1..5e4ed26e 100644 --- a/docs/latex-setup.md +++ b/docs/latex-setup.md @@ -1,50 +1,18 @@ # Recommended LaTeX environments -## TeXStudio as LaTeX Editor - -Grammar and spell checking is available at [TeXstudio]. -Please download [LanguageTool] and [configure TeXstudio to use it](http://wiki.languagetool.org/checking-la-tex-with-languagetool#toc4). -Note that it is enough to point to `languagetool-server.jar`. -![language-tool-configuration](texstudio-configuration-languagetool.png) - -The template is compiled using normal compilation commands. -Your LaTeX environment (such as [TeXStudio]) should take care about the compilation transparently. - -If the document needs `--shell-escape` (for PlantUML or Mermaid diagrams, or for minted with TeX Live 2024), its first lines tell TeXstudio to compile with `--shell-escape`. -Then, TeXstudio warns that the compilation command will be overridden. -Please answer `(a) allow for this document`: - -![allow --shell-escape for this document](texstudio-confirmation-1.png) - -At "Build & View", there will be a question to update to biber. -Please answer `(a) allow for this document`: - -![allow biber for this document](texstudio-confirmation-2.png) - -When the "Package Installation" dialog pops up at TeXStudio, choose your username at "The package will be installed for:" and uncheck "Always show this dialog before installing packages." -If you want to include .svg graphics, [inkscape] has to be in your path. - -**Attention!** The first compilation will take **at least 30 seconds**, because there will be some LaTeX packages installed. - -**If TeXstudio doesn't fit your need, check [the list of all available LaTeX Editors](http://tex.stackexchange.com/questions/339/latex-editors-ides).** - -## JabRef for managing literature - -Use [JabRef] to manage your bibliography. -Quick installation using [Chocolatey]: `choco install texstudio languagetool jabref`. - -A comparison to other literature management software is available at . -See [LaTeX Editors/IDEs question on TeX.SX](http://tex.stackexchange.com/questions/339/latex-editors-ides) for a complete list of LaTeX editors. +The recommended setup is **Docker** for compiling and **VS Code** for editing. +Both are described in the main README; this page adds the details, platform-specific installation hints, and the TeXstudio alternative. ## LaTeX distribution -Choose one of the two setups: Docker-based or traditional. +Choose one of the two setups: Docker-based (recommended) or traditional. ### Docker-based (recommended) The [TeX Live docker image by the Island of TeX](https://gitlab.com/islandoftex/images/texlive#tex-live-docker-image) provides a perfectly configured LaTeX distribution with all required tools. It works the same on Windows, macOS, and Linux and ships `latexmk`, `biber`, `latexindent`, Python, and `latexminted`. Thus, `minted` works without further setup - also on Windows. +The generated `Dockerfile` is based on that image; see [Usage with docker](../README.md#usage-with-docker) in the main README. 1. Install Docker: [Docker Desktop](https://docs.docker.com/desktop/) on Windows and macOS, [Docker Engine](https://docs.docker.com/engine/install/) on Linux. On Linux, follow the [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) to run `docker` without `sudo`. @@ -71,30 +39,12 @@ Thus, `minted` works without further setup - also on Windows. docker run --rm -v "$PWD:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest latexmk main-english ``` -1. To compile from [TeXstudio], open Options > Configure TeXstudio > Commands and set - - "PdfLaTeX" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex`, - - "LuaLaTeX" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest lualatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex`, and - - "Biber" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest biber %`. - - On Linux and macOS, you can mount the directory at the same path instead (`-v DIROFTEXDOCUMENT:DIROFTEXDOCUMENT --workdir=DIROFTEXDOCUMENT`). - Then, the paths in the generated SyncTeX file match your machine, and jumping between source and PDF keeps working. -1. Press "Compile" (F6) in TeXstudio. - -For VS Code, see ["Using VSCode to Edit, Compile, and Preview PDFs"](#using-vscode-to-edit-compile-and-preview-pdfs). +To compile from an editor, see [VS Code](#vs-code-as-latex-editor) (recommended) or [TeXstudio](#using-texstudio-with-the-docker-image). ### Traditional Install a LaTeX distribution on your machine: [MiKTeX](https://miktex.org/download) on Windows, [TeX Live](https://www.tug.org/texlive/) on macOS and Linux. -#### Installation hints for Ubuntu - -- From Ubuntu 18.10 onwards, the basic version of the template works without issues. - Advanced usages such as cool syntax highlighting with [minted](https://www.ctan.org/pkg/minted) needs more configuration. -- Ubuntu 16.04 [ships biber 2.4](https://bugs.launchpad.net/ubuntu/+source/biber/+bug/1589644), so you have to upgrade your texlive distribution. - The easiest way is to uninstall the ubuntu package and use [install-tl-ubuntu](https://github.com/scottkosty/install-tl-ubuntu). - Then, you can follow the instructions given at to update your texlive distribution. - If you do not want to have an updated installation, but fiddle around with dirty patching your installation, please follow . - #### Installation hints for Windows Note: The default installation of MiKTeX might ship with incompatible biblatex and biber packages. @@ -108,7 +58,8 @@ If you installed MiKTeX other ways, you have to run "Update MiKTeX (Admin)" and 1. Open `cmd.exe` as Administrator 2. Paste and hit Enter `@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"` 1. Execute `choco feature enable -n=allowGlobalConfirmation` to get rid off additional installation confirmations. -1. Execute `choco install texstudio sumatrapdf.install strawberryperl jre8 jabref languagetool` to install necessary tooling. +1. Execute `choco install vscode sumatrapdf.install strawberryperl jre8 jabref languagetool` to install necessary tooling. + Replace `vscode` by `texstudio` if you prefer TeXstudio. 1. In case [PlantUML](http://plantuml.com/) should be used, follow the installation instructions at listed at the "pre-conditions" section. 1. For more recommended tooling see . @@ -143,71 +94,86 @@ If you installed MiKTeX other ways, you have to run "Update MiKTeX (Admin)" and 8. Execute `initexmf --update-fndb` (ensure that no other MiKTeX tooling such as the [MiKTeX Console](https://miktex.org/howto/miktex-console) is run in parallel - see ) 9. Execute `initexmf --mklinks --force` -## Using VSCode to Edit, Compile, and Preview PDFs +#### Installation hints for Ubuntu + +- From Ubuntu 18.10 onwards, the basic version of the template works without issues. + Advanced usages such as cool syntax highlighting with [minted](https://www.ctan.org/pkg/minted) needs more configuration. + The easiest way is to uninstall the ubuntu package and use [install-tl-ubuntu](https://github.com/scottkosty/install-tl-ubuntu). + Then, you can follow the instructions given at to update your texlive distribution. + If you do not want to have an updated installation, but fiddle around with dirty patching your installation, please follow . -***Note: The configuration of LaTeX Workshop on [Fast Guide on Writing LaTeX with LaTeX Workshop in VS Code](https://mathjiajia.github.io/vscode-and-latex/) may require some modifications to work with this template.*** +Always working solution: the [Docker-based setup](#docker-based-recommended). -### Prerequisites +## VS Code as LaTeX editor -1. Install [VSCode](https://code.visualstudio.com/). -2. Install [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop). -3. Install a LaTeX distribution (see ["LaTeX distribution"](#latex-distribution)). - With the Docker-based setup, LaTeX Workshop can run the tools in the container (an experimental feature of LaTeX Workshop); add the following to `settings.json`: +Use [VS Code](https://code.visualstudio.com/) with the [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop) extension. +The recommended extensions and the required `settings.json` entries are given at [VS Code configuration](../README.md#vs-code-configuration) in the main README. +You can also copy the contents of [vscode.settings.json](../vscode.settings.json) to your VS Code settings file. - ```json - "latex-workshop.docker.enabled": true, - "latex-workshop.docker.image.latex": "registry.gitlab.com/islandoftex/images/texlive:latest", - ``` +With the Docker-based setup, LaTeX Workshop can run the tools in the container (an experimental feature of LaTeX Workshop); add the following to `settings.json`: -### Recommended Setup of VSCode - -1. Open VSCode. -2. Press Shift+Ctrl+P to open the command palette. Then type "JSON" and select "Preferences: Open Settings (JSON)" to open `settings.json`. -3. Now copy and paste the following snippet into your `settings.json` file (inside the brackets `{}` of your file). - - ```json - "latex-workshop.latex.tools": [ - { - "name": "pdflatex", - "command": "pdflatex", - "args": [ - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "%DOC%" - ], - "env": {} - }, - { - "name": "biber", - "command": "biber", - "args": [ - "%DOCFILE%" - ], - "env": {} - } - ], - - "latex-workshop.latex.recipes": [ - { - "name": "pdflatex ➞ biber ➞ pdflatexX2", - "tools": [ - "pdflatex", - "biber", - "pdflatex", - "pdflatex" - ] - } - ], - ``` +```json +"latex-workshop.docker.enabled": true, +"latex-workshop.docker.image.latex": "registry.gitlab.com/islandoftex/images/texlive:latest", +``` -4. (optional) If you add the following line into your `settings.json`, the LaTeX Workshop extension will not automatically compile the code after any changes. You can manually trigger compilation by hitting the green button in the extension or using other methods provided by LaTeX Workshop. +If you do not want LaTeX Workshop to compile automatically after each change, add the following line and trigger the compilation manually: - ```json - "latex-workshop.latex.autoBuild.run": "never", - ``` +```json +"latex-workshop.latex.autoBuild.run": "never", +``` + +## JabRef for managing literature + +Use [JabRef] to manage your bibliography. +In 2026, install the latest beta version from : the stable version 5.15 is too old. + +A comparison to other literature management software is available at . + +## TeXstudio as LaTeX editor (alternative) + +If VS Code does not fit your needs, [TeXstudio] is a good alternative. +Windows: `choco install texstudio languagetool`. +For a complete list of LaTeX editors, see [the LaTeX Editors/IDEs question on TeX.SX](http://tex.stackexchange.com/questions/339/latex-editors-ides). + +Grammar and spell checking is available at [TeXstudio]. +Please download [LanguageTool] and [configure TeXstudio to use it](http://wiki.languagetool.org/checking-la-tex-with-languagetool#toc4). +Note that it is enough to point to `languagetool-server.jar`. +![language-tool-configuration](texstudio-configuration-languagetool.png) + +The template is compiled using normal compilation commands. +Your LaTeX environment (such as [TeXstudio]) should take care about the compilation transparently. + +If the document needs `--shell-escape` (for PlantUML or Mermaid diagrams, or for minted with TeX Live 2024), its first lines tell TeXstudio to compile with `--shell-escape`. +Then, TeXstudio warns that the compilation command will be overridden. +Please answer `(a) allow for this document`: + +![allow --shell-escape for this document](texstudio-confirmation-1.png) + +At "Build & View", there will be a question to update to biber. +Please answer `(a) allow for this document`: + +![allow biber for this document](texstudio-confirmation-2.png) + +When the "Package Installation" dialog pops up at TeXstudio, choose your username at "The package will be installed for:" and uncheck "Always show this dialog before installing packages." +If you want to include .svg graphics, [inkscape] has to be in your path. + +**Attention!** The first compilation will take **at least 30 seconds**, because there will be some LaTeX packages installed. + +### Using TeXstudio with the Docker image + +1. Open Options > Configure TeXstudio > Commands and set + - "PdfLaTeX" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex`, + - "LuaLaTeX" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest lualatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex`, and + - "Biber" to `docker run --rm -v "DIROFTEXDOCUMENT:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest biber %`. + + Replace `DIROFTEXDOCUMENT` by the directory of your LaTeX document. Example: `/home/user/thesis`. + On Linux and macOS, you can mount the directory at the same path instead (`-v DIROFTEXDOCUMENT:DIROFTEXDOCUMENT --workdir=DIROFTEXDOCUMENT`). + Then, the paths in the generated SyncTeX file match your machine, and jumping between source and PDF keeps working. +1. Press "Compile" (F6) in TeXstudio. [chocolatey]: https://chocolatey.org/ +[inkscape]: https://inkscape.org/ [JabRef]: https://www.jabref.org [LanguageTool]: https://languagetool.org/ -[TeXstudio]: http://texstudio.sourceforge.net/ +[TeXstudio]: https://www.texstudio.org/ diff --git a/generator-latex-template b/generator-latex-template index 101bb03e..4bdf74c1 160000 --- a/generator-latex-template +++ b/generator-latex-template @@ -1 +1 @@ -Subproject commit 101bb03eda48808de62df4a7a7974e87ffc0f7f8 +Subproject commit 4bdf74c1693a901976db6fdc7c49aacd3e90d24c diff --git a/main-basic-listings-english-thu.tex b/main-basic-listings-english-thu.tex index c2c609d5..79362d60 100644 --- a/main-basic-listings-english-thu.tex +++ b/main-basic-listings-english-thu.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 1024 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1164. +% vvvvvvvv The content starts in line 1055 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1195. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{thublue}{RGB}{0,84,163} @@ -716,6 +722,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -723,6 +733,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1021,6 +1044,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-basic-listings-english-university-of-hamburg.tex b/main-basic-listings-english-university-of-hamburg.tex index b56f91c0..70bf2997 100644 --- a/main-basic-listings-english-university-of-hamburg.tex +++ b/main-basic-listings-english-university-of-hamburg.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 1024 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1166. +% vvvvvvvv The content starts in line 1055 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1197. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{uhhred}{cmyk}{0,100,100,0} @@ -716,6 +722,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -723,6 +733,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1021,6 +1044,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-basic-listings-english.tex b/main-basic-listings-english.tex index b705f165..f6a65de9 100644 --- a/main-basic-listings-english.tex +++ b/main-basic-listings-english.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 1021 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1131. +% vvvvvvvv The content starts in line 1052 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1162. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} % Code Listings \usepackage{listings} @@ -714,6 +720,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -721,6 +731,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1018,6 +1041,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-basic-listings-german-thu.tex b/main-basic-listings-german-thu.tex index 1e3db6f9..168cbbe0 100644 --- a/main-basic-listings-german-thu.tex +++ b/main-basic-listings-german-thu.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 1051 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1192 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1083 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1224 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{thublue}{RGB}{0,84,163} @@ -734,6 +741,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -741,6 +752,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1048,6 +1072,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex diff --git a/main-basic-listings-german-university-of-hamburg.tex b/main-basic-listings-german-university-of-hamburg.tex index c2b5a953..ea99125d 100644 --- a/main-basic-listings-german-university-of-hamburg.tex +++ b/main-basic-listings-german-university-of-hamburg.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 1051 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1194 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1083 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1226 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{uhhred}{cmyk}{0,100,100,0} @@ -734,6 +741,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -741,6 +752,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1048,6 +1072,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex diff --git a/main-basic-listings-german.tex b/main-basic-listings-german.tex index fdbc64fd..8ed571d8 100644 --- a/main-basic-listings-german.tex +++ b/main-basic-listings-german.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 1048 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1159 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1080 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1191 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} % Code Listings @@ -732,6 +739,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -739,6 +750,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -1045,6 +1069,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex diff --git a/main-english-thu.tex b/main-english-thu.tex index 939c4fde..197509a8 100644 --- a/main-english-thu.tex +++ b/main-english-thu.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 958 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1094. +% vvvvvvvv The content starts in line 989 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1125. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{thublue}{RGB}{0,84,163} @@ -654,6 +660,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -661,6 +671,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -955,6 +978,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-english-university-of-hamburg.tex b/main-english-university-of-hamburg.tex index bebf90cb..96da8c56 100644 --- a/main-english-university-of-hamburg.tex +++ b/main-english-university-of-hamburg.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 958 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1096. +% vvvvvvvv The content starts in line 989 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1127. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{uhhred}{cmyk}{0,100,100,0} @@ -654,6 +660,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -661,6 +671,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -955,6 +978,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-english.tex b/main-english.tex index 77ff7d21..80a6d7b9 100644 --- a/main-english.tex +++ b/main-english.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv The content starts in line 955 (\begin{document}); the first -% chapter (\include{chapters-en/10 - introduction}) is included in line 1061. +% vvvvvvvv The content starts in line 986 (\begin{document}); the first +% chapter (\include{chapters-en/10 - introduction}) is included in line 1092. % The chapters are in the directory "chapters-en". % Everything above is the preamble: document class, packages, and settings. @@ -58,10 +58,10 @@ % For all options see https://tex.stackexchange.com/a/261435/9075. % \urlstyle{same} -% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075 -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% Allow URL breaks after any character, so that long URLs do not run into the margin. +% Loaded before biblatex, so that the biblatex settings of the URL penalties stay. +% See https://ctan.org/pkg/xurl. +\usepackage{xurl} % nicer // - solution by http://tex.stackexchange.com/a/98470/9075 % DO NOT ACTIVATE -> prevents line breaks @@ -234,12 +234,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -267,9 +271,16 @@ % Deactiviated, because does not look good % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -286,11 +297,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} % See https://github.com/gpoore/minted \usepackage[newfloat]{minted} @@ -652,6 +658,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -659,6 +669,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -952,6 +975,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom \pagenumbering{arabic} diff --git a/main-german-thu.tex b/main-german-thu.tex index 7a4e4e07..77fd1535 100644 --- a/main-german-thu.tex +++ b/main-german-thu.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 985 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1122 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1017 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1154 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{thublue}{RGB}{0,84,163} @@ -672,6 +679,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -679,6 +690,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -982,6 +1006,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex diff --git a/main-german-university-of-hamburg.tex b/main-german-university-of-hamburg.tex index b76c4535..d4c97ada 100644 --- a/main-german-university-of-hamburg.tex +++ b/main-german-university-of-hamburg.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 985 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1124 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1017 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1156 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} \definecolor{uhhred}{cmyk}{0,100,100,0} @@ -672,6 +679,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -679,6 +690,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -982,6 +1006,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex diff --git a/main-german.tex b/main-german.tex index 26d0a48f..0a734a2a 100644 --- a/main-german.tex +++ b/main-german.tex @@ -5,8 +5,8 @@ % !BIB program = biber % -*- coding:utf-8 mod:LaTeX -*- % -% vvvvvvvv Der Inhalt beginnt in Zeile 982 (\begin{document}); das erste -% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1089 eingebunden. +% vvvvvvvv Der Inhalt beginnt in Zeile 1014 (\begin{document}); das erste +% Kapitel (\include{chapters-de/10 - einleitung}) wird in Zeile 1121 eingebunden. % Die Kapitel liegen im Verzeichnis "chapters-de". % Alles darüber ist die Präambel: Dokumentklasse, Pakete und Einstellungen. @@ -66,10 +66,11 @@ \usepackage[hyphens]{url} % \urlstyle{same} % -% Hinweis von http://tex.stackexchange.com/a/10419/9075. -\makeatletter -\g@addto@macro{\UrlBreaks}{\UrlOrds} -\makeatother +% +% URLs nach jedem Zeichen umbrechen erlauben, damit lange URLs nicht in den Rand ragen. +% Vor biblatex geladen, damit die biblatex-Einstellungen der URL-Strafen bleiben. +% Siehe https://ctan.org/pkg/xurl. +\usepackage{xurl} %math stuff \usepackage[ @@ -231,12 +232,16 @@ %\usepackage{mathrsfs} % nice cursive letters via \mathscr{} %\usepackage{calrsfs} %\mathcal{} with slightly bolder letters - does not look that good. +% Headings are sans-serif (KOMA-Script default) in all languages. +% For serif headings (classic English book style), uncomment the following line. +% \setkomafont{disposition}{\normalfont\bfseries} + % Header: the chapter on the left, the current section on the right. % autooneside=false keeps the section mark in a single-sided document. \KOMAoptions{autooneside=false} \automark[section]{chapter} -\setkomafont{pageheadfoot}{\normalfont\sffamily} -\setkomafont{pagenumber}{\normalfont\sffamily} +\setkomafont{pageheadfoot}{\normalfont\small\sffamily} +\setkomafont{pagenumber}{\normalfont\small\sffamily} \ihead[]{\leftmark} \chead[]{} @@ -269,9 +274,16 @@ %\SetTracking{ encoding = *, shape = sc }{ 45 } % Avoid orphans and widows (a single line of a paragraph left at the bottom or top -% of a page). Using a package feels less hacky than tuning \clubpenalty and -% \widowpenalty manually. -\usepackage[all,defaultlines=3]{nowidow} +% of a page). +\ifdefined\directlua + % LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph + % by one line, instead of leaving an empty line at the bottom of the page. + \usepackage{lua-widow-control} +\else + % pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less + % hacky than tuning them manually. + \usepackage[all,defaultlines=3]{nowidow} +\fi % Avoid a widow line being split off a displayed equation. \displaywidowpenalty=10000 @@ -291,11 +303,6 @@ % Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox \usepackage{diagbox} -\ifluatex - \usepackage{spelling} - \spellingoutput{off} -\fi - \usepackage[dvipsnames, table]{xcolor} % See https://github.com/gpoore/minted @@ -670,6 +677,10 @@ % The lscape package does not rotate the page either \usepackage{pdflscape} +% Avoid float pages that are only partially filled: such floats are put back into the text flow. +% Source: https://ctan.org/pkg/fewerfloatpages +\usepackage{fewerfloatpages} + % Align floats to the top on float-only pages instead of vertically centering them. % See http://tex.stackexchange.com/a/28565/9075 \makeatletter @@ -677,6 +688,19 @@ \setlength{\@fpbot}{0pt plus 1fil} \makeatother +% Show how far each chapter or section is written: +% \progress{60} below a heading draws a bar filled to 60 %. +% Set \showprogressfalse to hide all bars, e.g., for the submitted version. +\usepackage{progressbar} +\newif\ifshowprogress +\showprogresstrue +\newcommand{\progress}[1]{% + \ifshowprogress + \par\vspace{-.5\baselineskip}% + {\parfillskip=0pt\noindent\progressbar[width=\linewidth,heighta=4pt,borderwidth=0.4pt,subdivisions=4,filledcolor=black!50]{\fpeval{#1/100}}\par}% + \fi +} + \usepackage[caption=false,font=footnotesize]{subfig} % Alternative for making subfigures: @@ -979,6 +1003,14 @@ \usepackage{scrhack} +% LuaLaTeX: avoid lines running into the margin. linebreaker sets an overfull +% paragraph again with increasing \tolerance and \emergencystretch until it fits. +% Loaded at the end of the preamble, after all packages that change line breaking. +% See https://ctan.org/pkg/linebreaker. +\ifdefined\directlua + \usepackage{linebreaker} +\fi + \begin{document} \raggedbottom % Variable Seitenhoehen zulassen \ifluatex