LaTeXBookTemplate
LaTeX template for books, manuals, documentations, theses, etc.
Table of Contents
Release Notes
You will find the release notes in the CHANGELOG.md
Build and Setup
This LaTeX document is tested with the following tools
- Overleaf
- Atom editor in combination with Tex Live. Tested with:
- Debian 9
- Debian 10
- Ubuntu 18.04.1
- Atom editor in combination with MiKTeX. Tested with:
- Windows 7
- Shell script in combination with Tex Live. Tested with:
- Debian 9
- Debian 10
- Ubuntu 18.04.1
Overleaf
- The used compiler is XeLaTeX.
- The main document is main.tex.
Windows
To build with the Atom editor on Windows you have to execute the below steps.
Installation of MiKTeX
- Download the installation file from https://miktex.org/
- Install MiKTeX
- Download ActivePerl.exe
- Install ActivePerl
- Navigate to C:\Program Files\MiKTeX 2.9\miktex\bin\x64 and run perltex.exe
Installation of Atom
- Download the installation file from https://atom.io/
- Install Atom
- Run Atom and install the packages
atom-latex
- v0.8.2: There is a known issue on UNIX systems ashthespy/Atom-LaTeX#110. (Fixed in version v0.8.3)
Therefore you have to edit the file/home/<user>/.atom/packages/atom-latex/lib/builder.coffee
in line 66 from@buildErrs += data
to@buildErrs[@buildErrs.length - 1] += data
- v0.8.2: There is a known issue on UNIX systems ashthespy/Atom-LaTeX#110. (Fixed in version v0.8.3)
language-latex
- Open the
atom-latex
package settings and changeLaTeX compiler to use
toxelatex
BibTex compiler to use
tobiber
- Add to the default values of
Files to clean
the file extensions*.run.xml, *.gz, *.atfi, *.bcf, *.maf, *mtc*, *.ilg, *.lol, *.glsdefs
- make sure that
Clean LaTeX auxiliary files after building process
is enabled.
Linux
To build with the Atom editor on Linux you have to execute the below steps.
Installation of TeX Live
Install TeX Live with the required packages. Therefore execute the below command
apt-get install texlive texlive-xetex texlive-lang-german texlive-bibtex-extra biber latexmk latex-cjk-common
Installation of Atom
- Download the .deb package from https://atom.io/
- Install Atom with the command
dpkg -i /path/to/deb/file/atom-amd64.deb
- Run Atom and install the packages
atom-latex
- v0.8.2: There is a known issue on UNIX systems ashthespy/Atom-LaTeX#110. (Fixed in version v0.8.3)
Therefore you have to edit the file/home/<user>/.atom/packages/atom-latex/lib/builder.coffee
in line 66 from@buildErrs += data
to@buildErrs[@buildErrs.length - 1] += data
- v0.8.2: There is a known issue on UNIX systems ashthespy/Atom-LaTeX#110. (Fixed in version v0.8.3)
language-latex
- Open the
atom-latex
package settings and changeLaTeX compiler to use
toxelatex
BibTex compiler to use
tobiber
- Add to the default values of
Files to clean
the file extensions*.run.xml, *.gz, *.atfi, *.bcf, *.maf, *mtc*, *.ilg, *.lol, *.glsdefs
- make sure that
Clean LaTeX auxiliary files after building process
is enabled.
Shell Script
Just execute the build.sh script.
sh build.sh
Write Japanese
Installation of Japanese (Mozc) (IBus) on Debian.
First, set up locales:
sudo dpkg-reconfigure locales
In addition to the English locale (en_US.UTF-8) or German locale (de_DE.UTF-8), include Japanese locales (ja_JP.EUC-JP and ja_JP.UTF-8). However, set the default locale for the system to en_US.UTF-8 or de_DE.UTF-8.
Install im-config:
sudo apt-get install im-config
Install and configure IBus-related packages:
sudo apt-get install ibus ibus-clutter ibus-mozc
sudo apt-get install ibus-gtk3
Run
im-config
Select No to the question from im-config.
Run the IBus setup program:
ibus-setup
If asked, start ibus-daemon.
Under the Input Method tab, add -> Japanese -> Mozc.
Under IBus Preferences, configure things to your liking. For example, I prefer making Ctrl + Space (as opposed to Shift + Space) trigger the switch between input modes. The IBus icon also shows up in the system tray, from which various settings can be changed. The default key short cut might be Super(Windows) Key + Space.
Further tipps: http://www.textfugu.com/season-4/social-learning/9-3/
Debian PDF Viewer
On debian it might be necessary to install additonal fonts to see japanese characters.
apt install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core
Configuration
The most settings can be defined in config/config.tex.
One-/Two-sided
The document style can be changed from one-sided to two-sided using the documentclass property in main.tex line 6
Enable / Disable Sections
You can decide to include or exclude the below sections. By default all sections are included. If you wish to exclude a section you have to replace true
with false
in config/config.tex for the desired section. (see line 9-19 + 22-23)
- Title Page
- Disclaimer text (If disclaimer and copyright is exluded the entire page is removed)
- Copyright text (If copyright and disclaimer is exluded the entire page is removed)
- Abstract
- Table of Contents
- List of Figures
- List of Tables
- Listings
- Abbreviations
- Glossary (The entries can be set in base/glossary/EN.tex)
- Appendix
- Table of Appendix (If appendix is excluded the table of appendix will be excluded, too.)
- References Page
- Index
Font Family
The preferred font family can be set in config/config.tex. (see line 7)
Href Frame
The frame around links can be enabled or disabled in config/config.tex line 25
Table of Contents Layout
- You can define the indent of the sections in config/layout.tex. (see line 203)
Counter of figures, tables and lstlisting
You can decide if the counter of figures, tables lstlisting will be affected by the chapter number. By default the counter is affected by the chapter number. If you wish to change this behavior you have to replace false
with true
in config/config.tex. (see line 28)
Language Support
The language can be set in config/config.tex line 4
Appendix
- To add a new language you have to create
- a new file in base/appendix. The name of the file must be the language code e.g. FR for French + the file extension .tex
- Syntax: base/appendix/<language code>.tex
Contents
- To add a new language you have to create
- a new directory in contents. The name of the directory must be the language code e.g. FR for French.
- a new file with name contents.tex in the previously created directory.
- Syntax: contents/<language code>/contents.tex
Copyright
- To add a new language you have to create
- a new file in base/copyright. The name of the file must be the language code e.g. FR for French + the file extension .tex
- Syntax: base/copyright/<language code>.tex
Dictionary
- To add a new language you have to create
- a new file in dictionary. The name of the file must be the language code e.g. FR for French + the file extension .tex
- Syntax: dictionary/<language code>.tex
Disclaimer
- To add a new language you have to create
- a new file in base/disclaimer. The name of the file must be the language code e.g. FR for French + the file extension .tex
- Syntax: base/disclaimer/<language code>.tex
Glossary
- To add a new language you have to create
- a new file in base/glossary. The name of the file must be the language code e.g. FR for French + the file extension .tex
- Syntax: base/glossary/<language code>.tex
Content
Thesis
There is a example config and title page for a thesis.
Replace in main.tex
\input{config/config}
with\input{config/thesisconfig}
(see line 10-11)\input{base/titlepage/titlepage}
with\input{base/titlepage/thesistitlepage}
(see line 37-38)
Images
If you want to add an image I advise to do the below steps.
- copy the image to the
images
folder in the project root directory. - Create a definition for the image path in
config/images.tex
e.g.\def\IMGExampleImage{images/path/to/file/name.png}
- To use the image in the document write
\includegraphics{\IMGExampleImage}
Colors
If you wish to use a none standard color you should at the definiton in config/colors.tex
Code Snippets / Listings
The styles for the listings are defined in config/lstdefinestyle.tex. If you want to add a code snippet i advise to do the below steps.
- copy the file with the code to the
snippets
folder in the project root directory. - Create a definition for the code path in
config/snippets.tex
e.g.\def\SNIPPETExample{snippets/path/to/file/name.html}
- To use the snippet in the document write
\lstinputlisting[language=bash, style=customStyleHTMLDark, caption=Snippet title]{\SNIPPETExample}
3rd Party
Fonts
- Noto Serif
- Noto Serif CJKjp
- Noto Sans
- Noto Sans CJKjp
- Source: Google Noto Fonts
- License: SIL Open Font License, Version 1.1
- Roboto
- Source: Google Fonts
- License: Apache License 2.0
- Computer Modern Unicode Serif
Images
- images/content/nate-grant-346782.jpg
- Source: Unsplash
- License: do whatever you want
- images/content/ben-kolde-367194.jpg
- Source: Unsplash
- License: do whatever you want