Skip to content
Snippets Groups Projects
Commit 02097660 authored by Tereza Vrabcová's avatar Tereza Vrabcová
Browse files

Added \thesis@xpatch command

parent 1e883567
No related branches found
No related tags found
No related merge requests found
......@@ -465,6 +465,8 @@
% \item\textsf{inputenc} -- Used to enable the input UTF-8
% encoding. This package does not get loaded under
% the \Hologo{XeTeX} and \Hologo{LuaTeX} engines.
% \item\textsf{xpatch} -- Used to redefine parts of code
% in macros without redefining the whole macro.
% \end{itemize}
% The \texttt{hyperref} package is also conditionally loaded during
% the expansion of the |\thesis@load| macro (see Section
......@@ -479,6 +481,7 @@
\ifxetex\else\ifluatex\else
\RequirePackage[utf8]{inputenc}
\fi\fi
\RequirePackage{xpatch}
% \end{macrocode}
% \section{Public API}
% \label{sec:public-api}
......@@ -1850,13 +1853,14 @@
\expandafter\thesis@patch@versions\expandafter,\relax,}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@xpatchError}
% The |\thesis@xpatchError| macro is used to test for error of the given
% \textit{xpatchcmd}. If the \textit{xpatchcmd} fails, a class error is
% written to the output.
% \begin{macrocode}
\def\thesis@xpatchError{%
\ClassError{xpatchcmd}{The class does not contain searched text}}
% \begin{macro}{\thesis@xpatch}
% The |\thesis@xpatch| macro is used to to replace code in a searched
% macro by the replacement code via \textit{xpatchcmd} If the
% \textit{xpatchcmd} fails, a class error is written to the output.
% \begin{macrocode}
\def\thesis@xpatch#1#2#3{%
\xpatchcmd{#1}{#2}{#3}{}%
{\ClassError{fithesis4}{The command #1 does not contain searched text}}}
% \end{macrocode}
% \end{macro}
% \iffalse
......
......@@ -38,17 +38,13 @@
% \end{macrocode}
% Each footnote is uniquely numbered across the entire document as
% per the formal requirements of the faculty.
% \changes{v1.0.0}{2021/03/22}{Added \textsf{regexpatch} package to
% redefine the layout of titlePage. [TV]}
% \begin{macrocode}
\thesis@require{xpatch}
\thesis@require{chngcntr}
\counterwithout{footnote}{chapter}
% \end{macrocode}
% The style file configures the upper part of the title page headers
% to include the name of the department and the study field
% which are by default in the bottom part of the title page. Upon failure
% of the \textit{xpatchcmd}, \cs{thesis@xpatchError} is called.
% which are by default in the bottom part of the title page.
% \changes{v1.0.0}{2021/04/23}{^^A
% The style files for the Faculty of Law at the Masaryk University
% in Brno no longer redefine the \cs{thesis@blocks@cover@header}
......@@ -57,7 +53,7 @@
% layout as per the faculty requirements. Department name and
% field are in the upper part of the titlePage. [TV]}
% \begin{macrocode}
\xpatchcmd{\thesis@blocks@titlePage}
\thesis@xpatch{\thesis@blocks@titlePage}
{{\sf\thesis@titlePage@large\thesis@@{advisorTitle}: \thesis@advisor}%
\par\vspace{0.75cm}%
\ifthesis@blocks@titlePage@department@
......@@ -74,10 +70,9 @@
\thesis@field@name}%
\fi
\par\vfill
}
{}{}{\thesis@xpatchError{}}
}{}
\xpatchcmd{\thesis@blocks@titlePage}
\thesis@xpatch{\thesis@blocks@titlePage}
{{\sf\thesis@titlePage@large\thesis@@upper{facultyName}}%
\par\vspace{1.75cm}%
}
......@@ -88,7 +83,6 @@
{\sf\thesis@titlePage@large\thesis@department@name}
\par\vspace{1.75cm}%
}
{}{\thesis@xpatchError{}}
% \end{macrocode}
% \begin{macro}{\thesis@blocks@frontMatter}
% The |\thesis@blocks@frontMatter| macro sets up the style
......
......@@ -82,13 +82,10 @@
% 16\,cm in accordance with the formal requirements of the faculty.
% This leads to overfull lines and is against the good conscience
% of the author of this style.
% \changes{v1.0.0}{2021/03/22}{Added \textsf{xpatch} package to
% redefine layout of titlePage. [TV]}
% \begin{macrocode}
\thesis@require{tikz}
\thesis@require{geometry}
\thesis@require{setspace}
\thesis@require{xpatch}
\geometry{top=25mm,bottom=20mm,left=25mm,right=25mm,includeheadfoot}
% \end{macrocode}
% The style file configures the upper part of the title page headers
......@@ -111,7 +108,7 @@
% in Brno no longer redefine the \cs{thesis@blocks@cover} macro.
% [TV]}
% \begin{macrocode}
\xpatchcmd{\thesis@blocks@titlePage}
\thesis@xpatch{\thesis@blocks@titlePage}
{{\sf\thesis@titlePage@large\thesis@@{advisorTitle}: \thesis@advisor}%
\par\vspace{0.75cm}%
\ifthesis@blocks@titlePage@department@
......@@ -128,10 +125,9 @@
\thesis@field@name}%
\fi
\par\vfill
}
{}{}{\thesis@xpatchError{}}
}{}
\xpatchcmd{\thesis@blocks@titlePage}
\thesis@xpatch{\thesis@blocks@titlePage}
{{\sf\thesis@titlePage@large\thesis@@upper{facultyName}}%
\par\vspace{1.75cm}%
}
......@@ -142,7 +138,6 @@
{\sf\thesis@titlePage@large\thesis@department@name}
\par\vspace{1.75cm}%
}
{}{\thesis@xpatchError{}}
% \end{macrocode}
% \begin{macro}{\thesis@blocks@frontMatter}
% The |\thesis@blocks@frontMatter| macro sets up the style of the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment