summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fithesis/fithesis.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-11-19 22:40:04 +0000
committerKarl Berry <karl@freefriends.org>2015-11-19 22:40:04 +0000
commitc97eafc789593a5348cff6033c58c3bfb0beab19 (patch)
tree82eff5de594cf23b8184ae8791391bb1bfb861c1 /Master/texmf-dist/source/latex/fithesis/fithesis.dtx
parent52b5b5df295683036612072db256172356408bf9 (diff)
fithesis (19nov15)
git-svn-id: svn://tug.org/texlive/trunk@38893 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fithesis/fithesis.dtx')
-rw-r--r--Master/texmf-dist/source/latex/fithesis/fithesis.dtx145
1 files changed, 101 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/latex/fithesis/fithesis.dtx b/Master/texmf-dist/source/latex/fithesis/fithesis.dtx
index 7655b94d4b0..ad5fc26dec9 100644
--- a/Master/texmf-dist/source/latex/fithesis/fithesis.dtx
+++ b/Master/texmf-dist/source/latex/fithesis/fithesis.dtx
@@ -14,6 +14,8 @@
\usepackage[T1]{fontenc} % use 8bit fonts
\emergencystretch 2dd
\usepackage{hypdoc}
+\usepackage{microtype}
+\usepackage{ragged2e}
% Making paragraphs numbered
\makeatletter
@@ -38,6 +40,7 @@
\RecordChanges
\DocInput{fithesis.dtx}
\PrintIndex
+ \RaggedRight
\PrintChanges
\end{document}
@@ -46,11 +49,28 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}
% Define `\thesis@version` and store it in the `VERSION.tex` file \fi
-\def\thesis@version{2015/10/14 v0.3.23 fithesis3 MU thesis class}
+\def\thesis@version{2015/11/17 v0.3.24 fithesis3 MU thesis class}
% {\newwrite\f\openout\f=VERSION\write\f{\thesis@version}\closeout\f}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+% \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
@@ -165,7 +185,7 @@
% 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,
+% 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]}
@@ -238,12 +258,28 @@
% \tableofcontents
%
% \section{Required classes and packages}
-% The class loads the \texttt{rapport3} base class and the
-% following packages: \begin{itemize}
+% \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}
@@ -257,10 +293,9 @@
% \ref{sec:thesis@load}). Other packages may be required by the
% style files (see Section \ref{sec:style-files}) you are using.
% \begin{macrocode}
-\ProvidesClass{fithesis3}[\thesis@version]
-\LoadClass[a4paper]{rapport3}
\RequirePackage{keyval}
\RequirePackage{etoolbox}
+\RequirePackage{ltxcmds}
\RequirePackage{ifxetex}
\RequirePackage{ifluatex}
\ifxetex\else\ifluatex\else
@@ -273,7 +308,9 @@
% 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.
+% 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}
@@ -772,7 +809,7 @@
% \end{macro}
% \subsubsection{The \texttt{date} key}
% The \marg{\texttt{date}=date} pair sets the date of the thesis
-% defence to \textit{date}, where \textit{date} is a string
+% 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
@@ -790,40 +827,43 @@
% \item\DescribeMacro{\thesis@season}|\thesis@season| -- Expands
% to either:
% \begin{itemize}
-% \item\texttt{winter} if \texttt{MM} $<7$.
-% \item\texttt{summer} if \texttt{MM} $\geq7$.
+% \item\texttt{spring} if $2>{}$\texttt{MM}${}<9$,
+% \item\texttt{fall} if $2\leq{}$\texttt{MM}${}\geq9$.
% \end{itemize}
% \item\DescribeMacro{\thesis@academicYear}|\thesis@academicYear|
% -- The academic year of the given semester:
% \begin{itemize}
-% \item\texttt{YYYY/YYYY}$+1$ in case of a summer semester
-% \item\texttt{YYYY}$-1$\texttt{/YYYY} in case of a winter
-% semester
+% \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.
+% string, which equals the current date.
% \begin{macrocode}
\def\thesis@parseDate#1/#2/#3|{{
- % Basic info
+ % Set the basic macros
\gdef\thesis@date{#1/#2/#3}%
\gdef\thesis@year{#1}%
\gdef\thesis@month{#2}%
\gdef\thesis@day{#3}%
- % Season and academic year
- \newcount\@year \expandafter\@year \thesis@year \relax%
- \newcount\@month\expandafter\@month\thesis@month\relax%
- \ifnum\@month<7%
- \gdef\thesis@season{winter}%
- \advance\@year-1\edef\@yearA{\the\@year}%
- \advance\@year 1\edef\@yearB{\the\@year}%
- \else%
- \gdef\thesis@season{summer}%
+ % 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}%
- \fi%
+ \else
+ \advance\@year-1\edef\@yearA{\the\@year}%
+ \advance\@year 1\edef\@yearB{\the\@year}%
+ \fi
\global\edef\thesis@academicYear{\@yearA/\@yearB}}}
\edef\thesis@date{\the\year/\the\month/\the\day}%
@@ -1067,13 +1107,17 @@
\makeatletter%
% \end{macrocode}
% First, the main locale is selected and its files are loaded using
-% the |\thesis@selectLocale| macro.
+% the |\thesis@selectLocale| macro. If the user specified an
+% explicit empty string as the value of |\thesis@locale|, do
+% nothing.
% \begin{macrocode}
\ifx\thesis@locale\empty\else
+ \thesis@requireLocale{\thesis@locale}
\thesis@selectLocale{\thesis@locale}
\fi
% \end{macrocode}
-% Consequently, the style files are loaded.
+% 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}
@@ -1176,7 +1220,7 @@
% \end{macrocode}
% \end{macro}\begin{macro}{\thesis@requireLocale}
% If inheritance is enabled for style files, then the
-% |\thesis@requireStyle|\marg{locale} macro sequentially
+% |\thesis@requireLocale|\marg{locale} macro sequentially
% loads each of the following locale files, provided they exist:
% \begin{enumerate}
% \item|\thesis@localepath fithesis-|\textit{locale}|.def|
@@ -1194,19 +1238,24 @@
% The macro can be used within both locale and style files,
% although the usage within locale files is strongly discouraged to
% prevent circular dependencies.
+%
+% If the \textsf{polyglossia} package is being used, its
+% definitions for the respective locale get loaded as well. As a
+% consequence, this command may not be used within the document,
+% but only in the preamble.
% \begin{macrocode}
\def\thesis@requireLocale#1{%
% Ignore redundant requests
\expandafter\ifx\csname thesis@#1@required\endcsname\relax%
\expandafter\def\csname thesis@#1@required\endcsname{}%
- {\makeatletter % Enable requiring from within the document
- \thesis@input{\thesis@localepath fithesis-#1.def}%
- \ifthesis@locale@inheritance%
- \thesis@input{\thesis@localepath\thesis@university/%
- fithesis-#1.def}%
- \thesis@input{\thesis@localepath\thesis@university/%
- \thesis@faculty/fithesis-#1.def}%
- \fi}
+ \@ifpackageloaded{polyglossia}{\setotherlanguage{#1}}{}
+ \thesis@input{\thesis@localepath fithesis-#1.def}%
+ \ifthesis@locale@inheritance%
+ \thesis@input{\thesis@localepath\thesis@university/%
+ fithesis-#1.def}%
+ \thesis@input{\thesis@localepath\thesis@university/%
+ \thesis@faculty/fithesis-#1.def}%
+ \fi
\fi}
% \end{macrocode}\end{macro}
% \subsection{String manipulation macros}
@@ -1291,13 +1340,21 @@
% \end{macrocode}
% \DescribeMacro{\thesis@selectLocale}|\thesis@selectLocale|\marg{locale}
% macro redefines the |\thesis@locale| macro to \textit{locale},
-% loads the locale files of \textit{locale} and switches to the
-% hyphenation patterns of \textit{locale}.
+% and switches to the hyphenation patterns of \textit{locale}. The
+% respective locale files and polyglossia locale definitions should
+% be loaded beforehand using the |\thesis@requireLocale| macro.
+%
+% This macro should always be used within a group, so that the
+% locale settings and the hyphenation return back to what the user
+% has specified after the localized block of typographic material.
% \begin{macrocode}
\def\thesis@selectLocale#1{%
\edef\thesis@locale{#1}%
- \thesis@requireLocale{\thesis@locale}%
- \expandafter\language\csname l@\thesis@locale\endcsname}
+ \ltx@ifpackageloaded{polyglossia}{%
+ \selectlanguage{\thesis@locale}
+ }{%
+ \language\csname l@\thesis@locale\endcsname
+ }}
% \end{macrocode}
% \iffalse
%</class>
@@ -1380,10 +1437,10 @@
% of the declaration section
% \item|\thesis@|\textit{locale}|@idTitle| -- The title of the
% thesis author's identifier field
-% \item|\thesis@|\textit{locale}|@winter| -- The name of the
-% winter semester
-% \item|\thesis@|\textit{locale}|@summer| -- The name of the
-% summer semester
+% \item|\thesis@|\textit{locale}|@spring| -- The name of the
+% spring semester
+% \item|\thesis@|\textit{locale}|@fall| -- The name of the
+% fall semester
% \item|\thesis@|\textit{locale}|@semester| -- The full name of
% the current semester
% \item|\thesis@|\textit{locale}|@typeName| -- The name of the