Newer
Older
% \iffalse\begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc} % this file uses UTF-8
\usepackage[english]{babel}
\usepackage{tgpagella}
\usepackage{tabularx}
\usepackage[scaled=0.86]{berasans}
\usepackage[scaled=1.03]{inconsolata}
\usepackage[resetfonts]{cmap}
\usepackage[T1]{fontenc} % use 8bit fonts
\emergencystretch 2dd
\usepackage{hypdoc}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{multicol}
% Making paragraphs numbered
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-2.5ex\@plus -1ex \@minus -.25ex}%
{1.25ex \@plus .25ex}%
{\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign
\setcounter{tocdepth}{4} % how many sectioning levels to show
% ltxdoc class options
\CodelineIndex
\MakeShortVerb{|}
\EnableCrossrefs
\DoNotIndex{}
\makeatletter
\c@IndexColumns=2
\c@GlossaryColumns=2
\makeatother
\begin{document}
\RecordChanges
\DocInput{fithesis.dtx}
\PrintIndex
\PrintChanges
\end{document}
%</driver>
% \end{macrocode}
%<*class>
\NeedsTeXFormat{LaTeX2e}
% Define `\thesis@version` and store it in the `VERSION.tex` file \fi
{\def\thesis@versiondef#1#2{
\gdef\thesis@version@number{#1}
\gdef\thesis@version@date{#2}
\gdef\thesis@version{#2 #1 fithesis3 MU thesis class}}
\thesis@versiondef{v0.3.37}{2016/04/12}}
% {\newwrite\f\openout\f=VERSION\write\f{\thesis@version}\closeout\f}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \changes{v0.3.37} {2016/04/12}{The \cs{tableofcontents} in the
% style files of the Masaryk University in Brno now correctly
% handles all tocdepth values. The expansion of \cs{part} also no
% longer results in a \textsf{hyperref}-related error in the
% style files of the Masaryk University in Brno.}
% \changes{v0.3.36} {2016/03/26}{The \cs{thesis@load} macro has
% been lifted to the public API as \cs{thesisload}.}
% \changes{v0.3.35:3}{2016/03/23}{Fixed \cs{l@}\textit{locale}
% being possibly undefined in a LuaLaTeX run.}
% \changes{v0.3.35:2}{2016/03/22}{Added support for seminar papers
% on the \textsf{fithesis3} class level. The style files for the
% faculties of the Masaryk University in Brno do not provide any
% special handling of this thesis type yet.}
% \changes{v0.3.35:1}{2016/03/22}{Added support for the Division of
% Information and Library Studies of the Faculty of Arts at the
% Masaryk University in Brno. This support is enabled by
% specifying \cs{thesis@department} to be \texttt{kisk}.}
% \changes{v0.3.34} {2016/02/24}{Added visual tests of output
% PDFs. The \texttt{test/} directory is now also uses the
% \textit{university}\texttt{/}\textit{faculty} path scheme
% employed by the rest of the package.}
% \changes{v0.3.33} {2016/02/19}{Added \cs{thesis@patch}.}
% \changes{v0.3.32} {2016/02/18}{Fixed a regression from
% v0.3.27:2 -- The margins in \cs{thesis@blocks@mainMatter} were
% corrected in the style files of the Faculty of Economics and
% Administration and the Faculty of Medicine at the Masaryk
% University in Brno.}
% \changes{v0.3.31:3}{2016/01/13}{The
% \texttt{style/mu/fithesis-sci.sty} style file redefines
% \cs{thesis@blocks}\texttt{\discretionary{@}{@}{@}declaration}
% to include a formatted date and an author's signature field.
% The locale file \texttt{style/mu/sci/czech.def} contains a new
% string \cs{thesis@czech\discretionary{@}{@}{@}formattedDate}.
% [VN]}
% \changes{v0.3.31:2}{2016/01/07}{All trailing \texttt{\%}s were
% removed. Some of the inherited \textsf{fithesis2} code in the
% \texttt{style/mu/fithesis-1*.clo} and
% \texttt{style/mu/fithesis-base.sty} files was refactored and
% reformatted. Alternative templates for the Faculty of Science
% at the Masaryk University in Brno are now mentioned in the
% respective user guide. [VN]}
% \changes{v0.3.31:1}{2016/01/07}{The redefinitions of
% \cs{appendix} from the
% \texttt{style/mu\discretionary{/}{/}{/}fithesis-1*.clo} files,
% which broke hyperref links to appendices, were removed. [VN]}
% \changes{v0.3.30} {2016/01/05}{The \cs{thesis@seasonYear} macro
% has been added, which, unlike \cs{thesis@year} takes into
% account the fact that January and Fabruary of the year $n$
% still belong to the fall semester of the year $n-1$. [VN]}
% \changes{v0.3.29:3}{2015/12/09}{The \texttt{table} class option
% for the style files of the Masaryk University in Brno now loads
% all the required packages and changes the table measurements
% even when the \texttt{color} option is not specified. [VN]}
% \changes{v0.3.29:2}{2015/12/09}{The \texttt{printed} and
% \texttt{digital} class options, which set all the options
% appropriate for either the printed or the digital versions of a
% document, are now available for the style files of the Masaryk
% University in Brno. [VN]}
% \changes{v0.3.29:1}{2015/12/08}{The initial pages of the styles
% of the Masaryk University in Brno are no longer page-numbered,
% so that hyperref links work correctly. [VN]}
% \changes{v0.3.28:2}{2015/12/03}{If the thesis locale and the
% document locale is the same (the default behaviour), the
% \cs{thesis@selectLocale} macro is applied globally at the
% beginning of the document. As a result, the \textsf{csquotes}
% style is automatically set for the entire document. [VN]}
% \changes{v0.3.28:1}{2015/12/02}{The \texttt{draft} option has no
% longer an effect on the \textsf{microtype} package. The
% \cs{thesis@require} command now also takes an optional
% argument and the \cs{thesis@require\-WithOption} command has
% become \cs{thesis@require\-IfExists}. [VN]}
% \changes{v0.3.27:5}{2015/11/30}{The PDF bookmarks are no longer
% garbled, when the \Hologo{LuaTeX} engine is used. [VN]}
% \changes{v0.3.27:4}{2015/11/30}{\cs{thesis@english@declaration}
% now uses the correct idiom (by one's own $\to$ on
% one's own). [VN]}
% \changes{v0.3.27:3}{2015/11/29}{As a preparation for the future
% inclusion of bibliography support, the \textsf{csquotes}
% package is loaded, \texttt{@csquotesStyle} is a new part of
% the locale interface that sets the \textsf{csquotes} style
% of a locale, and \cs{thesis@selectLocale} now switches the
% \textsf{csquotes} style. [VN]}
% \changes{v0.3.27:2}{2015/11/29}{\cs{thesis@selectLocale} is no
% longer performed globally for the entire document during
% \cs{thesis@load} (effectively overriding the user's hyphenation
% settings, if Babel's or Polyglossia's \cs{languagename}
% differs from \cs{thesis@locale}). Instead, \cs{thesis@preamble}
% and \texttt{@postamble} now locally switch the locale and
% expand \cs{thesis@blocks@preamble} and \texttt{@postamble},
% which are the new redefinables. Since this breaks the behaviour
% of \cs{thesis@blocks@mainMatter}, whose effects would also be
% local, \texttt{@mainMatter} is now executed directly by
% \cs{thesis@preamble} after closing the group and becomes a new
% part of the interface between the class and the style files.
% [VN]}
% \changes{v0.3.27:1}{2015/11/29}{Fixed a typo in the guide.
% Added a compatibility layer for \cs{title}, \cs{author}, and
% \cs{maketitle}. Minor changes of the documentation. [VN]}
% \changes{v0.3.26} {2015/11/21}{Updated the example documents and
% the user guide. Fixed a typo in the description of
% \cs{thesis@season}. [VN]}
% \changes{v0.3.25} {2015/11/20}{The example documents from the
% \texttt{example} directory are now a part of the CTAN archive.
% Additional information were inserted into the guide and to the
% example files. [VN]}
% \changes{v0.3.24} {2015/11/17}{Added the \cs{thesis@backend}
% tunable. The hyphenation pattern switching now uses
% \textsf{polyglossia} instead of crude \cs{language} switching
% wherenever possible. Added the opt-out \texttt{microtype}
% class option, which loads the microtypographic extension. The
% \cs{thesis@}\textit{locale}\texttt{@summer} and
% \texttt{@winter} locale macros were renamed to \texttt{@spring}
% and \texttt{@fall}. The \cs{thesis@parseDate} now uses more
% realistic month ranges to set \cs{thesis@season} and
% \cs{thesis@academicYear}. Removed the extraneous indent in the
% \cs{thesis@blocks@declaration} macro definition within the
% \texttt{style/mu/fithesis-fi.sty} style file. \cs{paragraph}s
% are not included in the table of contents by default. The
% \texttt{table} class option now supports the \texttt{tabu}
% environment. The list of tables and the list of figures now
% have an entry in the table of contents for the
% \texttt{style/mu/fithesis-econ.sty} style file. [VN]}
% \changes{v0.3.23} {2015/10/14}{Fixed a typo in the Slovak
% locale. [VN]}
% \changes{v0.3.22} {2015/10/09}{Updated the link colors in the
% style of the Faculty of Economics and Administration at the
% Masaryk University in Brno and fixed the title page leading
% in the style of the Faculty of Science at the Masaryk
% University in Brno. [VN]}
% \changes{v0.3.21} {2015/08/26}{Fixed an invalid font name. [VN]}
% \changes{v0.3.20} {2015/07/07}{Removed an extraneous
% \cs{hypersetup} option to eliminate a warning. Performed
% several minor Makefile updates. Updated the technical
% \changes{v0.3.19} {2015/06/27}{Updated the license. Added the
% \texttt{fithesis-} prefix to locale files. Proof-read and
% updated the documentation. Encapsulated the
% \texttt{localeInheritance} and \texttt{styleInheritance}
% setters. Added the \cs{thesis@selectLocale}\texttt{\{...\}},
% which acts as a replacement for
% \cs{def}\cs{thesis@locale}\texttt{\{...\}}, which also switches
% hyphenation patterns. The macro definitions inside locale files
% are now global to account for the fact that it now makes sense
% to include locale files on-site (and therefore possibly inside
% a group) using the \cs{thesis@selectLocale}. The class files
% are now generated using the XeTeX engine, which
% preserves the characters outside ASCII. [VN]}
% \changes{v0.3.18} {2015/06/24}{A bulk of changes required to submit
% the document class to CTAN: Changed the structure of the output
% \texttt{fithesis3.ctan.zip} archive. Updated the license
% notice. Added a \texttt{README} file. Canonicalized a url
% within the user guides. Renamed the root directory from
% \texttt{fithesis3/} to \texttt{fithesis/}. Refactored the
% makefiles. Added developer example files. Renamed
% \texttt{docstrip.cfg} to \texttt{LICENSE.tex} to better
% describe its role. The \texttt{fithesis.dtx} file now
% generates a \texttt{VERSION.tex} file containing the version of
% the package, when it's being typeset. Flattened the
% \texttt{logo/} directory structure. [VN]}
% \changes{v0.3.17} {2015/06/24}{Changed a forgotten
% \cs{thesis@@lower}\texttt{\{...\}} invocation in the definition
% of \cs{thesis@czech@declaration} for the Faculty of Arts into
% \cs{thesis@@lower}\texttt{\{czech@...\}}, so that the macro
% always expands to the correct output regardless of the current
% locale. This is merely a matter of consistency, since the style
% file of the Faculty of Arts only uses Czech strings within the
% Czech locale. Removed an extraneous comment. Fixed a unit test.
% Fixed a changelog entry. [VN]}
% \changes{v0.3.16} {2015/06/21}{Clubs and widows are now set to
% be infinitely bad. The \texttt{assignment} key has weaker, but
% \changes{v0.3.15} {2015/06/14}{Renamed \cs{thesis@requireStyle}
% to \cs{thesis@requireWithOptions} and moved the style loader
% from the \cs{thesis@load} routine to a new
% \cs{thesis@requireStyle} macro to make the semantics of
% \cs{thesis@requireLocale} and \cs{thesis@requireStyle} more
% similar. Changed the \texttt{basepath}, \texttt{logopath},
% \texttt{localepath} and \texttt{stylepath} keys to match the
% lower camelcasing of the rest of the keys. Added further
% description regarding the use of the \texttt{assignment} key.
% [VN]}
% \changes{v0.3.14} {2015/06/07}{Updated the documentation. [VN]}
% \changes{v0.3.13} {2015/05/30}{Fixed an inconsistency in the
% example code. Removed an extraneous \cs{thesis@blocks@clear}
% block withing the definition of \cs{thesis@blocks@frontMatter}
% in the fss style file. Added comments, fixed clubs and widows
% and removed text overflows within the user guides. Adjusted the
% colors of various style files. Removed the trailing dot in the
% bibliographic identification within the med and ped style
% files. Fixed a typo within the technical documentation. Fixed
% the twoside alignment of the \cs{thesis@blocks@bibEntry} and
% the \cs{thesis@blocks@bibEntryEn} blocks within the sci style
% file. The \cs{thesis@blocks@assignment} block no longer clears
% a page when nothing is inserted. It is also no longer
% hard-coded to be hidden for rigorous theses. Instead, the
% \cs{ifthesis@blocks@assignment} conditional can be set either
% by the subsequently loaded style files or by the user. So far,
% only the fi and sci style files set the conditional. [VN]}
% subsubsections now use the correct \texttt{tocdepth}. [VN]}
% \changes{v0.3.11} {2015/05/15}{Added hyphenation into the
% technical documentation. Fixed an unterminated group. Polished
% the text of the guide. Added the \texttt{palatino} and
% \texttt{nopalatino} options. Stylistic changes to the text of
% the technical documentation. \cs{thesis@subdir} is now robust
% against relative paths. Accounted for French spacing in the
% guide. Fixed the \texttt{thesis@english@facultyName} string.
% \changes{v0.3.10} {2015/05/09}{Fixed a typo in the technical
% documentation. Updated the \emph{Advanced usage} chapter of the
% user guide. The required packaged listed in Section 2.2 of the
% user guide are now always correct. Adjusted the footer spacing
% in the styles of econ and fi. Added \emph{Advanced usage}
% chapter to the user guide. Added the description of basic
% options into the user guide. Added the \texttt{table} and
% \texttt{oldtable} options. Added the \texttt{type} field to the
% guide for completeness. [VN]}
% \changes{v0.3.09} {2015/04/26}{A complete refactoring of the class. The class
% was decomposed into a base class, locale files and style files. [VN]}
% \changes{v0.3.08} {2015/03/04}{Fixed a non-terminated \cs{if} condition.
% [VN] (backport of v0.2.18)\\Fixed mostly documentation errors reported
% at the new fithesis discussion forum (-ti, eco$\to$econ, implicit
% twocolumn, example extended (font setup), etc.). [PS] (backport of v0.2.17)}
% \changes{v0.3.07} {2015/02/03}{Replaced the \cs{thesiswoman} command with
% \cs{thesisgender}. [VN]}
% \changes{v0.3.06} {2015/01/26}{Added the colorx package and the base colors
% for each faculty. If the color option is specified, the tabular environment
% gets redefined and uses the faculty colors to color alternating table rows
% to improve readability. The hyperref links in the e-version are now likewise
% colored according to the chosen faculty, in this case regardless of the
% presence of the color option. Dropped the support for typesetting theses
% outside MU. [VN]}
% \changes{v0.3.05} {2015/01/21}{Added support for change typesetting.
% Restructured the code to make it more amenable to literal programming.
% Added support for \cs{CodelineIndex} typesetting. Added information about
% the usage of \textsf{fithesis1} and \textsf{fithesis2} on the FI unix
% machines. (backport of v0.2.16) [VN] Minor changes throughout the text,
% added a link to the the fithesis forums [PS] (backport of v0.2.15@r14:15)}
% \changes{v0.3.04} {2015/01/14}{Import the url package to allow for the use of
% \cs{url} within the documentation. (backport of v0.2.15@r13) [VN]}
% \changes{v0.3.03} {2015/01/14}{Small fixes (added \cs{relax} at
% \cs{MainMatter}), generating both fithesis.cls (obsolete, loading
% \texttt{fithesis2.cls}) and \texttt{fithesis2.cls}, minor doc edits,
% version numbering of \texttt{.clo} fixed, switch to utf8 and ensuring that
% \texttt{.dtx} compiles. Documentation adjusted to the status quo, added
% link to discussion forum (backport of v0.2.14) [PS]}
% \changes{v0.3.02} {2015/01/13}{PDF metadata stamping added for
% \cs{thesistitle} and \cs{thesisstudent} [VN]}
% \changes{v0.3.01} {2015/01/09}{documentation now uses babel and cmap
% packages. the entire file was transcoded into utf8, \cs{thesiscolor} was
% replaced by color class option, added PDF metadata stamping support [VN]}
% \changes{v0.3.00} {2015/01/01}{fi logo is no longer special-cased (added eps
% and PDF), \cs{thesislogopath} added to set the logo directory path,
% \cs{thesiscolor} added to enable colorful typo elements [VN]}
% \changes{v0.2.12a}{2008--2011}{fork fithesis2 by Mr. Filipčík and Janoušek;
% cf. \protect\url{http://github.com/liskin/fithesis}}
% \changes{v0.2.12} {2008/07/27}{Licence change to the LPPL [JP]}
% \changes{v0.2.11} {2008/01/07}{fix missing \texttt{fi-logo.mf} [JP,PS]}
% \changes{v0.2.10} {2006/05/12}{fix EN name of Acknowledgement [JP]}
% \changes{v0.2.09} {2006/05/08}{add EN version of University name [JP]}
% \changes{v0.2.08} {2006/01/20}{add change of University name [JP]}
% \changes{v0.2.07} {2005/05/10}{escape all Czech letters [JP]
% babel is used instead of stupid package czech [JP]
% \cs{MainMatter} should be placed after \cs{tablesofcontents} [PS]}
% \changes{v0.2.06} {2004/12/22}{fix : behind Advisor [JP]}
% \changes{v0.2.05} {2004/05/13}{add English abstract [JP]}
% \changes{v0.2.04} {2004/05/13}{fix SK declaration [Peter Cerensky, JP]}
% \changes{v0.2.03} {2004/05/13}{fix title spacing [PS, JP]}
% \changes{v0.2.02} {2004/05/12}{fix encoding bug [JP]}
% \changes{v0.2.01} {2004/05/11}{add subsubsection to toc [JP]}
% \changes{v0.2.00} {2004/05/03}{add sk lang [JP, Peter Cerensky]
% set default cls class to \textsf{rapport3} [JP]}
% \changes{v0.1g} {2004/04/01}{change of default size (12pt$\to$11pt) [JP]}
% \changes{v0.1f} {2004/01/24}{add documentation for hyperref [JP]}
% \changes{v0.1e} {2004/01/07}{add Brno to MU title [JP]}
% \changes{v0.1d} {2003/03/24}{removed def schapter from fit1*.clo [JP]}
% \changes{v0.1c} {2003/02/21}{default values of \cs{facultyname} and
% \\\cs{@thesissubtitle} set for backward compatibility) [PS]}
% \changes{v0.1b} {2003/02/14}{change of default size (11pt$\to$12pt) [JP]}
% \changes{v0.1a} {2003/02/12}{minor documentation changes (CZ only,
% sorry) [PS]}
% \changes{v0.1} {2003/02/11}{new release, documentation editing (CZ only,
% sorry) [PS]}
% \changes{v0.0a} {2002}{changes by Jan Pavlovič to allow fithesis being
% backend of docbook based system for thesis writing}
% \changes{v0.0} {1998}{bachelor project of Daniel Marek under
% supervision of Petr Sojka}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \title{The \textsf{fithesis3} class for the typesetting of theses written
% \author{Daniel Marek, Jan Pavlovič, Vít Novotný, Petr Sojka}
% \date{\today}
% \maketitle
%
% \begin{abstract}
% \noindent This document details the design and the implementation
% of the \textsf{fithesis3} document class. It contains technical
% information for anyone who wishes to extend the class with their
% locale or style files. Users who only wish to use the class are
% advised to consult the guides distributed along with the class,
% which only document the parts of the public API relevant to the
% given style files.
% \end{abstract}
%
% \tableofcontents
%
% \section{Required classes and packages}
% \begin{macro}{\thesis@backend}
% The class requires the class specified in |\thesis@backend|,
% whose default value is |[a4paper]{rapport3}|. If a different
% base class is desired, it can be specified by redefining
% |\thesis@backend| prior to loading the \textsf{fithesis3} class.
% \begin{macrocode}
\ProvidesClass{fithesis3}[\thesis@version]
\ifx\thesis@backend\undefined
\def\thesis@backend{[a4paper]{rapport3}}
\fi\expandafter\LoadClass\thesis@backend
% \end{macrocode}
% \end{macro}
% The class also requires the following packages:
% \begin{itemize}
% \item\textsf{keyval} -- Adds support for parsing
% comma-delimited lists of key-value pairs.
% \item\textsf{etoolbox} -- Adds support for expanding
% code after the preamble using the |\AtPreamble| hook.
% \item\textsf{ltxcmds} -- Implements several commands from
% the \LaTeX\ kernel. Used for the |\ltx@ifpackageloaded|
% command, which -- unlike its |\@ifpackageloaded| counterpart
% -- can be used outside 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
% the \Hologo{XeTeX} and \Hologo{LuaTeX} engines.
% The \texttt{hyperref} package is also conditionally loaded during
% the expansion of the |\thesis@load| macro (see Section
% \ref{sec:thesisload}). Other packages may be required by the
% style files (see Section \ref{sec:style-files}) you are using.
\RequirePackage{keyval}
\RequirePackage{etoolbox}
\RequirePackage{ltxcmds}
\RequirePackage{ifluatex}
\ifxetex\else\ifluatex\else
% \end{macrocode}
% \section{Public API}
% \label{sec:public-api}
% \subsection{Options}
% Any \oarg{options} passed to the class will be handed down to the
% loaded style files. The supported options are therefore documented
% in the subsections of Section \ref{sec:style-files} dedicated to
% the respective style files. At the moment, all options are
% processed by the \texttt{style/mu/fithesis-base.sty} style file
% documented in Section \ref{sec:fithesis-mu-base}.
% \subsection{The \cs{thesissetup} macro}
% \begin{macro}{\thesissetup}
% The main public macro is the |\thesissetup|\marg{keyvals}
% command, where \textit{keyvals} is a comma-delimited list of
% key-value pairs as defined by the \textsf{keyval} package. This
% macro needs to be included prior to the beginning of a \LaTeX\
% document. When used, the \textit{keyvals} are processed.
% Note that the values passed to the |\thesissetup| public macro
% may only contain one paragraph of text. If you wish to set
% multiple paragraphs of text as the value, you need to use
% the |\thesislong| public macro (see Section
% \ref{sec:thesislong}).
% \begin{macrocode}
\def\thesissetup#1{%
% \subsubsection{The \texttt{basePath} key}
% \begin{macro}{\thesis@basepath}
% The \marg{\texttt{basePath}=path} pair sets the \textit{path}
% containing the class files. The \textit{path} is prepended to
% every other path (|\thesis@logopath|, |\thesis@stylepath| and
% |\thesis@localepath|) used by the class. If non-empty, the
% \textit{path} gets normalized to \textit{path/}. The normalized
% \textit{path} is stored within the |\thesis@basepath| macro,
% whose implicit value is |fithesis/|.
\def\thesis@basepath{fithesis/}
\define@key{thesis}{basePath}{%
\ifx\thesis@empty#1\thesis@empty
\else
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@logopath}
% \subsubsection{The \texttt{logoPath} key}
% The \marg{\texttt{logoPath}=path} pair sets the \textit{path}
% containing the logo files, which is used by the style files to
% load the university and faculty logos. The \textit{path} is
% normalized using the |\thesis@subdir| macro and stored
% within the |\thesis@logopath| macro, whose implicit value
% is |\thesis@basepath| followed by |logo/\thesis@university/|. By
% default, this expands to \texttt{fithesis/logo/mu/}.
% \begin{macrocode}
\def\thesis@logopath{\thesis@basepath logo/\thesis@university/}
\define@key{thesis}{logoPath}{%
\def\thesis@logopath{\thesis@subdir#1%
\empty\empty\empty\empty}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@stylepath}
% \subsubsection{The \texttt{stylePath} key}
% The \marg{\texttt{stylePath}=path} pair sets the \textit{path}
% containing the style files. The \textit{path} is normalized using
% the |\thesis@subdir| macro and stored within the
% |\thesis@stylepath| macro, whose implicit value is
% |\thesis@basepath style/|. By default, this expands to
% \begin{macrocode}
\def\thesis@stylepath{\thesis@basepath style/}
\define@key{thesis}{stylePath}{%
\def\thesis@stylepath{\thesis@subdir#1%
\empty\empty\empty\empty}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@localepath}
% \subsubsection{The \texttt{localePath} key}
% The \marg{\texttt{localePath}=path} pair sets the \textit{path}
% containing the locale files. The \textit{path} is normalized
% using the |\thesis@subdir| macro and stored within the
% |\thesis@localepath| macro, whose implicit value is
% |\thesis@basepath| followed by |locale/|. By default, this
% expands to \texttt{fithesis/locale/}.
% \begin{macrocode}
\def\thesis@localepath{\thesis@basepath locale/}
\define@key{thesis}{localePath}{%
\def\thesis@localepath{\thesis@subdir#1%
\empty\empty\empty\empty}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@subdir}
% The |\thesis@subdir| macro returns |/| unchanged, coerces
% |.|, |..|, |/|\textit{path}, |./|\textit{path} and
% |../|\textit{path} to |./|, |../|, |/|\textit{path}|/|,
% |./|\textit{path}|/| and |../|\textit{path}|/|, respectively, and
% prefixes any other \textit{path} with |\thesis@basepath|.
% \begin{macrocode}
\def\thesis@subdir#1#2#3#4\empty{%
\ifx#1\empty% <empty> -> <basepath>
\thesis@basepath
\else
\ifx#2\empty% / -> /
/%
\else% /<path> -> /<path>/
#1#2#3#4/%
\fi
\else
\if#1.%
\ifx#2\empty% . -> ./
./%
\else
\if#2.%
\ifx#3\empty% .. -> ../
../%
\else
\if#3/% ../<path> -> ../<path>/
../#4/%
\else
\thesis@basepath#1#2#3#4/%
\fi
\fi
\else
\if#2/% ./<path> -> ./<path>/
./#3#4/%
\else
\thesis@basepath#1#2#3#4/%
\fi
\fi
\fi
\else
\thesis@basepath#1#2#3#4/%
\fi
\fi
% \begin{macro}{\thesis@def}
% The |\thesis@def|\oarg{key}\marg{name} macro defines
% the |\thesis@|\textit{name} macro to expand
% to either <<\textit{key}>>, if specified, or to
% <<\textit{name}>>. The macro serves to provide placeholder
% strings for macros with no default value.
% \begin{macrocode}
\newcommand{\thesis@def}[2][]{%
\expandafter\def\csname thesis@#2\endcsname{%
<<\ifx\thesis@empty#1\thesis@empty#2\else#1\fi>>}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@declaration}
% \subsubsection{The \texttt{declaration} key}
% The \marg{\texttt{declaration}=text} pair sets the
% declaration \textit{text} to be included into the document.
% The \textit{text} is stored within the |\thesis@declaration|
% macro, whose implicit value is
% |\thesis@@{declaration}|.
% \begin{macrocode}
\def\thesis@declaration{\thesis@@{declaration}}
\long\def\KV@thesis@declaration#1{%
\long\def\thesis@declaration{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ifthesis@woman}
% \subsubsection{The \texttt{gender} key}
% The \marg{\texttt{gender}=char} pair sets the author's gender to
% either a male, if \textit{char} is the character \texttt{m}, or
% to a female. The gender can be tested using the
% |\ifthesis@woman| \ldots |\else| \ldots |\fi| conditional. The
% implicit gender is male.
% \begin{macrocode}
\newif\ifthesis@woman\thesis@womanfalse
\define@key{thesis}{gender}{%
\def\thesis@male{m}%
\def\thesis@arg{#1}%
\ifx\thesis@male\thesis@arg
\thesis@womanfalse
\else
\thesis@womantrue
% \begin{macro}{\thesis@author}
% \subsubsection{The \texttt{author} key}
% The \marg{\texttt{author}=name} pair sets the author's full name
% to \textit{name}. The \textit{name} is parsed using the
% \DescribeMacro{\thesis@parseAuthor}|\thesis@parseAuthor| macro
% and stored within the following macros:
% \begin{itemize}
% \item\DescribeMacro{\thesis@author}|\thesis@author|
% -- The full name of the author.
% \item\DescribeMacro{\thesis@author@head}|\thesis@author@head|
% -- The first space-delimited part of the name. This
% corresponds to the author's first name.
% \item\DescribeMacro{\thesis@author@tail}|\thesis@author@tail|
% -- The full name without the first space-delimited part of
% the name. This corresponds to the author's surname.
% The standard \LaTeX\ \DescribeMacro{\author}|\author| macro also
% sets this key.
\def\thesis@parseAuthor#1{%
\def\thesis@author{#1}%
\def\thesis@author@head{\expandafter\expandafter\expandafter
\@gobble\thesis@head#1 \relax}%
\def\thesis@author@tail{\thesis@tail#1 \relax}}
\thesis@def{author}%
\thesis@def[author]{author@head}%
\thesis@def[author]{author@tail}%
\thesis@parseAuthor{#1}}
\let\author\thesis@parseAuthor
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@id}
% \subsubsection{The \texttt{id} key}
% The \marg{\texttt{id}=identifier} pair sets the identifier
% of the thesis author to \textit{identifier}. This usually
% corresponds to the unique identifier of the author within the
% information system of the given university.
\thesis@def{id}
\define@key{thesis}{id}{%
% \begin{macro}{\thesis@type}
% \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}\toprule
% The thesis type & The value of \textit{type} \\\midrule
% Seminar paper & \texttt{sem} \\
% Master's thesis & \texttt{mgr} \\
% Doctoral thesis & \texttt{d} \\
% Rigorous thesis & \texttt{r} \\\bottomrule
% The \textit{type} is stored within the |\thesis@type| macro,
% whose implicit value is |bc|. For the ease of testing of the
% thesis type via |\ifx| conditions within style and locale files,
% the \DescribeMacro{\thesis@sempaper}|\thesis@sempaper|,
% \DescribeMacro{\thesis@bachelors}|\thesis@bachelors|,
% \DescribeMacro{\thesis@masters}|\thesis@masters|,
% \DescribeMacro{\thesis@doctoral}|\thesis@doctoral| and
% \DescribeMacro{\thesis@rigorous}|\thesis@rigorous| macros
% containing the corresponding \textit{type} values are available
% as a part of the private API.
% \begin{macrocode}
\def\thesis@bachelors{bc}
\def\thesis@masters{mgr}
\def\thesis@doctoral{d}
\def\thesis@rigorous{r}
\let\thesis@type\thesis@bachelors
\define@key{thesis}{type}{%
\def\thesis@type{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@university}
% \subsubsection{The \texttt{university} key}
% The \marg{\texttt{university}=identifier} pair sets the
% identifier of the university, at which the thesis is being
% written, to \textit{identifier}. The \textit{identifier} is
% stored within the |\thesis@university| macro, whose
% implicit value is \texttt{mu}. This value corresponds to the
% Masaryk University in Brno.
% \begin{macrocode}
\def\thesis@university{mu}
\define@key{thesis}{university}{%
\def\thesis@university{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@faculty}
% \subsubsection{The \texttt{faculty} key}
% The \marg{\texttt{faculty}=identifier} pair sets the faculty, at
% which the thesis is being written, to \textit{domain}. The
% following faculty \textit{identifier}s are recognized at the
% Masaryk University in Brno:
% \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} \\
% The Faculty of Economics and Administration & \texttt{econ} \\
% The Faculty of Social Studies & \texttt{fss} \\
% 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} \\\bottomrule
% The \textit{identifier} is stored within the |\thesis@faculty|
% macro, whose implicit value is \texttt{fi}.
% \begin{macrocode}
\def\thesis@faculty{fi}
\define@key{thesis}{faculty}{%
\def\thesis@faculty{#1}}
% \end{macro}
% \begin{macro}{\thesis@department}
% \subsubsection{The \texttt{department} key}
% The \marg{\texttt{department}=name} pair sets the name of the
% department, at which the thesis is being written, to
% \textit{name}. Unlike the university and faculty identifiers,
% \textsf{fithesis3} does not prescribe the format of the
% \textit{name}; the style files may internally parse it, or
% typeset it as-is. The \textit{name} is stored within the
% |\thesis@department| macro.
\thesis@def{department}
\define@key{thesis}{department}{%
\def\thesis@department{#1}}
% \begin{macro}{\thesis@departmentEn}
% \subsubsection{The \texttt{departmentEn} key}
% The \marg{\texttt{departmentEn}=name} pair sets the English
% name of the department, at which the thesis is being written, to
% \textit{name}. The \textit{name} is stored within the
% |\thesis@departmentEn| macro.
\thesis@def{departmentEn}
\define@key{thesis}{departmentEn}{%
\def\thesis@departmentEn{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@programme}
% \subsubsection{The \texttt{programme} key}
% The \marg{\texttt{programme}=name} pair sets the name of the
% author's study programme to \textit{name}. Unlike the university
% and faculty identifiers, the programme \textit{name} is only used
% for typesetting and it should therefore be specified in plain
% language with optional \TeX\ macros. The \textit{name} is stored
% within the |\thesis@programme| macro.
\thesis@def{programme}
\def\thesis@programme{#1}}
% \begin{macro}{\thesis@programmeEn}
% \subsubsection{The \texttt{programmeEn} key}
% The \marg{\texttt{programmeEn}=name} pair sets the English name
% of the author's study programme to \textit{name}. The
% \textit{name} is stored within the |\thesis@programmeEn| macro.
\thesis@def{programmeEn}
\define@key{thesis}{programmeEn}{%
\def\thesis@programmeEn{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@field}
% \subsubsection{The \texttt{field} key}
% The \marg{\texttt{field}=name} pair sets the name of the author's
% field of study to \textit{name}. Unlike the university and
% faculty identifiers, the \textit{name} of the field of study is
% only used for typesetting and it should therefore be specified in
% plain language with optional \TeX\ macros. The \textit{name} is
% stored within the |\thesis@field| macro.
\thesis@def{field}
\define@key{thesis}{field}{%
\def\thesis@field{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@fieldEn}
% \subsubsection{The \texttt{fieldEn} key}
% The \marg{\texttt{fieldEn}=name} pair sets the English name of
% the author's field of stufy to \textit{name}. The \textit{name}
% is stored within the |\thesis@fieldEn| macro.
\thesis@def{fieldEn}
\define@key{thesis}{fieldEn}{%
\def\thesis@fieldEn{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@universityLogo}
% \subsubsection{The \texttt{universityLogo} key}
% The \marg{\texttt{universityLogo}=filename} pair sets the
% filename of the logo file to be used as the university logo to
% \textit{filename}. The \textit{filename} is stored within the
% |\thesis@universityLogo| macro, whose implicit value is
% \texttt{fithesis-base}. The \texttt{fithesis-} prefix serves to
% prevent package clashes with other similarly named files within
% the \TeX\ directory structure. The logo file is loaded from the
% |\thesis@logopath|\discretionary{}{}{}|\thesis@universityLogo|
\def\thesis@universityLogo{fithesis-base}
\define@key{thesis}{universityLogo}{%
\def\thesis@universityLogo{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@facultyLogo}
% \subsubsection{The \texttt{facultyLogo} key}
% The \marg{\texttt{facultyLogo}=filename} pair sets the filename
% of the logo file to be used as the faculty logo to
% \textit{filename}. The \textit{filename} is stored within the
% |\thesis@|\discretionary{}{}{}|facultyLogo| macro, whose
% implicit value is |fithesis-\thesis@faculty|. The
% \texttt{fithesis-} prefix serves to prevent package clashes with
% other similarly named files within the \TeX\ directory structure.
% The logo file is loaded from the
% |\thesis@logopath\thesis@facultyLogo| path.
\def\thesis@facultyLogo{fithesis-\thesis@faculty}
\define@key{thesis}{facultyLogo}{%
\def\thesis@facultyLogo{#1}}
% \end{macro}
% \begin{macro}{\thesis@style}
% \subsubsection{The \texttt{style} key}
% The \marg{\texttt{style}=filename} pair sets the filename of the
% style file to be used to \textit{filename}. The \textit{filename}
% is stored within the |\thesis@style| macro, whose
% implicit value is |\thesis@university/fithesis-\thesis@faculty|.
% When the \textit{filename} is an empty token string, no style
% files will be loaded during the main routine (see Section
% \ref{sec:thesisload}).
\def\thesis@style{\thesis@university/fithesis-\thesis@faculty}
\define@key{thesis}{style}{%
\def\thesis@style{#1}}
% \end{macro}
% \begin{macro}{\thesis@style@inheritance}
% \subsubsection{The \texttt{styleInheritance} key}
% The \marg{\texttt{styleInheritance}=bool} pair either enables,
% if \textit{bool} is \texttt{true} or unspecified, or disables the
% inheritance for style files. The setting affects the function of
% the |\thesis@requireStyle| macro (see Section
% \ref{sec:reflection}) and can be tested using the
% |\ifthesis@style@inheritance| \ldots |\else| \ldots |\fi|
% conditional. Inheritance is enabled for style files by default.
\newif\ifthesis@style@inheritance\thesis@style@inheritancetrue
\define@key{thesis}{styleInheritance}[true]{%
\begingroup
\ifx\@true\@arg
\endgroup\thesis@style@inheritancetrue
\else
\endgroup\thesis@style@inheritancefalse
% \end{macro}
% \begin{macro}{\thesis@locale}
% \subsubsection{The \texttt{locale} key}
% The \marg{\texttt{locale}=name} pair sets the name of the main
% locale to \textit{name}. The \textit{name} is stored within the
% |\thesis@locale| macro, whose implicit value is the main
% language of either the \textsf{babel} or the \textsf{polyglossia}
% package, or \texttt{english}, when undefined. When the
% \textit{name} is an empty token string, no locale files will be
% loaded during the main routine (see Section
% \ref{sec:thesisload}).
\ifx\languagename\undefined
\define@key{thesis}{locale}{%
\def\thesis@locale{#1}}
% \begin{macro}{\ifthesis@english}
% The English locale is special. Several parts of the document will
% typically be typeset in both the current locale and English.
% However, if the current locale is English, this would result in
% duplicity. To avoid this, the |\ifthesis@english| \ldots |\else|
% \ldots |\fi| conditional is made available for testing, whether
% or not the current locale is English.
% \begin{macrocode}
\expandafter\def\expandafter\@english\expandafter{\string
\expandafter\expandafter\expandafter\def\expandafter
\expandafter\expandafter\@locale\expandafter\expandafter
\expandafter{\expandafter\string\csname\thesis@locale\endcsname}%
\expandafter\csname\expandafter i\expandafter f\ifx\@locale
\@english
\else
% \begin{macro}{\thesis@locale@inheritance}
% \subsubsection{The \texttt{localeInheritance} key}
% The \marg{\texttt{localeInheritance}=bool} pair either enables,
% if \textit{bool} is \texttt{true} or unspecified, or disables the
% inheritance. The setting affects the function of
% the |\thesis@requireLocale| macro (see Section
% \ref{sec:reflection}) and can be tested using the
% |\ifthesis@locale@inheritance| \ldots |\else| \ldots |\fi|
% conditional. Inheritance is enabled for locale files by default.
\newif\ifthesis@locale@inheritance\thesis@locale@inheritancetrue
\define@key{thesis}{localeInheritance}[true]{%
\begingroup
\ifx\@true\@arg
\endgroup\thesis@locale@inheritancetrue
\else
\endgroup\thesis@locale@inheritancefalse
% \subsubsection{The \texttt{date} key}
% The \marg{\texttt{date}=date} pair sets the date of the thesis
% submission to \textit{date}, where \textit{date} is a string
% in the \texttt{YYYY/MM/DD} format, where \texttt{YYYY} stands
% for full year, \texttt{MM} stands for month and \texttt{DD}
% stands for day. The \textit{date} is parsed and stored using
% the \DescribeMacro{\thesis@parseDate}|\thesis@parseDate|
% macro within the following macros:
% \DescribeMacro{\thesis@date}
% \DescribeMacro{\thesis@year}
% \DescribeMacro{\thesis@month}
% \DescribeMacro{\thesis@day}
% \begin{multicols}{2}
% \item|\thesis@date| -- The entire \textit{date}
% \item|\thesis@year| -- The \texttt{YYYY} of \textit{date}
% \item|\thesis@month| -- The \texttt{MM} of \textit{date}
% \item|\thesis@day| -- The \texttt{DD} of \textit{date}
% \end{itemize}
% \end{multicols}
% \begin{itemize}
% \item\DescribeMacro{\thesis@season}|\thesis@season| -- Expands
% to either:
% \begin{itemize}
% \item\texttt{spring} if $2<{}$\texttt{MM}${}<9$,
% \item\texttt{fall} if \texttt{MM}${}\leq2$ or \texttt{MM}${}\geq9$.
% \item\DescribeMacro{\thesis@seasonYear}|\thesis@seasonYear|
% -- The year of the given semester:
% \begin{itemize}
% \item\texttt{YYYY}${}-1$ if \texttt{MM}${}\leq2$.
% \item\texttt{YYYY} if \texttt{MM}${}>2$
% \end{itemize}
% \item\DescribeMacro{\thesis@academicYear}|\thesis@academicYear|
% -- The academic year of the given semester:
% \begin{itemize}
% \item\texttt{YYYY}${}-1$\texttt{/YYYY} if \texttt{MM}${}<9$.
% \item\texttt{YYYY/YYYY}${}+1$ if \texttt{MM}${}\geq9$
% \end{itemize}
% \end{itemize}
% To set up the default values, the |\thesis@parseDate| macro is
% called with the fully expanded |\the\year/\the\month/\the\day|
% string, which equals the current date.
\def\thesis@parseDate#1/#2/#3|{{
% Set the basic macros
\gdef\thesis@date{#1/#2/#3}%
\gdef\thesis@year{#1}%
\gdef\thesis@month{#2}%
\gdef\thesis@day{#3}%
% Set the season
\newcount\@month\expandafter\@month\thesis@month\relax
\ifnum\@month>8\gdef\thesis@season{fall}
\else\ifnum\@month<3\gdef\thesis@season{fall}
\else \gdef\thesis@season{spring}
\fi\fi
% Set the academic year
\newcount\@year\expandafter\@year\thesis@year\relax
\ifnum\@month>8%
\edef\@yearA{\the\@year}%
\advance\@year 1\edef\@yearB{\the\@year}%
\advance\@year-1
\else
\advance\@year-1\edef\@yearA{\the\@year}%
\advance\@year 1\edef\@yearB{\the\@year}%
\fi
\global\edef\thesis@academicYear{\@yearA/\@yearB}
% Set the season year
\ifnum\@month>2\else
\advance\@year-1