Commit c12ea770 authored by Vít Novotný's avatar Vít Novotný
Browse files

Refactored the code.

parent 8fe3c3e8
Loading
Loading
Loading
Loading
+21 −24
Original line number Diff line number Diff line
@@ -1284,7 +1284,7 @@
% the same effect.
%    \begin{macrocode}
\newif\ifthesis@loaded\thesis@loadedfalse
\AtEndPreamble{\thesisload}
\BeforeBeginEnvironment{document}{\thesisload}
\def\thesis@load{\thesisload}
\def\thesisload{%
  \ifthesis@loaded\else
@@ -1312,6 +1312,13 @@
        \RequirePackage[base]{babel}}
    \fi
%    \end{macrocode}
% Consequently, the style files are loaded. If the user specified an
% explicit empty string as the value of |\thesis@style|, do nothing.
%    \begin{macrocode}
      \ifx\thesis@style\empty\else
        \thesis@requireStyle{\thesis@style}
      \fi
%    \end{macrocode}
% If the \textsf{babel} or \textsf{polyglossia} locale is identical
% to the thesis locale, the |\thesis@selectLocale| macro will be
% used to globally set up the \textsf{csquotes} style appropriate for
@@ -1328,14 +1335,6 @@
        \endgroup
      \fi
    \fi
      \fi
%    \end{macrocode}
% Consequently, the style files are loaded. If the user specified an
% explicit empty string as the value of |\thesis@style|, do nothing.
%    \begin{macrocode}
      \ifx\thesis@style\empty\else
        \thesis@requireStyle{\thesis@style}
      \fi
%    \end{macrocode}
% With the placeholder strings loaded from the locale files, we
% can now inject metadata into the resulting PDF file. To this
@@ -1557,14 +1556,12 @@
% locale, \textsf{csquotes}, and hyphenation settings return back to
% what the user has specified after the localized blocks of
% typographic material.
%
% If not loaded by the user, the \textsf{csquotes} package gets
% loaded at the end of the preamble.
%    \begin{macrocode}
\AtEndPreamble{\thesis@require{csquotes}}
\def\thesis@selectLocale#1{%
  \edef\thesis@locale{#1}%
  \ltx@ifpackageloaded{csquotes}{%
    \csq@setstyle{\thesis@@{csquotesStyle}}%
  }{}%
  \ltx@ifpackageloaded{polyglossia}{%
    \selectlanguage{\thesis@locale}
  }{%