The LaTeX Thesis Template will be released soon with a new updated version with a new code using LuaLaTeX. It was already available when my first LaTeX Template was released in 2013. Since that time, a lot has happened in LaTeX and the LuaLaTeX engine so that in 2022 I would recommend using LuaLaTex.
The differences in the LaTeX Code that are required to change from pdflatex tu lualatex are described in many user forums, here is a popular example (tex.stackexchange.com)
In this post I am going to show the current changes in the code that is under development. These are not complete but show the main differences.
LaTeXTemplate.tex
% !TeX program = pdflatex |
added
% !TeX program = lualatex |
removed since fix-cm
cannot be used together with luatex.
%% Bug fixes and other packages to be loaded before the class \\RequirePackage{fix-cm} % permit Computer Modern fonts at arbitrary sizes. % |
With lualatex the previous fixes are not needed anymore.
% packages to allow more \\write outputs \\input{preamble/packages-SolutionsNoRoomForNewWrite.tex} |
removed all packages for encoding
% automatic selection of encoding % insert chars for umlaut a and sz \\usepackage{selinput} \\SelectInputMappings{adieresis={ä},germandbls={ß},Euro={€}} % Encoding of _files and directories_ % (ensures that any file can be loaded without problems) \\usepackage[% extendedchars, encoding, multidot, space, filenameencoding=latin1, % Windows XP, Vista, 7 % filenameencoding=utf8, % Linux, OS X ]{grffile} |
% lualtex expects utf8 by default % no package or option required |
Changed the order of packages loading and fonts. Previously the fonts were loaded first.
However, with lualatex packages for fonts must be loaded before the actual fonts. Therefore the fonts configuration is loaded at the end.
%% select/load fonts \\input{fonts/fonts.tex} %\\input{fonts/font-commercial.tex} %% load packages \\input{preamble/packages.tex} %% apply style settings \\input{preamble/style.tex} %% new commands / definitions (required by the template!) \\input{preamble/commands.tex} |
%% load packages \\input{preamble/packages.tex} %% apply style settings \\input{preamble/style.tex} %% new commands / definitions (required by the template!) \\input{preamble/commands.tex} %% select/load fonts \\input{fonts/fonts.tex} |
fonts/font-commercial.tex
was removed from the template.fonts/fonts.tex
fontenc, textcomp, cmap
% Make PDF files searchable and copyable % load before: fontenc \\usepackage{cmap} % T1 Schrift Encoding \\usepackage[T1]{fontenc} % Description: Additional Symbols (Text Companion font extension) % Doc: encguide.pdf \\usepackage{textcomp} |
packages
lmodern
% Latin Modern (LaTeX Standard) % is loaded automatically with \usepackage{unicode-math} % Manual setting is done by %\setmainfont{Latin Modern Roman} %\setsansfont{Latin Modern Sans} %\setmonofont{Latin Modern Mono} %\setmathfont{Latin Modern Math} |
- Times, Helvetica, Courier
- Palantino, Helvetica, Courier
- Charter, Bera Sans, Luxi Mono
- Garamond, Fira Sans, Luxo Mono
- MininPro/MyriadPro
- Cambria, Calibri, Consolas
preamble/packages.tex
In this file all packages are loaded. Changes have been done due to font packages related to luatex and other modern packages.
% Description: support automatic translations % Doc: beameruserguide.pdf \usepackage{translator} |
fixmath
% Description: fixes for the default Computer Modern math fonts % Doc: fixmath.pdf \IfPackageLoaded{lmodern}{% \usepackage{fixmath} } |
fontspec
%% Description: Font selection for LuaLaTeX %% Doc: fontspec.pdf % Allows LuaTeX to load OpenType fonts. No special font installation is necessary, % fonts only need to be available in the operating system. % Classic LaTeX font selection is disabled by loading this package! \usepackage{fontspec} |
unicode-math
% Description: implementation of Unicode maths for LATEX using LuaTEX typesetting engines % - It should be loaded after any other maths or font-related package % in case it needs to overwrite their definitions. % - Once the package is loaded, traditional TFM-based maths fonts are no longer % supported; you can only switch to a different OpenType maths font using the % \setmathfont command. % - amsmath should be loaded before unicode-math to avoid conflicts \usepackage{unicode-math} |
removed package tabu. The reasons are documented here https://tex.stackexchange.com/questions/470107/incompatibility-of-fix-in-latex3-latex2e-in-respect-to-unmaintained-tabu-packa
added packages tabularray
and tcolorbox
% Description: Typeset Tabulars and Arrays with LATEX3 % A completely new package for tabulars that will completely % separate the content and style of the table, and the style % of the table can be completely set in keyval way \usepackage{tabularray} % Description: tcolorbox provides an environment for colored % and framed text boxes with a heading line. \usepackage{tcolorbox} |
removed package tocstyle
. This package was discontinued 2020 and removed from all distributions
% Description: apply different styles for the formating of the % table of contents and lists of floats. %%% Doc: tocstyle.pdf (Koma Script) %% Alpha package, uses koma fonts (\setkomafont{}{}) only if KOMAlike is selected % \usepackage[% %%% toc width calculation tocindentauto, % all widths at the TOCs are calculated by tocindentauto % tocindentmanual, % opposite of auto %%% indentation of toc tocgraduated, % standard % tocflat, % no intendation, text aligned % tocfullflat, % no intendation, no alignment %%% page breaking rules tocbreaksstrict, % sets a lot of penalties before and after TOC entries % to avoid page break between a TOC entry and it's parent. % tocbreakscareless,% allow more page breaks. %%% indentation of unnumbered TOC entries % toctextentriesindented, % unnumbered TOC entrie are indented only as wide % % as the number of numbered TOC entries of the same % % level. toctextentriesleft, % indented as if they have an empty number. ]{tocstyle} |
style.tex
to replace tocstyle
% usage of functions from tocbasic (from koma-script) % Is loaded by koma-script automatically. % see: %https://tex.stackexchange.com/questions/557571/what-should-i-use-instead-of-tocstyle %https://tex.stackexchange.com/questions/653373/move-from-tocstyle-to-tocbasic % Declare common style \DeclareTOCStyleEntries[ raggedentrytext, linefill=\hfill, numwidth=0pt, numsep=1ex, dynnumwidth ]{tocline}{chapter,section,subsection,subsubsection,paragraph,subparagraph} % declare different style for everthing except chapter \DeclareTOCStyleEntries[ linefill=\TOCLineLeaderFill, indent=0pt, dynindent ]{tocline}{section,subsection,subsubsection,paragraph,subparagraph} % set Chapter font to bold \setkomafont{chapterentry}{\bfseries} |