Skip to content
Snippets Groups Projects
Commit 88a071c1 authored by witiko's avatar witiko
Browse files

Added LuaTeX support.

parent 882e4293
No related branches found
No related tags found
No related merge requests found
.PHONY: all clear
all:
make -C fithesis3
make pdflatex.pdf xelatex.pdf clear
make pdflatex.pdf xelatex.pdf lualatex.pdf clear
# This target typesets the pdfLaTeX example.
pdflatex.pdf: pdflatex.tex
......@@ -13,6 +13,11 @@ xelatex.pdf: xelatex.tex
xelatex $<
xelatex $<
# This target typesets the LuaLaTeX example.
lualatex.pdf: lualatex.tex
lualatex $<
lualatex $<
# This target removes any auxiliary files.
clear:
rm -f *.aux *.log *.out *.toc *.lot *.lof
......@@ -20,4 +25,4 @@ clear:
# This target removes any auxiliary files
# and the output PDF file.
implode: clear
rm -f pdflatex.pdf xelatex.pdf
rm -f pdflatex.pdf xelatex.pdf lualatex.pdf
......@@ -72,7 +72,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}
% \fi
\def\thesis@version{2015/04/26 v0.3.10 fithesis3 MU thesis class}
\def\thesis@version{2015/05/09 v0.3.10 fithesis3 MU thesis class}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
......@@ -185,11 +185,12 @@
% code after the preamble.
% \item\textsf{ifxetex} -- Used to detect the \Hologo{XeTeX}
% engine.
% \item\textsf{ifluatex} -- Used to detect the \Hologo{LuaTeX}
% engine.
% \item\textsf{inputenc} -- Used to enable the input utf-8
% encoding. This package does not get loaded under
% \Hologo{XeTeX}.
% \Hologo{XeTeX} and \Hologo{LuaTeX}.
% \end{itemize}
% for string parsing and comparisons.
% The \texttt{hyperref} package is also conditionally loaded during
% the expansion of the |\thesis@load| macro (see section
% \ref{sec:thesis@load}). Other packages may be required by the
......@@ -200,9 +201,10 @@
\RequirePackage{keyval}
\RequirePackage{etoolbox}
\RequirePackage{ifxetex}
\ifxetex\else
\RequirePackage{ifluatex}
\ifxetex\else\ifluatex\else
\RequirePackage[utf8]{inputenc}
\fi
\fi\fi
% \end{macrocode}
% \section{Public API}
% \label{sec:public-api}
......
......@@ -48,6 +48,5 @@
Sojka},
title={The \textsf{fithesis3} class for the typesetting of theses
written at the Masaryk Univerzity in Brno},
year={\the\year},
month={\the\month},
place={Brno}}
place={Brno},
year={2015}}
......@@ -74,7 +74,8 @@
class\footnote{See
\url{https://www.ctan.org/pkg/ntgclass}} and the following
packages:\begin{itemize}
\item\textsf{keyval}, \textsf{etoolbox}, \textsf{ifxetex}
\item\textsf{keyval}, \textsf{etoolbox}, \textsf{ifxetex},
\textsf{ifluatex}
\item\textsf{inputenc} -- only when typesetting with \TeX{} or
\hologo{pdfTeX}
\end{itemize} In order to be able to use the \textsf{fithesis3}
......@@ -92,7 +93,7 @@
\thguide@prnpkg{setspace}%
\thguide@prnpkg{geometry}}
\item\textsf{fontspec}, \textsf{unicode-math} -- only when
typesetting with \Hologo{XeTeX}
typesetting with \Hologo{XeTeX} or \Hologo{LuaTeX}
\item\textsf{mathpazo}, \textsf{tgpagella}, \textsf{lmodern},
\textsf{cmap}, \textsf{fontenc} -- only when typesetting
with \TeX{} or \hologo{pdfTeX}
......@@ -104,9 +105,9 @@
\url{https://www.ctan.org/pkg/tex-gyre-pagella}} and
\TeX{} Gyre Pagella Math\footnote{See
\url{https://www.ctan.org/pkg/tex-gyre-math-pagella}} OpenType
fonts are also required, when typesetting with \Hologo{XeTeX}.
All these are likely to be a part of any reasonably modern \TeX{}
distribution.
fonts are also required, when typesetting with \Hologo{XeTeX} or
\Hologo{LuaTeX}. All these are likely to be a part of any
reasonably modern \TeX{} distribution.
\section{Installation}
This section covers the installation of the \textsf{fithesis3}
......@@ -127,7 +128,7 @@
is not a part of
your \TeX{} distribution already. This can be easily verified by
creating the minimal document described in the next section and
typesetting it using either the \Hologo{XeTeX} or
typesetting it using either the \Hologo{XeTeX}, \Hologo{LuaTeX} or
the \hologo{pdfTeX} engine, respectively. In case
\textsf{fithesis3} is not a part of your \TeX{}
distribution, the typesetting will prematurely terminate with the
......@@ -163,14 +164,14 @@
Hello world!
\end{document}
\end{minted}
Now typeset the document using either the \hologo{pdfLaTeX} or
the \Hologo{XeLaTeX} engine. If everything is set up correctly,
you should end up with a document containing all the mandatory
parts of a thesis and one page at the end containing a
\texttt{Hello world!} line. You should notice that the document
is implicitly typeset in English and that it contains lots of
placeholder stringss for missing metadata (see Figure
\ref{fig:example01}). In the next chapter, we are going to
Now typeset the document using either the \hologo{pdfTeX} or the
\Hologo{XeTeX} engine with the \LaTeX{} format. If everything is
set up correctly, you should end up with a document containing
all the mandatory parts of a thesis and one page at the end
containing a \texttt{Hello world!} line. You should notice that
the document is implicitly typeset in English and that it
contains lots of placeholder stringss for missing metadata (see
Figure \ref{fig:example01}). In the next chapter, we are going to
address that.
\begin{figure}[!bt]
\centering\makeatletter
......@@ -220,11 +221,13 @@
are going to be typeset in Czech.
\end{document}
\end{minted}
The \textsf{babel} package can be used with Latin scripts, while
the \textsf{polyglossia} package supports non-Latin scripts as
well and is intended as a replacement of \textsf{babel} for
\Hologo{XeLaTeX}. You are advised to use one of them, depending
on your requirements.
At the time of writing this text, \textsf{polyglossia} can only
be used with \Hologo{XeTeX}, whereas \textsf{babel} can be used
with \hologo{pdfTeX}, \Hologo{XeTeX} and \Hologo{LuaTeX}. On the
ther hand, the \textsf{babel} package can only be used with Latin
scripts, while the \textsf{polyglossia} package supports
non-Latin scripts as well. You are advised to use one of them,
depending on your choice of \TeX{} engine and requirements.
\section{Inserting metadata}
Next, we are going to insert some metadata into the document. The
......@@ -379,6 +382,9 @@
\begin{document}
\end{document}
\end{minted}
This technique can also be used to override the default font,
which would be otherwise bothersome.
\section{Changing the layout}
If you are unsatisfied with the arrangement of the mandatory
......
......@@ -114,6 +114,8 @@
% \item\textsf{xcolor} -- Adds support for color manipulation.
% \item\textsf{ifxetex} -- Used to detect the \Hologo{XeTeX}
% engine.
% \item\textsf{ifluatex} -- Used to detect the \Hologo{LuaTeX}
% engine.
% \item\textsf{graphix} -- Adds support for the inclusion of
% graphics files.
% \item\textsf{pdfpages} -- Adds support for the injection of PDF
......@@ -130,21 +132,38 @@
\thesis@require{pdfpages}
\thesis@require{keyval}
\thesis@require{ifxetex}
\thesis@require{ifluatex}
% \end{macrocode}
% Using the |\ifxetex| and |\ifluatex| conditionals, a compound
% \DescribeMacro{\thesis@ifxeluatex}|\thesis@ifxeluatex|
% conditional was constructed. This conditional can be used by
% subsequently loaded style files to test for either the
% \Hologo{XeTeX} or \Hologo{LuaTeX} engline being used.
% \begin{macrocode}
\def\thesis@ifxeluatex{{%
\let\x\expandafter\let\f\csname\let\t\endcsname
\ifxetex\x\f\x i\x f\x t\x r\x u\x e\x\t
\else
\ifluatex\x\x\x\f\x\x\x i\x\x\x f\x\x\x t\x\x\x r%
\x\x\x u\x\x\x e\x\x\x\t
\else \x\x\x\f\x\x\x i\x\x\x f\x\x\x f\x\x\x a%
\x\x\x l\x\x\x s\x\x\x e\x\x\x\t
\fi
\fi}}
% \end{macrocode}
% The following packages get only loaded, when the document is
% being typeset using the \Hologo{XeTeX} engine: \begin{itemize}
% being typeset using the \Hologo{XeTeX} or \Hologo{LuaTeX}
% engine: \begin{itemize}
% \item\textsf{fontspec} -- Allows the selection of
% system-installed fonts. This package only gets loaded under
% \Hologo{XeTeX}.
% system-installed fonts.
% \item\textsf{unicode-math} -- Allows the selection of
% system-installed mathematical fonts. This package only gets
% loaded under \Hologo{XeTeX}.
% system-installed mathematical fonts.
% \end{itemize}
% Under \Hologo{XeTeX}, the \textsf{TeX Gyre Pagella} and
% \textsf{TeX Gyre Pagella Math} are also selected as the main text
% and math fonts.
% \begin{macrocode}
\ifxetex
\thesis@ifxeluatex
\thesis@require{fontspec}
\thesis@require{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
......
......@@ -2,10 +2,9 @@
all: clean
for file in *.tex; do \
ln -s "$$file" current.tex && \
pdflatex current && \
pdflatex current && \
xelatex current && \
xelatex current && \
pdflatex current && pdflatex current && \
xelatex current && xelatex current && \
lualatex current && lualatex current && \
rm current.*; \
done
......
% This file is just a symbolic link to the xelatex.tex file.
\input xelatex
......@@ -8,7 +8,7 @@
\chapter{Foo bar}
Hello world!
\begin{equation}
\tag{Massenergy equivalence} e=mc^2
\tag{Mass--energy equivalence} e=mc^2
\end{equation}
\begin{center}
\begin{tabularx}{\textwidth}{lllX}
......
......@@ -9,7 +9,7 @@
\chapter{Foo bar}
Hello world!
\begin{equation}
\tag{Massenergy equivalence} e=mc^2
\tag{Mass--energy equivalence} e=mc^2
\end{equation}
\begin{center}
\begin{tabularx}{\textwidth}{lllX}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment