From 6ce71bc5802057095f38aef90505eb7f8975a25c Mon Sep 17 00:00:00 2001
From: witiko <witiko@gmail.com>
Date: Sat, 2 May 2015 20:59:21 +0200
Subject: [PATCH] Added support for the XeTeX engine.

---
 Makefile                        | 16 ++++---
 example.tex                     |  6 ---
 fithesis3/fithesis.dtx          | 22 ++++-----
 fithesis3/locale/Makefile       |  2 +-
 fithesis3/locale/czech.dtx      |  4 +-
 fithesis3/locale/slovak.dtx     |  2 +-
 fithesis3/style/Makefile        |  2 +-
 fithesis3/style/mu/Makefile     |  2 +-
 fithesis3/style/mu/base.dtx     | 80 +++++++++++++--------------------
 fithesis3/style/mu/econ.dtx     |  8 +---
 fithesis3/style/mu/fi.dtx       |  8 +---
 fithesis3/style/mu/fsps.dtx     |  8 +---
 fithesis3/style/mu/fss.dtx      |  8 +---
 fithesis3/style/mu/law.dtx      |  8 +---
 fithesis3/style/mu/med.dtx      |  8 +---
 fithesis3/style/mu/ped.dtx      |  8 +---
 fithesis3/style/mu/phil.dtx     |  8 +---
 fithesis3/style/mu/sci.dtx      |  8 +---
 fithesis3/test/Makefile         |  2 +
 fithesis3/test/base-10pt.tex    |  6 ++-
 fithesis3/test/base-11pt.tex    |  6 ++-
 fithesis3/test/base-12pt.tex    |  6 ++-
 fithesis3/test/base-utf8.tex    |  6 ++-
 fithesis3/test/econ-czech.tex   | 16 ++++---
 fithesis3/test/econ-english.tex | 16 ++++---
 fithesis3/test/econ-slovak.tex  | 16 ++++---
 fithesis3/test/econ-tables.tex  | 15 -------
 fithesis3/test/fi-color.tex     | 11 ++---
 fithesis3/test/fi-czech.tex     | 16 ++++---
 fithesis3/test/fi-english.tex   | 16 ++++---
 fithesis3/test/fi-female.tex    |  9 ++--
 fithesis3/test/fi-male.tex      |  9 ++--
 fithesis3/test/fi-rigorous.tex  |  9 ++--
 fithesis3/test/fi-slovak.tex    | 14 ++++--
 fithesis3/test/fi-tables.tex    | 15 -------
 fithesis3/test/fsps-czech.tex   | 14 ++++--
 fithesis3/test/fsps-english.tex | 14 ++++--
 fithesis3/test/fsps-slovak.tex  | 14 ++++--
 fithesis3/test/fsps-tables.tex  | 15 -------
 fithesis3/test/fss-czech.tex    | 14 ++++--
 fithesis3/test/fss-english.tex  | 14 ++++--
 fithesis3/test/fss-slovak.tex   | 14 ++++--
 fithesis3/test/fss-tables.tex   | 15 -------
 fithesis3/test/law-czech.tex    | 14 ++++--
 fithesis3/test/law-english.tex  | 14 ++++--
 fithesis3/test/law-slovak.tex   | 14 ++++--
 fithesis3/test/law-tables.tex   | 15 -------
 fithesis3/test/med-czech.tex    | 14 ++++--
 fithesis3/test/med-english.tex  | 14 ++++--
 fithesis3/test/med-slovak.tex   | 14 ++++--
 fithesis3/test/med-tables.tex   | 15 -------
 fithesis3/test/ped-czech.tex    | 14 ++++--
 fithesis3/test/ped-english.tex  | 14 ++++--
 fithesis3/test/ped-slovak.tex   | 14 ++++--
 fithesis3/test/ped-tables.tex   | 15 -------
 fithesis3/test/phil-czech.tex   | 14 ++++--
 fithesis3/test/phil-english.tex | 14 ++++--
 fithesis3/test/phil-slovak.tex  | 14 ++++--
 fithesis3/test/phil-tables.tex  | 15 -------
 fithesis3/test/sci-color.tex    | 10 +++--
 fithesis3/test/sci-czech.tex    | 14 ++++--
 fithesis3/test/sci-english.tex  | 14 ++++--
 fithesis3/test/sci-female.tex   | 14 ++++--
 fithesis3/test/sci-male.tex     | 14 ++++--
 fithesis3/test/sci-rigorous.tex | 14 ++++--
 fithesis3/test/sci-slovak.tex   | 14 ++++--
 pdflatex.tex                    | 31 +++++++++++++
 xelatex.tex                     | 31 +++++++++++++
 68 files changed, 492 insertions(+), 402 deletions(-)
 delete mode 100644 example.tex
 delete mode 100644 fithesis3/test/econ-tables.tex
 delete mode 100644 fithesis3/test/fi-tables.tex
 delete mode 100644 fithesis3/test/fsps-tables.tex
 delete mode 100644 fithesis3/test/fss-tables.tex
 delete mode 100644 fithesis3/test/law-tables.tex
 delete mode 100644 fithesis3/test/med-tables.tex
 delete mode 100644 fithesis3/test/ped-tables.tex
 delete mode 100644 fithesis3/test/phil-tables.tex
 create mode 100644 pdflatex.tex
 create mode 100644 xelatex.tex

diff --git a/Makefile b/Makefile
index 43cd1e0..2ec232f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,23 @@
 .PHONY: all clear
 all:
 	cd fithesis3 && make
-	make example.pdf clear
+	make pdflatex.pdf xelatex.pdf clear
 
-# This target typesets the example.
-example.pdf: example.tex
+# This target typesets the pdfLaTeX example.
+pdflatex.pdf: pdflatex.tex
 	pdflatex $<
 	pdflatex $<
 
+# This target typesets the XeLaTeX example.
+xelatex.pdf: xelatex.tex
+	xelatex $<
+	xelatex $<
+
 # This target removes any auxiliary files.
 clear:
-	rm -f example.aux example.log example.out \
-	  example.toc example.lot example.lof
+	rm -f *.aux *.log *.out *.toc *.lot *.lof
 
 # This target removes any auxiliary files
 # and the output PDF file.
 implode: clear
-	rm -f example.pdf
+	rm -f pdflatex.pdf xelatex.pdf
diff --git a/example.tex b/example.tex
deleted file mode 100644
index 6b389b8..0000000
--- a/example.tex
+++ /dev/null
@@ -1,6 +0,0 @@
-\documentclass[color,cover]{fithesis3/fithesis3}
-\usepackage[utf8]{inputenc}
-\usepackage[english]{babel}
-\begin{document}
-  Hello world!
-\end{document}
diff --git a/fithesis3/fithesis.dtx b/fithesis3/fithesis.dtx
index f0d65cb..24a4322 100644
--- a/fithesis3/fithesis.dtx
+++ b/fithesis3/fithesis.dtx
@@ -33,6 +33,7 @@
 \usepackage{tgpagella}
 \usepackage{tabularx}
 \usepackage{hologo}
+\usepackage{booktabs}
 \usepackage[scaled=0.86]{berasans}
 \usepackage[scaled=1.03]{inconsolata}
 \usepackage[resetfonts]{cmap}
@@ -381,12 +382,12 @@
 % \subsubsection{The \texttt{type} key}
 % The \marg{\texttt{type}=type} pair sets the type of the thesis
 % to \textit{type}. The following types of theses are recognized:
-% \begin{center}\begin{tabular}{lc}\hline
-%   The thesis type & The value of \textit{type} \\\hline
+% \begin{center}\begin{tabular}{lc}\toprule
+%   The thesis type & The value of \textit{type} \\\midrule
 %   Bachelor's thesis & \texttt{bc} \\
 %   Master's thesis & \texttt{mgr} \\
 %   Doctoral thesis & \texttt{d} \\
-%   Rigorous thesis & \texttt{r} \\\hline
+%   Rigorous thesis & \texttt{r} \\\bottomrule
 % \end{tabular}\end{center}
 % The \textit{type} is stored within the private |\thesis@type|
 % macro, whose implicit value is |b|. For the ease of testing of
@@ -430,8 +431,8 @@
 % The \marg{\texttt{faculty}=domain} pair sets the faculty, at
 % which the thesis is being written, to \textit{domain}. The
 % following \textit{domain} names are recognized:
-% \begin{center}\begin{tabularx}{\textwidth}{Xc}\hline
-%   The Faculty & The \textit{domain} name \\\hline
+% \begin{center}\begin{tabularx}{\textwidth}{Xc}\toprule
+%   The Faculty & The \textit{domain} name \\\midrule
 %   The Faculty of Informatics & \texttt{fi} \\
 %   The Faculty of Science & \texttt{sci} \\
 %   The Faculty of Law & \texttt{law} \\
@@ -440,7 +441,7 @@
 %   The Faculty of Medicine & \texttt{med} \\
 %   The Faculty of Education & \texttt{ped} \\
 %   The Faculty of Arts & \texttt{phil} \\
-%   The Faculty of Sports Studies & \texttt{fsps} \\\hline
+%   The Faculty of Sports Studies & \texttt{fsps} \\\bottomrule
 % \end{tabularx}\end{center}
 % The \textit{domain} name is stored within the private
 % |\thesis@faculty| macro, whose implicit value is \texttt{fi}.
@@ -588,10 +589,11 @@
 % The \marg{\texttt{locale}=filename} pair sets the filename of the
 % locale file(s) to be used to \textit{filename}. The
 % \textit{filename} is stored within the private |\thesis@locale|
-% macro, whose implicit value is the main language of the
-% \textsf{babel} package or \texttt{czech}, when undefined. If the
-% inheritance is disabled for locale files, the locale file is
-% loaded from the |\thesis@localepath\thesis@locale| path.
+% macro, whose implicit value is the main language of either the
+% \textsf{babel} or the \textsf{polyglossia} package, or
+% \texttt{czech}, when undefined. If the inheritance is disabled
+% for locale files, the locale file is loaded from the
+% |\thesis@localepath\thesis@locale| path.
 %    \begin{macrocode}
 \def\thesis@locale{%
   % Babel detection
diff --git a/fithesis3/locale/Makefile b/fithesis3/locale/Makefile
index 7af19dc..85fc194 100644
--- a/fithesis3/locale/Makefile
+++ b/fithesis3/locale/Makefile
@@ -10,7 +10,7 @@ all:
 explode: $(LOGS)
 
 %.log: %.ins %.dtx
-	tex $<
+	xetex $<
 
 implode:
 	rm -f $(OUTPUT) $(LOGS)
diff --git a/fithesis3/locale/czech.dtx b/fithesis3/locale/czech.dtx
index a5fa4b1..de0384a 100644
--- a/fithesis3/locale/czech.dtx
+++ b/fithesis3/locale/czech.dtx
@@ -198,9 +198,9 @@
 \def\thesis@czech@declaration{%
   Prohlašuji, že tato \thesis@lower{czech@typeName} je mým
   původním autorským dílem, které jsem vypracoval%
-  \thesis@czech@gender@koncovka samostatně. Všechny zdroje,
+  \thesis@czech@gender@koncovka\ samostatně. Všechny zdroje,
   prameny a literaturu, které jsem při vypracování
-  používal\thesis@czech@gender@koncovka nebo z~nich
+  používal\thesis@czech@gender@koncovka\ nebo z~nich
   čerpal\thesis@czech@gender@koncovka, v~práci řádně cituji
   s~uvedením úplného odkazu na příslušný zdroj.}
 
diff --git a/fithesis3/locale/slovak.dtx b/fithesis3/locale/slovak.dtx
index 6098eb9..f2e7e34 100644
--- a/fithesis3/locale/slovak.dtx
+++ b/fithesis3/locale/slovak.dtx
@@ -198,7 +198,7 @@
 \def\thesis@slovak@declaration{%
   Prehlasujem, že táto \thesis@lower{slovak@typeName} je mojím
   pôvodným autorským dielom, ktoré som vypracoval%
-  \thesis@slovak@gender@koncovka samostatne. Všetky zdroje,
+  \thesis@slovak@gender@koncovka\ samostatne. Všetky zdroje,
   pramene a literatúru, ktoré som pri vypracovaní
   používal\thesis@slovak@gender@koncovka\ alebo z~nich
   čerpal\thesis@slovak@gender@koncovka, v~práci riadne citujem
diff --git a/fithesis3/style/Makefile b/fithesis3/style/Makefile
index 1122fc6..900d695 100644
--- a/fithesis3/style/Makefile
+++ b/fithesis3/style/Makefile
@@ -7,7 +7,7 @@ all: explode
 explode: $(LOGS)
 
 %.log: %.ins %.dtx
-	tex $<
+	xetex $<
 
 implode:
 	rm -f $(OUTPUT) $(LOGS)
diff --git a/fithesis3/style/mu/Makefile b/fithesis3/style/mu/Makefile
index dbf7e2d..dc3740e 100644
--- a/fithesis3/style/mu/Makefile
+++ b/fithesis3/style/mu/Makefile
@@ -7,7 +7,7 @@ all: explode
 explode: $(LOGS)
 
 %.log: %.ins %.dtx
-	tex $<
+	xetex $<
 
 implode:
 	rm -f $(OUTPUT) $(LOGS)
diff --git a/fithesis3/style/mu/base.dtx b/fithesis3/style/mu/base.dtx
index 81ffcdb..6a2b2cc 100644
--- a/fithesis3/style/mu/base.dtx
+++ b/fithesis3/style/mu/base.dtx
@@ -86,15 +86,27 @@
 \ProcessOptions
 %    \end{macrocode}
 % The file loads the following packages: \begin{itemize}
-%   \item\textsf{fontenc} -- The font encoding is set to Cork.
+%   \item\textsf{xcolor} -- Adds support for color manipulation.
+%   \item\textsf{ifxetex} -- Used to detect the \Hologo{XeTeX}
+%     engine.
 %   \item\textsf{mathpazo} -- The virtual \texttt{mathpazo} fonts
-%     will be used for math.
-%   \item\textsf{colorx} -- Adds support for color manipulation.
+%     will be used for math. This package does not get loaded in
+%     \Hologo{XeTeX}.
 %   \item\textsf{tgpagella} -- Changes the default roman font family
-%     to \TeX\ Gyre Pagella.
+%     to \TeX\ Gyre Pagella. This package does not get loaded in
+%     \Hologo{XeTeX}.
 %   \item\textsf{cmap} -- Places an an explicit \texttt{ToUnicode}
 %     map in the resulting PDF file, allowing for extraction of
-%     the text of the document.
+%     the text of the document. This package does not get loaded
+%     under \Hologo{XeTeX}.
+%   \item\textsf{fontenc} -- The font encoding is set to Cork. This
+%     package does not get loaded under \Hologo{XeTeX}.
+%   \item\textsf{fontspec} -- Allows the selection of
+%     system-installed fonts. This package only gets loaded under
+%     \Hologo{XeTeX}.
+%   \item\textsf{fontspec} -- Allows the selection of
+%     system-installed mathematical fonts. This package only gets
+%     loaded under \Hologo{XeTeX}.
 %   \item\textsf{graphix} -- Adds support for the inclusion of
 %     graphics files.
 %   \item\textsf{pdfpages} -- Adds support for the injection of PDF
@@ -108,13 +120,23 @@
 % In addition to that, the \textsf{hyperref} package is configured
 % to support both roman and arabic page numbering in one document
 % and to decorate hyperlinks with an underline instead of a
-% rectangular box.
+% rectangular box. Under \Hologo{XeTeX}, the \textsf{TeX Gyre
+% Pagella} and \textsf{TeX Gyre Pagella Math} are selected as the
+% main text and math fonts.
 %    \begin{macrocode}
-\RequirePackage[resetfonts]{cmap}
-\RequirePackage[T1]{fontenc}
 \RequirePackage[usenames,dvipsnames,svgnames,table]{xcolor}
-\thesis@require{mathpazo}
-\thesis@require{tgpagella}
+\thesis@require{ifxetex}
+\ifxetex
+  \thesis@require{fontspec}
+  \thesis@require{unicode-math}
+  \setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
+  \setmathfont[math-style=ISO,bold-style=ISO,vargreek-shape=TeX]{TG Pagella Math}
+\else
+  \thesis@require{mathpazo}
+  \thesis@require{tgpagella}
+  \RequirePackage[resetfonts]{cmap}
+  \RequirePackage[T1]{fontenc}
+\fi
 \thesis@require{graphicx}
 \thesis@require{pdfpages}
 \thesis@require{hyperref}
@@ -125,26 +147,6 @@
   pdfpagelabels              % Generate pdf page labels
 }
 %    \end{macrocode}
-% \begin{macro}{\thesis@tabular}\begin{macro}{\thesis@endtabular}
-% \begin{macro}{\thesis@tabularx}\begin{macro}{\thesis@endtabularx}
-% The file defines the |thesis@tabular| and |thesis@tabularx|
-% environments, which can be used to typeset the |tabular| and
-% |tabularx| tables decorated with the colors specified within the
-% |\thesis@color@tableOdd| and |\thesis@color@tableEven| private
-% macros, if the \texttt{color} option is specified. In order to
-% use the |thesis@tabularx| environment, the user must manually
-% include the \textsf{tabularx} package.
-%    \begin{macrocode}
-\newenvironment{thesis@tabular}{%
-  \ifthesis@color@%
-    \rowcolors{1}{\thesis@color@tableOdd}{\thesis@color@tableEven}%
-  \fi\tabular}{\endtabular}
-\newenvironment{thesis@tabularx}{%
-  \ifthesis@color@%
-    \rowcolors{1}{\thesis@color@tableOdd}{\thesis@color@tableEven}%
-  \fi\tabularx}{\endtabularx}
-%    \end{macrocode}
-% \end{macro}\end{macro}\end{macro}\end{macro}
 % \begin{macro}{\thesis@color@setup}
 % The file defines the |\thesis@color@setup|\marg{colors} command,
 % where \textit{colors} is a comma-delimited list of key-value
@@ -162,28 +164,10 @@
 %   \item\marg{\texttt{links}=color} -- Sets the color of hyperref
 %     links to \textit{color}. The default color is specified by
 %     the \textsf{hyperref} package.
-%   \item\marg{\texttt{tableOdd}=color} -- Sets the color of the
-%     odd table rows within the \texttt{thesis@tabular} and
-%     \texttt{thesis@tabularx} environments to \textit{color}. The
-%     \textit{color} is stored within the
-%     \DescribeMacro{\thesis@color@tableOdd}%
-%     |\thesis@color@tableOdd| private macro.
-%   \item\marg{\texttt{tableEven}=color} -- Sets the color of the
-%     even table rows within the \texttt{thesis@tabular} and
-%     \texttt{thesis@tabularx} environments to \textit{color}. The
-%     \textit{color} is stored within the
-%     \DescribeMacro{\thesis@color@tableEven}%
-%     |\thesis@color@tableEven| private macro.
 % \end{enumerate}
 %    \begin{macrocode}
 \define@key{thesis@color}{links}{%
   \hypersetup{linkbordercolor=#1}}
-\def\thesis@color@tableOdd{white}
-\define@key{thesis@color}{tableOdd}{%
-  \def\thesis@color@tableOdd{#1}}
-\def\thesis@color@tableEven{white}
-\define@key{thesis@color}{tableEven}{%
-  \def\thesis@color@tableEven{#1}}
 %    \end{macrocode}
 % The file defines several blocks to be used in the redefinitions
 % of the |\thesis@preamble| and |\thesis@postable| private macros
diff --git a/fithesis3/style/mu/econ.dtx b/fithesis3/style/mu/econ.dtx
index 3e440dc..e78cb56 100644
--- a/fithesis3/style/mu/econ.dtx
+++ b/fithesis3/style/mu/econ.dtx
@@ -9,16 +9,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-econ}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{7C211E}
 \definecolor{thesis@color@facultylight}{HTML}{DAC1BF}
 \definecolor{thesis@color@facultyxlight}{HTML}{EFE4E3}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % English locale.
diff --git a/fithesis3/style/mu/fi.dtx b/fithesis3/style/mu/fi.dtx
index 367bfc0..976b616 100644
--- a/fithesis3/style/mu/fi.dtx
+++ b/fithesis3/style/mu/fi.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-fi}[2015/05/02]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{FFD451}
 \definecolor{thesis@color@facultylight}{HTML}{FFECB3}
 \definecolor{thesis@color@facultyxlight}{HTML}{FFF9E5}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % \begin{macro}{\thesis@blocks@titlePage}
 % The style file redefines the cover and title page footers to
diff --git a/fithesis3/style/mu/fsps.dtx b/fithesis3/style/mu/fsps.dtx
index 1b214ae..367f1d9 100644
--- a/fithesis3/style/mu/fsps.dtx
+++ b/fithesis3/style/mu/fsps.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-fss}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{0042BA}
 \definecolor{thesis@color@facultylight}{HTML}{BBC7DD}
 \definecolor{thesis@color@facultyxlight}{HTML}{E4E9F1}
-\thesis@color@setup{%
-  links=thesis@color@facultylight,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@facultylight}
 %    \end{macrocode}
 % The style file configures the title page header to include the
 % field name.
diff --git a/fithesis3/style/mu/fss.dtx b/fithesis3/style/mu/fss.dtx
index b0f6c8b..c12ecb9 100644
--- a/fithesis3/style/mu/fss.dtx
+++ b/fithesis3/style/mu/fss.dtx
@@ -17,16 +17,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-fss}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{007B69}
 \definecolor{thesis@color@facultylight}{HTML}{B8DAD5}
 \definecolor{thesis@color@facultyxlight}{HTML}{E3F1EE}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % English locale.
diff --git a/fithesis3/style/mu/law.dtx b/fithesis3/style/mu/law.dtx
index de86b70..4bf4026 100644
--- a/fithesis3/style/mu/law.dtx
+++ b/fithesis3/style/mu/law.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-law}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{80379B}
 \definecolor{thesis@color@facultylight}{HTML}{D3BADC}
 \definecolor{thesis@color@facultyxlight}{HTML}{F0E7F3}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % English locale.
diff --git a/fithesis3/style/mu/med.dtx b/fithesis3/style/mu/med.dtx
index 82dc472..314dba5 100644
--- a/fithesis3/style/mu/med.dtx
+++ b/fithesis3/style/mu/med.dtx
@@ -9,16 +9,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-med}[2015/04/27]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{F2532D}
 \definecolor{thesis@color@facultylight}{HTML}{FFBFC2}
 \definecolor{thesis@color@facultyxlight}{HTML}{FFE3E5}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % English locale.
diff --git a/fithesis3/style/mu/ped.dtx b/fithesis3/style/mu/ped.dtx
index 8c7ccee..dcaa76a 100644
--- a/fithesis3/style/mu/ped.dtx
+++ b/fithesis3/style/mu/ped.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-ped}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{FFA02F}
 \definecolor{thesis@color@facultylight}{HTML}{FFDEB7}
 \definecolor{thesis@color@facultyxlight}{HTML}{FFF1E0}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % English locale.
diff --git a/fithesis3/style/mu/phil.dtx b/fithesis3/style/mu/phil.dtx
index d0222f5..f95cac2 100644
--- a/fithesis3/style/mu/phil.dtx
+++ b/fithesis3/style/mu/phil.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-phil}[2015/04/26]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{00A1DE}
 \definecolor{thesis@color@facultylight}{HTML}{B8E4F5}
 \definecolor{thesis@color@facultyxlight}{HTML}{E0F3FA}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % The style file configures the title page header to include the
 % department and the field name.
diff --git a/fithesis3/style/mu/sci.dtx b/fithesis3/style/mu/sci.dtx
index 6554389..025720a 100644
--- a/fithesis3/style/mu/sci.dtx
+++ b/fithesis3/style/mu/sci.dtx
@@ -8,16 +8,12 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{fithesis3/style/mu/fithesis3-sci}[2015/05/02]
 %    \end{macrocode}
-% The file redefines the colors used within the |thesis@tabular|
-% and |thesis@tabularx| environments and with the hyperlinks.
+% The file defines the color used with the hyperlinks.
 %    \begin{macrocode}
 \definecolor{thesis@color@faculty}{HTML}{00AF3F}
 \definecolor{thesis@color@facultylight}{HTML}{B8E8C9}
 \definecolor{thesis@color@facultyxlight}{HTML}{E0F5E8}
-\thesis@color@setup{%
-  links=thesis@color@faculty,%
-  tableOdd=thesis@color@facultyxlight,%
-  tableEven=thesis@color@facultylight}
+\thesis@color@setup{links=thesis@color@faculty}
 %    \end{macrocode}
 % In addition to the main locale, the file also requires the
 % Czech and English locales.
diff --git a/fithesis3/test/Makefile b/fithesis3/test/Makefile
index 10d6007..249a3d3 100644
--- a/fithesis3/test/Makefile
+++ b/fithesis3/test/Makefile
@@ -4,6 +4,8 @@ all: clear
 		ln -s "$$file" current.tex && \
 		pdflatex current && \
 		pdflatex current && \
+		xelatex current && \
+		xelatex current && \
 		rm current.*; \
 	done
 
diff --git a/fithesis3/test/base-10pt.tex b/fithesis3/test/base-10pt.tex
index 1357eac..b5ad7e3 100644
--- a/fithesis3/test/base-10pt.tex
+++ b/fithesis3/test/base-10pt.tex
@@ -1,5 +1,9 @@
 \documentclass[10pt]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{basepath=..}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/base-11pt.tex b/fithesis3/test/base-11pt.tex
index 8380b9a..e2ee8eb 100644
--- a/fithesis3/test/base-11pt.tex
+++ b/fithesis3/test/base-11pt.tex
@@ -1,5 +1,9 @@
 \documentclass[11pt]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{basepath=..}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/base-12pt.tex b/fithesis3/test/base-12pt.tex
index 78b5faf..75dd0ad 100644
--- a/fithesis3/test/base-12pt.tex
+++ b/fithesis3/test/base-12pt.tex
@@ -1,5 +1,9 @@
 \documentclass[12pt]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{basepath=..}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/base-utf8.tex b/fithesis3/test/base-utf8.tex
index 8a156e6..32a4b7d 100644
--- a/fithesis3/test/base-utf8.tex
+++ b/fithesis3/test/base-utf8.tex
@@ -1,4 +1,8 @@
 \documentclass{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/econ-czech.tex b/fithesis3/test/econ-czech.tex
index b23559c..574b97b 100644
--- a/fithesis3/test/econ-czech.tex
+++ b/fithesis3/test/econ-czech.tex
@@ -1,9 +1,13 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
-\thesissetup{
-  basepath=..,
-  faculty=econ
-}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
+\thesissetup{basepath=.., faculty=econ}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/econ-english.tex b/fithesis3/test/econ-english.tex
index 527bb5f..62f2a22 100644
--- a/fithesis3/test/econ-english.tex
+++ b/fithesis3/test/econ-english.tex
@@ -1,9 +1,13 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
-\thesissetup{
-  basepath=..,
-  faculty=econ
-}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
+\thesissetup{basepath=.., faculty=econ}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/econ-slovak.tex b/fithesis3/test/econ-slovak.tex
index 4dd4fa2..389fcc6 100644
--- a/fithesis3/test/econ-slovak.tex
+++ b/fithesis3/test/econ-slovak.tex
@@ -1,9 +1,13 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
-\thesissetup{
-  basepath=..,
-  faculty=econ
-}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
+\thesissetup{basepath=.., faculty=econ}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/econ-tables.tex b/fithesis3/test/econ-tables.tex
deleted file mode 100644
index 68640ab..0000000
--- a/fithesis3/test/econ-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=econ
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/fi-color.tex b/fithesis3/test/fi-color.tex
index 64a0263..1ecc629 100644
--- a/fithesis3/test/fi-color.tex
+++ b/fithesis3/test/fi-color.tex
@@ -1,8 +1,9 @@
 \documentclass[color]{../fithesis3}
-\thesissetup{
-  basepath=..,
-  faculty=fi
-}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
+\thesissetup{basepath=.., faculty=fi}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-czech.tex b/fithesis3/test/fi-czech.tex
index e85d9ff..bf7af51 100644
--- a/fithesis3/test/fi-czech.tex
+++ b/fithesis3/test/fi-czech.tex
@@ -1,9 +1,13 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
-\thesissetup{
-  basepath=..,
-  faculty=fi
-}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
+\thesissetup{basepath=.., faculty=fi}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-english.tex b/fithesis3/test/fi-english.tex
index f6815bc..4cb5c6d 100644
--- a/fithesis3/test/fi-english.tex
+++ b/fithesis3/test/fi-english.tex
@@ -1,9 +1,13 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
-\thesissetup{
-  basepath=..,
-  faculty=fi
-}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
+\thesissetup{basepath=.., faculty=fi}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-female.tex b/fithesis3/test/fi-female.tex
index 1b35253..57668fe 100644
--- a/fithesis3/test/fi-female.tex
+++ b/fithesis3/test/fi-female.tex
@@ -1,9 +1,12 @@
 \documentclass[monochrome]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{
   basepath=..,
   faculty=fi,
-  gender=f
-}
+  gender=f}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-male.tex b/fithesis3/test/fi-male.tex
index 88fdc64..54b134c 100644
--- a/fithesis3/test/fi-male.tex
+++ b/fithesis3/test/fi-male.tex
@@ -1,9 +1,12 @@
 \documentclass[monochrome]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{
   basepath=..,
   faculty=fi,
-  gender=m
-}
+  gender=m}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-rigorous.tex b/fithesis3/test/fi-rigorous.tex
index 3198360..c140fa7 100644
--- a/fithesis3/test/fi-rigorous.tex
+++ b/fithesis3/test/fi-rigorous.tex
@@ -1,9 +1,12 @@
 \documentclass[monochrome]{../fithesis3}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{
   basepath=..,
   faculty=fi,
-  type=r
-}
+  type=r}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-slovak.tex b/fithesis3/test/fi-slovak.tex
index 0a08e20..02bd8c0 100644
--- a/fithesis3/test/fi-slovak.tex
+++ b/fithesis3/test/fi-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fi
-}
+  faculty=fi}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fi-tables.tex b/fithesis3/test/fi-tables.tex
deleted file mode 100644
index 314101b..0000000
--- a/fithesis3/test/fi-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=fi
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/fsps-czech.tex b/fithesis3/test/fsps-czech.tex
index 7e50095..0250cd6 100644
--- a/fithesis3/test/fsps-czech.tex
+++ b/fithesis3/test/fsps-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fsps
-}
+  faculty=fsps}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fsps-english.tex b/fithesis3/test/fsps-english.tex
index 52d539e..aa88919 100644
--- a/fithesis3/test/fsps-english.tex
+++ b/fithesis3/test/fsps-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fsps
-}
+  faculty=fsps}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fsps-slovak.tex b/fithesis3/test/fsps-slovak.tex
index 77cf858..704a45e 100644
--- a/fithesis3/test/fsps-slovak.tex
+++ b/fithesis3/test/fsps-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fsps
-}
+  faculty=fsps}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fsps-tables.tex b/fithesis3/test/fsps-tables.tex
deleted file mode 100644
index b869b54..0000000
--- a/fithesis3/test/fsps-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=fsps
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/fss-czech.tex b/fithesis3/test/fss-czech.tex
index 145169a..7eca7d1 100644
--- a/fithesis3/test/fss-czech.tex
+++ b/fithesis3/test/fss-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fss
-}
+  faculty=fss}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fss-english.tex b/fithesis3/test/fss-english.tex
index 57fe12a..4c82105 100644
--- a/fithesis3/test/fss-english.tex
+++ b/fithesis3/test/fss-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fss
-}
+  faculty=fss}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fss-slovak.tex b/fithesis3/test/fss-slovak.tex
index 94f959a..9581289 100644
--- a/fithesis3/test/fss-slovak.tex
+++ b/fithesis3/test/fss-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=fss
-}
+  faculty=fss}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/fss-tables.tex b/fithesis3/test/fss-tables.tex
deleted file mode 100644
index 379feca..0000000
--- a/fithesis3/test/fss-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=fss
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/law-czech.tex b/fithesis3/test/law-czech.tex
index ffae491..f084d75 100644
--- a/fithesis3/test/law-czech.tex
+++ b/fithesis3/test/law-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=law
-}
+  faculty=law}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/law-english.tex b/fithesis3/test/law-english.tex
index 463b387..e7be9be 100644
--- a/fithesis3/test/law-english.tex
+++ b/fithesis3/test/law-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=law
-}
+  faculty=law}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/law-slovak.tex b/fithesis3/test/law-slovak.tex
index 919a2c8..1e59cb9 100644
--- a/fithesis3/test/law-slovak.tex
+++ b/fithesis3/test/law-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=law
-}
+  faculty=law}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/law-tables.tex b/fithesis3/test/law-tables.tex
deleted file mode 100644
index e36c33c..0000000
--- a/fithesis3/test/law-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=law
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/med-czech.tex b/fithesis3/test/med-czech.tex
index 4fa2957..37404d1 100644
--- a/fithesis3/test/med-czech.tex
+++ b/fithesis3/test/med-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=med
-}
+  faculty=med}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/med-english.tex b/fithesis3/test/med-english.tex
index 547e348..079eda9 100644
--- a/fithesis3/test/med-english.tex
+++ b/fithesis3/test/med-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=med
-}
+  faculty=med}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/med-slovak.tex b/fithesis3/test/med-slovak.tex
index 1e7ba97..820dfd2 100644
--- a/fithesis3/test/med-slovak.tex
+++ b/fithesis3/test/med-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=med
-}
+  faculty=med}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/med-tables.tex b/fithesis3/test/med-tables.tex
deleted file mode 100644
index bf51d5f..0000000
--- a/fithesis3/test/med-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=med
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/ped-czech.tex b/fithesis3/test/ped-czech.tex
index eb6f490..284531f 100644
--- a/fithesis3/test/ped-czech.tex
+++ b/fithesis3/test/ped-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=ped
-}
+  faculty=ped}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/ped-english.tex b/fithesis3/test/ped-english.tex
index 43854d3..6f0dfd9 100644
--- a/fithesis3/test/ped-english.tex
+++ b/fithesis3/test/ped-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=ped
-}
+  faculty=ped}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/ped-slovak.tex b/fithesis3/test/ped-slovak.tex
index a647712..12e822a 100644
--- a/fithesis3/test/ped-slovak.tex
+++ b/fithesis3/test/ped-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=ped
-}
+  faculty=ped}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/ped-tables.tex b/fithesis3/test/ped-tables.tex
deleted file mode 100644
index 7ccc86d..0000000
--- a/fithesis3/test/ped-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=ped
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/phil-czech.tex b/fithesis3/test/phil-czech.tex
index fea31d8..005ef7a 100644
--- a/fithesis3/test/phil-czech.tex
+++ b/fithesis3/test/phil-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=phil
-}
+  faculty=phil}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/phil-english.tex b/fithesis3/test/phil-english.tex
index 1a84a83..fc94fdf 100644
--- a/fithesis3/test/phil-english.tex
+++ b/fithesis3/test/phil-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=phil
-}
+  faculty=phil}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/phil-slovak.tex b/fithesis3/test/phil-slovak.tex
index 822fecc..09d0306 100644
--- a/fithesis3/test/phil-slovak.tex
+++ b/fithesis3/test/phil-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=phil
-}
+  faculty=phil}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/phil-tables.tex b/fithesis3/test/phil-tables.tex
deleted file mode 100644
index a1ab21f..0000000
--- a/fithesis3/test/phil-tables.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\documentclass[color]{../fithesis3}
-\usepackage[english]{babel}
-\usepackage{tabularx}
-\thesissetup{
-  basepath=..,
-  faculty=phil
-}
-\begin{document}
-  \begin{thesis@tabular}{cc}
-    a&b\\c&d
-  \end{thesis@tabular}
-  \begin{thesis@tabularx}{\textwidth}{cc}
-    a&b\\c&d
-  \end{thesis@tabularx}
-\end{document}
diff --git a/fithesis3/test/sci-color.tex b/fithesis3/test/sci-color.tex
index 1144532..9503071 100644
--- a/fithesis3/test/sci-color.tex
+++ b/fithesis3/test/sci-color.tex
@@ -1,9 +1,11 @@
 \documentclass[color]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex\else
