From 58c3123439eddbfc5613b4c5f905c64dae7ae1cc Mon Sep 17 00:00:00 2001
From: witiko <witiko@gmail.com>
Date: Fri, 10 Apr 2015 00:08:06 +0200
Subject: [PATCH] Partial implementation of the Faculty of Science style.

---
 example.tex        |   2 +-
 fithesis.dtx       |   2 +
 locale/czech.dtx   |   8 ++-
 locale/english.dtx |   8 ++-
 locale/slovak.dtx  |   8 +++
 style/mu/Makefile  |   4 +-
 style/mu/base.dtx  | 120 ++++++++++++++++++++++++++++++++-------------
 style/mu/fi.dtx    |  30 ++----------
 style/mu/sci.dtx   |  44 +++++++++++++++++
 style/mu/sci.ins   |   4 ++
 10 files changed, 163 insertions(+), 67 deletions(-)
 create mode 100644 style/mu/sci.dtx
 create mode 100644 style/mu/sci.ins

diff --git a/example.tex b/example.tex
index ea40bee..e0381c7 100644
--- a/example.tex
+++ b/example.tex
@@ -1,5 +1,5 @@
 \documentclass[color]{fithesis3}
-\thesissetup{basepath=.}
+\thesissetup{basepath=.,faculty=sci}
 \usepackage[utf8]{inputenc}
 \usepackage[slovak]{babel}
 \begin{document}
diff --git a/fithesis.dtx b/fithesis.dtx
index 89147d6..893cc1d 100644
--- a/fithesis.dtx
+++ b/fithesis.dtx
@@ -1016,3 +1016,5 @@
 % \input{style/mu/base.dtx}
 % \subsubsection{The style file of the Faculty of Informatics}
 % \input{style/mu/fi.dtx}
+% \subsubsection{The style file of the Faculty of Science}
+% \input{style/mu/sci.dtx}
diff --git a/locale/czech.dtx b/locale/czech.dtx
index 44eaa8f..f265733 100644
--- a/locale/czech.dtx
+++ b/locale/czech.dtx
@@ -25,6 +25,8 @@
 \def\thesis@placeholders@department{Název katedry}
 \def\thesis@placeholders@programme{Název studijního programu}
 \def\thesis@placeholders@thanks{Text poděkování ...}
+\def\thesis@placeholders@assignment{MĂ­sto tohoto listu vloĹľte kopii
+  oficiálního podepsaného zadání práce.}
 \def\thesis@declaration{Text prohlášení ...}
 
 % Různé
@@ -127,12 +129,16 @@
 % This is the Czech locale file specific to the Faculty of
 % Informatics at the Masaryk University in Brno.
 % It replaces the |\thesis@facultyName| placeholder with the
-% correct value.
+% correct value and updates the |\thesis@placeholders@assignment|
+% to reflect the requirements specific to the faculty.
 % \iffalse
 %<*mu/fi>
 % \fi\begin{macrocode}
 \ProvidesFile{czech.def}[2015/04/08]
 \def\thesis@facultyName{Fakulta informatiky}
+\def\thesis@placeholders@assignment{MĂ­sto tohoto listu vloĹľte kopie
+  oficiálního podepsaného zadání práce a prohlášení autora školního
+  dĂ­la.}
 %    \end{macrocode}\iffalse
 %</mu/fi>
 % \fi\file{locale/mu/phil/czech.def}
diff --git a/locale/english.dtx b/locale/english.dtx
index 9f92d73..3fe2899 100644
--- a/locale/english.dtx
+++ b/locale/english.dtx
@@ -17,6 +17,8 @@
 \def\thesis@placeholders@department{Department name}
 \def\thesis@placeholders@programme{Study programme name}
 \def\thesis@placeholders@thanks{Acknowledgement text ...}
+\def\thesis@placeholders@assignment{Replace this page with a copy
+  of the official signed thesis assignment.}
 \def\thesis@declaration{Declaration text ...}
 
 % Miscellaneous
@@ -117,12 +119,16 @@
 % This is the English locale file specific to the Faculty of
 % Informatics at the Masaryk University in Brno.
 % It replaces the |\thesis@facultyName| placeholder with the
-% correct value.
+% correct value and updates the |\thesis@placeholders@assignment|
+% to reflect the requirements specific to the faculty.
 % \iffalse
 %<*mu/fi>
 % \fi\begin{macrocode}
 \ProvidesFile{english.def}[2015/04/08]
 \def\thesis@facultyName{Faculty of Informatics}
+\def\thesis@placeholders@assignment{Replace this page with a copy
+  of the official signed thesis assignment and the copy of the
+  Statement of an Author.}
 %    \end{macrocode}\iffalse
 %</mu/fi>
 % \fi\file{locale/mu/phil/english.def}
diff --git a/locale/slovak.dtx b/locale/slovak.dtx
index 98b2246..263ee0b 100644
--- a/locale/slovak.dtx
+++ b/locale/slovak.dtx
@@ -30,6 +30,8 @@
 \def\thesis@placeholders@department{Názov katedry}
 \def\thesis@placeholders@programme{Názov študijného programu}
 \def\thesis@placeholders@thanks{Text poÄŹakovanie ...}
+\def\thesis@placeholders@assignment{Namiesto tejto stránky vložte
+  kópiu oficiálneho podpísaného zadania práce.}
 \def\thesis@declaration{Text prehlásenie ...}
 
 % RĂ´zne
@@ -139,6 +141,8 @@
 % Informatics at the Masaryk University in Brno. It
 % inherits the value of the |\thesis@facultyName| private macro
 % from the respective Czech locale file.
+% It also updates the |\thesis@placeholders@assignment|
+% to reflect the requirements specific to the faculty.
 % \iffalse
 %<*mu/fi>
 % \fi\begin{macrocode}
@@ -146,6 +150,10 @@
 
 % SymbolickĂ˝ odkaz na ÄŤeskĂ˝ preklad
 \input{\thesis@localepath mu/fi/czech.def}
+
+\def\thesis@placeholders@assignment{Namiesto tejto stránky vložte
+  kópiu oficiálneho podpísaného zadania práce a prehlásenie autora
+  školského diela.}
 %    \end{macrocode}\iffalse
 %</mu/fi>
 % \fi\file{locale/mu/phil/slovak.def}
diff --git a/style/mu/Makefile b/style/mu/Makefile
index 567dd1c..8c76471 100644
--- a/style/mu/Makefile
+++ b/style/mu/Makefile
@@ -1,5 +1,5 @@
-LOGS=base.log fi.log
-OUTPUT=base.sty fit1[012].clo fi.sty
+LOGS=base.log fi.log sci.log
+OUTPUT=base.sty fit1[012].clo fi.sty sci.sty sci.bbx
 
 .PHONY: explode implode all
 all: explode
diff --git a/style/mu/base.dtx b/style/mu/base.dtx
index 4e8d1f6..ba91886 100644
--- a/style/mu/base.dtx
+++ b/style/mu/base.dtx
@@ -21,7 +21,7 @@
 %     other elements are rearranged based on
 %     the parity of the page. Blank pages are optionally inserted
 %     prior the beginning of the next chapter to ensure that it
-%     starts on an odd page.
+%     starts on an left-hand (even-numbered) page.
 %
 %     The \DescribeMacro{\ifthesis@twoside}|\ifthesis@twoside|
 %     conditional is set to \textit{false} or \textit{true},
@@ -37,9 +37,20 @@
 %     is set to \textit{false} or \textit{true}, respectively.
 %     This value can be tested in the subsequently loaded style
 %     files.
+%   \item\texttt{lot}, \texttt{nolot} -- |\listoftables| is or
+%     isn't going to be included in the
+%     \DescribeMacro{\thesis@blocks@tables}|\thesis@blocks@tables|
+%     block, respectively.
+%   \item\texttt{lof}, \texttt{nolof} -- |\listoffigures| is or
+%     isn't going to be included in the
+%     \DescribeMacro{\thesis@blocks@tables}|\thesis@blocks@tables|
+%     block, respectively.
+%   \item\texttt{lof}, \texttt{nolof} -- The |\thesis@blocks@cover|
+%     is or isn't going to expand to the thesis cover.
 % \end{itemize}
-% The defaults are \texttt{12pt}, \texttt{twoside}, \texttt{final}
-% and \texttt{monochrome}.
+% The defaults are \texttt{12pt}, \texttt{oneside}, \texttt{final},
+% \texttt{monochrome}, \texttt{lof}, \texttt{lot} and
+% \texttt{nocover}.
 %    \begin{macrocode}
 \DeclareOption{10pt}{\def\thesis@ptsize{0}}
 \DeclareOption{11pt}{\def\thesis@ptsize{1}}
@@ -56,7 +67,15 @@
 \newif\ifthesis@color\thesis@colorfalse
 \DeclareOption{monochrome}{\thesis@colorfalse}
 \DeclareOption{color}{\thesis@colortrue}
-\ExecuteOptions{12pt,twoside,final,monochrome}
+\DeclareOption{nolot}{\def\thesis@blocks@lot{}}
+\DeclareOption{lot}{\let\thesis@blocks@lot\listoftables}
+\DeclareOption{nolof}{\def\thesis@blocks@lof{}}
+\DeclareOption{lof}{\let\thesis@blocks@lof\listoffigures}
+\newif\ifthesis@cover
+\DeclareOption{nocover}{\thesis@covertrue}
+\DeclareOption{cover}{\thesis@coverfalse}
+
+\ExecuteOptions{12pt,oneside,final,monochrome,lot,lof,nocover}
 \ProcessOptions
 %    \end{macrocode}
 % The file loads the following packages: \begin{itemize}
@@ -96,30 +115,45 @@
   \setcounter{page}{1}
   \pagenumbering{roman}}
 %    \end{macrocode}
+% \begin{macro}{\thesis@blocks@clear}
+% The |\thesis@blocks@clear| private macro clears the current page
+% along with the next left-handed (even-numbered) page, when
+% double-sided typesetting is enabled.
+% \end{macro}\begin{macrocode}
+\def\thesis@blocks@clear{%
+  \ifthesis@twoside%
+    \clearpage%
+    \thispagestyle{empty}%
+    \cleardoublepage%
+  \else%
+    \newpage%
+  \fi
+}
+%    \end{macrocode}
 % \begin{macro}{\thesis@blocks@cover}
 % The |\thesis@blocks@cover| private macro typesets the thesis
 % cover.
 % \end{macro}\begin{macrocode}
 \def\thesis@blocks@cover{%
-  \ifthesis@twoside\@twosidefalse\fi % Temporarily disable twoside
-  \begin{alwayssingle}
-    \thispagestyle{empty}
-    \begin{center}
-    {\sc\thesis@universityName\\\thesis@facultyName}
-    \vskip 1.4em
-    \includegraphics[width=40mm]{\thesis@logopath\thesis@logo}\\[0.4in]
-    \let\footnotesize\small
-    \let\footnoterule\relax{}
-    {\titlefont\bf\thesis@TeXtitle\par\vfil}\vskip 0.8in
-    {\sc \thesis@typeName}\\[0.3in]
-    {\Large\bf\thesis@author}
-    \par\vfill
-    {\large\thesis@place, \thesis@year}
-    \end{center}
-  \end{alwayssingle}
-  \newpage
-  \ifthesis@twoside\@twosidetrue\fi % Re-enable twoside
-  }
+  \ifthesis@cover\else
+    \ifthesis@twoside\@twosidefalse\fi % Temporarily disable twoside
+    \begin{alwayssingle}
+      \thispagestyle{empty}
+      \begin{center}
+      {\sc\thesis@universityName\\\thesis@facultyName}
+      \vskip 1.4em
+      \includegraphics[width=40mm]{\thesis@logopath\thesis@logo}\\[0.4in]
+      \let\footnotesize\small
+      \let\footnoterule\relax{}
+      {\titlefont\bf\thesis@TeXtitle\par\vfil}\vskip 0.8in
+      {\sc \thesis@typeName}\\[0.3in]
+      {\Large\bf\thesis@author}
+      \par\vfill
+      {\large\thesis@place, \thesis@year}
+      \end{center}
+    \end{alwayssingle}
+    \ifthesis@twoside\@twosidetrue\fi % Re-enable twoside
+  \fi}
 %    \end{macrocode}
 % \begin{macro}{\thesis@blocks@titlePage}
 % The |\thesis@blocks@titlePage| private macro typesets the thesis
@@ -129,7 +163,7 @@
 % |\thesis@logopath|.
 % \end{macro}\begin{macrocode}
 \def\thesis@blocks@titlePage{%
-  \ifthesis@twoside\@twosidefalse\fi % Temporarily disable twoside
+  \thesis@blocks@clear
   \begin{alwayssingle}
     \thispagestyle{empty}
     \begin{center}
@@ -145,10 +179,19 @@
     \par\vfill
     {\large\thesis@place, \thesis@year}
     \end{center}
-  \end{alwayssingle}
-  \newpage
-  \ifthesis@twoside\@twosidetrue\fi % Re-enable twoside
-  }
+  \end{alwayssingle}}
+%    \end{macrocode}
+% \begin{macro}{\thesis@blocks@tables}
+% The |\thesis@blocks@tables| private macro typesets the table of
+% contents and optionally the |\listoftables| and the
+% |\listoffigures|.
+% \end{macro}\begin{macrocode}
+\def\thesis@blocks@tables{%
+  \tableofcontents%
+  \thesis@blocks@lot%
+  \thesis@blocks@lof%
+  \newpage%
+}
 %    \end{macrocode}
 % \begin{macro}{\thesis@blocks@declaration}
 % The |\thesis@blocks@declaration| private macro typesets the
@@ -230,6 +273,19 @@
     \newpage%
   \fi}
 %    \end{macrocode}
+% \begin{macro}{\thesis@blocks@assignment}
+% The |\thesis@blocks@assignment| private macro typesets a blank
+% page to be replaced with the official thesis assignment.
+% \end{macro}\begin{macrocode}
+\def\thesis@blocks@assignment{%
+  \thesis@blocks@clear
+  \begin{alwayssingle}%
+    \thispagestyle{empty}
+    \addtocounter{page}{-\ifthesis@twoside2\else1\fi}
+    \noindent\textit{\thesis@placeholders@assignment}%
+  \end{alwayssingle}%
+  \newpage}
+%    \end{macrocode}
 % The file defines several blocks to be used in the redefinitions
 % of the |\thesis@preamble| and |\thesis@postable| private macros
 % by the subsequently loaded style files.
@@ -239,13 +295,7 @@
 % of the main matter of the thesis.
 % \end{macro}\begin{macrocode}
 \def\thesis@blocks@mainMatter{%
-  \if@twoside
-    \clearpage
-    \thispagestyle{empty}
-    \cleardoublepage
-  \else
-    \clearpage
-  \fi
+  \thesis@blocks@clear
   \setcounter{page}{1}
   \pagenumbering{arabic}
   \pagestyle{thesisheadings}
diff --git a/style/mu/fi.dtx b/style/mu/fi.dtx
index def210d..eda5d3e 100644
--- a/style/mu/fi.dtx
+++ b/style/mu/fi.dtx
@@ -7,48 +7,24 @@
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
 %    \end{macrocode}
-% The file recognizes the following options:
-% \begin{itemize}
-%   \item\texttt{lot}, \texttt{nolot} -- A list of tables is or
-%     isn't going to be included in the autolayout preamble,
-%     respectively.
-%   \item\texttt{lof}, \texttt{nolof} -- A list of figures is or
-%     isn't going to be included in the autolayout preamble,
-%     respectively.
-% \end{itemize}
-% The defaults are \texttt{lot} and \texttt{lof}.
-%    \begin{macrocode}
-\ProvidesPackage{fithesis3/style/mu/fi}[2015/04/08]
-\DeclareOption{nolot}{\def\thesis@blocks@lot{}}
-\DeclareOption{lot}{\let\thesis@blocks@lot\listoftables}
-\DeclareOption{nolof}{\def\thesis@blocks@lof{}}
-\DeclareOption{lof}{\let\thesis@blocks@lof\listoffigures}
-\ExecuteOptions{lot,lof}
-\ProcessOptions
-%    \end{macrocode}
 % The style file defines the autolayout preamble as the cover and
 % the title page followed by the declaration, acknowledgement,
 % abstract, keywords and tables of contents, tables and figures as
 % a part of the front matter. All of the blocks are defined in the
-% \texttt{style/mu/base.tex} file except for the
-% \DescribeMacro{\thesis@blocks@lof}|\thesis@blocks@lof| and
-% \DescribeMacro{\thesis@blocks@lot}|\thesis@blocks@lot|, which
-% expand to either |\listoffigures| or |\listoftables|,
-% respectively, or to an empty string based on the options.
+% \texttt{style/mu/base.tex} file.
 %    \begin{macrocode}
 \def\thesis@preamble{%
   \thesis@blocks@cover%
   \thesis@blocks@titlePage%
   \thesis@blocks@frontMatter%
+    \thesis@blocks@assignment%
     \thesis@blocks@declaration%
     \thesis@blocks@thanks%
     \thesis@blocks@abstract%
     \thesis@blocks@abstractEn%
     \thesis@blocks@keywords%
     \thesis@blocks@keywordsEn%
-    \tableofcontents%
-    \thesis@blocks@lot%
-    \thesis@blocks@lof%
+    \thesis@blocks@tables%
   \thesis@blocks@mainMatter%
 }
 %    \end{macrocode}
diff --git a/style/mu/sci.dtx b/style/mu/sci.dtx
new file mode 100644
index 0000000..d3e08d3
--- /dev/null
+++ b/style/mu/sci.dtx
@@ -0,0 +1,44 @@
+% \iffalse
+%<*base>
+% \fi\file{style/mu/sci.sty}
+% This is the style file for the theses written at the Faculty of
+% Science at the Masaryk University in Brno. It has been
+% prepared in accordance with the formal requirements published at
+% the website of the faculty\footnote{See
+% \url{http://www.sci.muni.cz/NW/predpisy/od/OD-2014-05.pdf}}.
+%    \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{fithesis3/style/mu/sci}[2015/04/09]
+%    \end{macrocode}
+% Yet to be documented.
+%    \begin{macrocode}
+\def\thesis@preamble{%
+  \thesis@blocks@cover%
+  \thesis@blocks@titlePage%
+  \thesis@blocks@frontMatter%
+    %\thesis@blocks@bibEntry   % TODO
+    %\thesis@blocks@bibEntryEn % TODO
+    \thesis@blocks@abstract%
+    \thesis@blocks@abstractEn%
+    \thesis@blocks@assignment%
+    \thesis@blocks@thanks%
+    \thesis@blocks@declaration%
+    \thesis@blocks@tables%
+  \thesis@blocks@mainMatter%
+}
+%    \end{macrocode}
+% \iffalse
+%</base>
+%<*bbx>
+% \fi\file{style/mu/sci.bbx}
+% This style file defines the \textsc{Bib}\LaTeX\ style file used
+% to typeset the |\thesis@blocks@bibEntry| and
+% |\thesis@blocks@bibEntryEn| blocks based on the data from the
+% \texttt{\jobname.bib} file generated as a part of the main
+% routine (see section \ref{sec:thesis@load}).
+%    \begin{macrocode}
+\ProvidesFile{sci.bbx}[2015/04/10]
+%    \end{macrocode}
+% \iffalse
+%</bbx>
+% \fi
diff --git a/style/mu/sci.ins b/style/mu/sci.ins
new file mode 100644
index 0000000..912e8e7
--- /dev/null
+++ b/style/mu/sci.ins
@@ -0,0 +1,4 @@
+\input ../../docstrip.cfg
+\generate{\file{sci.sty}{\from{sci.dtx}{base}}
+          \file{sci.bbx}{\from{sci.dtx}{bbx}}}
+\endbatchfile
-- 
GitLab