+  \usepackage[utf8]{inputenc}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-czech.tex b/fithesis3/test/sci-czech.tex
index 75f608b..14f257f 100644
--- a/fithesis3/test/sci-czech.tex
+++ b/fithesis3/test/sci-czech.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[czech]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{czech}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[czech]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-english.tex b/fithesis3/test/sci-english.tex
index 4b552ac..c86ab4f 100644
--- a/fithesis3/test/sci-english.tex
+++ b/fithesis3/test/sci-english.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[english]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{english}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[english]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-female.tex b/fithesis3/test/sci-female.tex
index fa97c62..4922b64 100644
--- a/fithesis3/test/sci-female.tex
+++ b/fithesis3/test/sci-female.tex
@@ -1,10 +1,16 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
   gender=f,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-male.tex b/fithesis3/test/sci-male.tex
index e2117b5..672b651 100644
--- a/fithesis3/test/sci-male.tex
+++ b/fithesis3/test/sci-male.tex
@@ -1,10 +1,16 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
   gender=m,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-rigorous.tex b/fithesis3/test/sci-rigorous.tex
index 6a1475d..aff5283 100644
--- a/fithesis3/test/sci-rigorous.tex
+++ b/fithesis3/test/sci-rigorous.tex
@@ -1,10 +1,16 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
   type=r,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/fithesis3/test/sci-slovak.tex b/fithesis3/test/sci-slovak.tex
index 708708b..e810b3e 100644
--- a/fithesis3/test/sci-slovak.tex
+++ b/fithesis3/test/sci-slovak.tex
@@ -1,9 +1,15 @@
 \documentclass[monochrome]{../fithesis3}
-\usepackage[slovak]{babel}
+\usepackage{ifxetex}
+\ifxetex
+  \usepackage{polyglossia}
+  \setmainlanguage{slovak}
+\else
+  \usepackage[utf8]{inputenc}
+  \usepackage[slovak]{babel}
+\fi
 \thesissetup{
   basepath=..,
-  faculty=sci
-}
+  faculty=sci}
 \begin{document}
   foo bar
-\end{document}
\ No newline at end of file
+\end{document}
diff --git a/pdflatex.tex b/pdflatex.tex
new file mode 100644
index 0000000..a177fe7
--- /dev/null
+++ b/pdflatex.tex
@@ -0,0 +1,31 @@
+\documentclass[color,cover]{fithesis3/fithesis3}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{babel}
+\usepackage{amsmath}
+\usepackage{tabularx}
+\usepackage{booktabs}
+\begin{document}
+  \chapter{Foo bar}
+  Hello world!
+  \begin{equation}
+    \tag{Mass–energy equivalence} e=mc^2
+  \end{equation}
+  \begin{center}
+    \begin{tabularx}{\textwidth}{lllX}
+    \toprule
+    Day & Min Temp & Max Temp & Summary \\
+    \midrule
+    Monday & $11^{\circ}\mathrm{C}$ & $22^\circ$C & A clear day
+    with lots of sunshine. However, the strong breeze will bring
+    down the temperatures. \\
+    Tuesday & $9^{\circ}\mathrm{C}$ & $19^\circ$C & Cloudy with
+    rain, across many northern regions. Clear spells across most of
+    Scotland and Northern Ireland, but rain reaching the far
+    northwest. \\
+    Wednesday & $10^{\circ}\mathrm{C}$ & $21^\circ$C & Rain will
+    still linger for the morning. Conditions will improve by early
+    afternoon and continue throughout the evening.\\
+    \bottomrule
+    \end{tabularx}
+  \end{center}
+\end{document}
diff --git a/xelatex.tex b/xelatex.tex
new file mode 100644
index 0000000..cb1f313
--- /dev/null
+++ b/xelatex.tex
@@ -0,0 +1,31 @@
+\documentclass[color,cover]{fithesis3/fithesis3}
+\usepackage{polyglossia}
+\setmainlanguage{english}
+\usepackage{amsmath}
+\usepackage{tabularx}
+\usepackage{booktabs}
+\begin{document}
+  \chapter{Foo bar}
+  Hello world!
+  \begin{equation}
+    \tag{Mass–energy equivalence} e=mc^2
+  \end{equation}
+  \begin{center}
+    \begin{tabularx}{\textwidth}{lllX}
+    \toprule
+    Day & Min Temp & Max Temp & Summary \\
+    \midrule
+    Monday & $11^{\circ}\mathrm{C}$ & $22^\circ$C & A clear day
+    with lots of sunshine. However, the strong breeze will bring
+    down the temperatures. \\
+    Tuesday & $9^{\circ}\mathrm{C}$ & $19^\circ$C & Cloudy with
+    rain, across many northern regions. Clear spells across most of
+    Scotland and Northern Ireland, but rain reaching the far
+    northwest. \\
+    Wednesday & $10^{\circ}\mathrm{C}$ & $21^\circ$C & Rain will
+    still linger for the morning. Conditions will improve by early
+    afternoon and continue throughout the evening.\\
+    \bottomrule
+    \end{tabularx}
+  \end{center}
+\end{document}
-- 
GitLab