summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls')
-rw-r--r--macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls451
1 files changed, 205 insertions, 246 deletions
diff --git a/macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls b/macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls
index e353bdeca0..102a7e0bcc 100644
--- a/macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls
+++ b/macros/latex/contrib/univie-ling/tex/univie-ling-expose.cls
@@ -32,185 +32,145 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{univie-ling-expose}[2022/06/18 v1.19 Univie Linguistic Exposes (JSp)]
+\ProvidesPackage{univie-ling-expose}[2022/10/02 v.2.0 Univie Linguistic Exposes (JSp)]
%% ============================================================
%% CLASS OPTIONS
%% ============================================================
-\RequirePackage{xkeyval}
-
-\newif\ifbiblatex\biblatextrue
-\newif\ifapa\apafalse
-\newif\ifcaptionp\captionptrue
-\newif\ifdraftmark\draftmarkfalse
-\newif\ifdraftmarkfp\draftmarkfpfalse
-\newif\ifrefsp\refsptrue
-\newif\ifcovington\covingtontrue
-\newif\ifmicrotype\microtypetrue
-\newif\ifpolyglossia\polyglossiafalse
-\newif\ifpsfonts\psfontstrue
-\newif\ifotffonts\otffontsfalse
-\newif\ifnofonts\nofontsfalse
-
-% all=<true|false>
-% Load all packages
-\define@boolkey+{uvt}{all}[true]{%
- \ifKV@uvt@all
- \biblatextrue
- \captionptrue
- \refsptrue
- \covingtontrue
- \microtypetrue
- \else
- \biblatexfalse
- \captionpfalse
- \refspfalse
- \covingtonfalse
- \microtypefalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown 'all' value}%
-}
-
-% biblatex=<true|false>
-% Load biblatex
-\define@boolkey+{uvt}{biblatex}[true]{%
- \ifKV@uvt@biblatex
- \biblatextrue
- \else
- \biblatexfalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown biblatex value}%
-}
-
-% apa=<true|false>
-% Load APA style
-\define@boolkey+{uvt}{apa}[true]{%
- \ifKV@uvt@apa
- \apatrue
- \else
- \apafalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown apa value}%
-}
-
-% caption=<true|false>
-% Load caption
-\define@boolkey+{uvt}{caption}[true]{%
- \ifKV@uvt@caption
- \captionptrue
- \else
- \captionpfalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown caption value}%
-}
-
-% ref=<true|false>
-% Load varioref and prettyref
-\define@boolkey+{uvt}{ref}[true]{%
- \ifKV@uvt@ref
- \refsptrue
- \else
- \refspfalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown ref value}%
-}
-
-% covington=<true|false>
-% Load covington
-\define@boolkey+{uvt}{covington}[true]{%
- \ifKV@uvt@covington
- \covingtontrue
- \else
- \covingtonfalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown covington value}%
-}
-
-% draftmark=<true|false>
-% Print draftmark
-\define@choicekey*+{uvt}{draftmark}[\val\nr]{true,false,firstpage}{%
- \ifcase\nr\relax% true:
- \draftmarktrue
- \draftmarkfpfalse
- \or% false:
- \draftmarkfalse
- \draftmarkfpfalse
- \or% firstpage:
- \draftmarktrue
- \draftmarkfptrue
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown draft value}%
+\newif\if@uve@biblatex\@uve@biblatextrue
+\newif\if@uve@apa\@uve@apafalse
+\newif\if@uve@captionp\@uve@captionptrue
+\newif\if@uve@draftmark\@uve@draftmarkfalse
+\newif\if@uve@draftmarkfp\@uve@draftmarkfpfalse
+\newif\if@uve@refsp\@uve@refsptrue
+\newif\if@uve@covington\@uve@covingtontrue
+\newif\if@uve@microtype\@uve@microtypetrue
+\newif\if@uve@polyglossia\@uve@polyglossiafalse
+\newif\if@uve@psfonts\@uve@psfontstrue
+\newif\if@uve@otffonts\@uve@otffontsfalse
+\newif\if@uve@usefontenc\@uve@usefontenctrue
+\def\uve@fontenc{T1}
+
+% We use l3keys here since (1) LaTeX2e keys are rather
+% new and (2) do not provide for choice keys yet.
+\ExplSyntaxOn
+\keys_define:nn { uve }
+{
+ % all=<true|false>
+ % Load all (most) packages
+ all.code:n =
+ { \bool_if:nTF {#1} {
+ \@uve@biblatextrue
+ \@uve@captionptrue
+ \@uve@refsptrue
+ \@uve@covingtontrue
+ \@uve@microtypetrue
+ }{
+ \@uve@biblatexfalse
+ \@uve@captionpfalse
+ \@uve@refspfalse
+ \@uve@covingtonfalse
+ \@uve@microtypefalse
+ }
+ },
+ all.usage:n = preamble,
+ % apa=<true|false>
+ % Load APA style
+ apa.legacy_if_set:n = @uve@apa,
+ apa.usage:n = preamble,
+ % biblatex=<true|false>
+ % Load biblatex
+ biblatex.legacy_if_set:n = @uve@biblatex,
+ biblatex.usage:n = preamble,
+ % caption=<true|false>
+ % Load caption
+ caption.legacy_if_set:n = @uve@captionp,
+ caption.usage:n = preamble,
+ % covington=<true|false>
+ % Load covington
+ covington.legacy_if_set:n = @uve@covington,
+ covington.usage:n = preamble,
+ % fontenc=<value|none>
+ % customize font encoding
+ fontenc.code:n =
+ { \str_if_eq:NNTF { #1 } { none } {
+ \@uve@usefontencfalse
+ }{
+ \def\uve@fontenc{#1}
+ }
+ },
+ fontenc.usage:n = preamble,
+ % microtype=<true|false>
+ % Load microtype
+ microtype.legacy_if_set:n = @uve@microtype,
+ microtype.usage:n = preamble,
+ % polyglossia=<true|false>
+ % Load polyglossia
+ polyglossia.legacy_if_set:n = @uve@polyglossia,
+ polyglossia.code:n =
+ { \bool_if:nT {#1} {
+ \@uve@psfontsfalse
+ \@uve@otffontstrue
+ }
+ },
+ polyglossia.usage:n = preamble,
+ % ref=<true|false>
+ % Load varioref and prettyref
+ ref.legacy_if_set:n = @uve@refsp,
+ ref.usage:n = preamble,
+ % draftmark=<true|false|firstpage>
+ % Print draftmark
+ draftmark .choice:,
+ % true
+ draftmark / true .code:n =
+ { \@uve@draftmarktrue
+ \@uve@draftmarkfpfalse
+ },
+ % false
+ draftmark / false .code:n =
+ { \@uve@draftmarkfalse
+ \@uve@draftmarkfpfalse
+ },
+ % firstpage
+ draftmark / firstpage .code:n =
+ { \@uve@draftmarktrue
+ \@uve@draftmarkfptrue
+ },
+ % no val equals to true
+ draftmark .default:n = {true},
+ % fonts=<ps|otf|none>
+ % Select font scheme
+ fonts .choice:,
+ % ps: use PostScript fonts (classic LaTeX)
+ fonts / ps .code:n =
+ { \@uve@psfontstrue
+ \@uve@otffontsfalse
+ },
+ % otf: use OpenType fonts (fontspec)
+ fonts / otf .code:n =
+ { \@uve@psfontsfalse
+ \@uve@otffontstrue
+ },
+ % none: Use no font package
+ fonts / none .code:n =
+ { \@uve@psfontsfalse
+ \@uve@otffontsfalse
+ },
}
+\ExplSyntaxOff
-% microtype=<true|false>
-% Load microtype
-\define@boolkey+{uvt}{microtype}[true]{%
- \ifKV@uvt@microtype
- \microtypetrue
- \else
- \microtypefalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown microtype value}%
-}
-
-% polyglossia=<true|false>
-% Load polyglossia
-\define@boolkey+{uvt}{polyglossia}[true]{%
- \ifKV@uvt@polyglossia
- \polyglossiatrue
- \psfontsfalse
- \otffontstrue
- \nofontsfalse
- \else
- \polyglossiafalse
- \fi
-}{%
- \ClassWarning{univie-ling-expose}{unknown polyglossia value}%
-}
-
-% fonts=<ps|otf|none>
-\define@choicekey*+{uvt}{fonts}[\val\nr]{ps,otf,none}{%
- \ifcase\nr\relax% ps: use PostScript fonts (classic LaTeX)
- \psfontstrue
- \otffontsfalse
- \nofontsfalse
- \or% otf: use OpenType fonts (fontspec)
- \psfontsfalse
- \otffontstrue
- \nofontsfalse
- \or% none: Use no font package
- \psfontsfalse
- \otffontsfalse
- \nofontstrue
- \fi
-}{%
- \PackageWarning{univie-ling-expose}{unknown fonts value '#1'}%
-}
+% Process
-% fontenc=<value|false>
-% customize font encoding
-\newif\ifuniv@usefontenc\univ@usefontenctrue
-\def\univ@fontenc{T1}
-\define@choicekey*+{uvt}{fontenc}[\val\nr]{none}{%
- \ifcase\nr\relax% none:
- \univ@usefontencfalse
- \fi
-}{%
- \def\univ@fontenc{#1}%
+\IfFormatAtLeastTF{2022-06-01}
+{
+ \ProcessKeyOptions[uve]
+}{
+ \RequirePackage{l3keys2e}
+ \ProcessKeysOptions{uve}
}
-% Process
-\ProcessOptionsX<uvt>
%% ============================================================
%% BASE CLASS:
@@ -232,43 +192,44 @@
%% LOCALIZATION:
%% ============================================================
-\RequirePackage{translations}
-\DeclareTranslation{German}{draft}{ENTWURF}
-\DeclareTranslation{English}{draft}{DRAFT}
-\DeclareTranslation{German}{section}{Abschnitt}
-\DeclareTranslation{English}{section}{section}
-\DeclareTranslation{German}{footnote}{Anm.}
-\DeclareTranslation{English}{footnote}{fn.}
-\DeclareTranslation{German}{example}{Beispiel}
-\DeclareTranslation{English}{example}{example}
-\DeclareTranslation{German}{stkz}{Studienkennzahl lt. Studienblatt}
-\DeclareTranslation{English}{stkz}{Degree programme code as it appears on the student record sheet}
-\DeclareTranslation{German}{strt}{Studienrichtung lt. Studienblatt}
-\DeclareTranslation{English}{strt}{Degree programme as it appears on the student record sheet}
-\DeclareTranslation{German}{expo}{Expos\'e zum Dissertationsprojekt}
-\DeclareTranslation{English}{expo}{Research Proposal}
-\DeclareTranslation{German}{tpcaption}{Titel des Dissertationsprojekts}
-\DeclareTranslation{English}{tpcaption}{Title of the Dissertation Project}
-\DeclareTranslation{German}{author}{Verfasst von}
-\DeclareTranslation{English}{author}{Submitted by}
-\DeclareTranslation{German}{vienna}{Wien}
-\DeclareTranslation{English}{vienna}{Vienna}
-\DeclareTranslation{German}{supervisor}{Betreut von}
-\DeclareTranslation{English}{supervisor}{Supervisor}
-\DeclareTranslation{German}{cosupervisor}{Mitbetreut von}
-\DeclareTranslation{English}{cosupervisor}{Co-Supervisor}
-\DeclareTranslation{German}{beirat}{Beirat}
-\DeclareTranslation{English}{beirat}{Advisory board}
+\RequirePackage{translator}
+\languagealias{naustrian}{German}
+\deftranslation[to=German]{draft}{ENTWURF}
+\deftranslation[to=English]{draft}{DRAFT}
+\deftranslation[to=German]{section}{Abschnitt}
+\deftranslation[to=English]{section}{section}
+\deftranslation[to=German]{footnote}{Anm.}
+\deftranslation[to=English]{footnote}{fn.}
+\deftranslation[to=German]{example}{Beispiel}
+\deftranslation[to=English]{example}{example}
+\deftranslation[to=German]{stkz}{Studienkennzahl lt. Studienblatt}
+\deftranslation[to=English]{stkz}{Degree programme code as it appears on the student record sheet}
+\deftranslation[to=German]{strt}{Studienrichtung lt. Studienblatt}
+\deftranslation[to=English]{strt}{Degree programme as it appears on the student record sheet}
+\deftranslation[to=German]{expo}{Expos\'e zum Dissertationsprojekt}
+\deftranslation[to=English]{expo}{Research Proposal}
+\deftranslation[to=German]{tpcaption}{Titel des Dissertationsprojekts}
+\deftranslation[to=English]{tpcaption}{Title of the Dissertation Project}
+\deftranslation[to=German]{author}{Verfasst von}
+\deftranslation[to=English]{author}{Submitted by}
+\deftranslation[to=German]{vienna}{Wien}
+\deftranslation[to=English]{vienna}{Vienna}
+\deftranslation[to=German]{supervisor}{Betreut von}
+\deftranslation[to=English]{supervisor}{Supervisor}
+\deftranslation[to=German]{cosupervisor}{Mitbetreut von}
+\deftranslation[to=English]{cosupervisor}{Co-Supervisor}
+\deftranslation[to=German]{beirat}{Beirat}
+\deftranslation[to=English]{beirat}{Advisory board}
%% ============================================================
%% FONTS AND EMPHASIZING:
%% ============================================================
-\ifpsfonts
+\if@uve@psfonts
-\ifuniv@usefontenc
- \RequirePackage[\univ@fontenc]{fontenc}
+\if@uve@usefontenc
+ \RequirePackage[\uve@fontenc]{fontenc}
\fi
% Times
@@ -286,7 +247,7 @@
\fi
-\ifotffonts
+\if@uve@otffonts
\RequirePackage{fontspec}
\setmainfont{Times New Roman}
\setsansfont{Arial}
@@ -380,7 +341,7 @@
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\RequirePackage{scrlayer-scrpage}
\renewcommand{\headfont}{\small\rmfamily}
-\clearscrheadings
+\clearmainofpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\automark{section}
@@ -398,8 +359,8 @@
\raggedbottom
% Micro-typographic polishment
-\ifmicrotype
-\usepackage{microtype}
+\if@uve@microtype
+ \RequirePackage{microtype}
\fi
% Smart quotes
@@ -415,8 +376,8 @@
% Month name
\RequirePackage[ngerman,english]{datetime2}
-\DeclareTranslation{German}{monthyear}{\DTMgermanmonthname{\@dtm@month} \@dtm@year}
-\DeclareTranslation{English}{monthyear}{\DTMenglishmonthname{\@dtm@month} \@dtm@year}
+\deftranslation[to=German]{monthyear}{\DTMgermanmonthname{\@dtm@month} \@dtm@year}
+\deftranslation[to=English]{monthyear}{\DTMenglishmonthname{\@dtm@month} \@dtm@year}
\renewcommand*\maketitle[1][1]{%
\newgeometry{top=2cm,bottom=2.5cm,left=2.5cm,right=2cm}
@@ -474,11 +435,11 @@
\end{flushright}
\vspace{2\baselineskip}
\begin{center}
- {\usekomafont{thesistype}\GetTranslation{expo}}
+ {\usekomafont{thesistype}\translate{expo}}
\end{center}
\vspace{2\baselineskip}
\begin{center}
- {\usekomafont{tpcaption}\GetTranslation{tpcaption}\par}
+ {\usekomafont{tpcaption}\translate{tpcaption}\par}
{\ifx\@title\@empty\else
\usekomafont{title}{\enquote{\@title%
\ifx\@subtitle\@empty\else\linebreak\@subtitle\fi}\par}%
@@ -486,7 +447,7 @@
}
\vskip 2em
{%
- {\usekomafont{tpcaption}\GetTranslation{author}\par}
+ {\usekomafont{tpcaption}\translate{author}\par}
\usekomafont{author}{%
\lineskip 0.75em%
\begin{tabular}[t]{c}
@@ -496,19 +457,19 @@
}%
\end{center}\par
\vfill
- {\usekomafont{date}{\GetTranslation{vienna}, \GetTranslation{monthyear}\par}}%
+ {\usekomafont{date}{\translate{vienna}, \translate{monthyear}\par}}%
\vskip 2em
\usekomafont{codes}{%
\begin{tabular}[t]{@{}>{\raggedright}p{0.4\columnwidth}>{\raggedright}p{0.1\columnwidth}>{\raggedright}p{0.4\columnwidth}}
- \GetTranslation{stkz}: & & \@studienkennzahl\tabularnewline
+ \translate{stkz}: & & \@studienkennzahl\tabularnewline
\noalign{\vskip6pt}
- \GetTranslation{strt}: & & \@studienrichtung\tabularnewline
+ \translate{strt}: & & \@studienrichtung\tabularnewline
\noalign{\vskip6pt}
- \GetTranslation{supervisor}: & & \@supervisor\tabularnewline%
+ \translate{supervisor}: & & \@supervisor\tabularnewline%
\noalign{\vskip6pt}
- \ifx\@cosupervisor\@empty\else\GetTranslation{cosupervisor}: & & \@cosupervisor\tabularnewline\fi
+ \ifx\@cosupervisor\@empty\else\translate{cosupervisor}: & & \@cosupervisor\tabularnewline\fi
\noalign{\vskip6pt}
- \ifx\@beirat\@empty\else\GetTranslation{beirat}: & & \@beirat\fi
+ \ifx\@beirat\@empty\else\translate{beirat}: & & \@beirat\fi
\end{tabular}\par
}
\par
@@ -595,21 +556,19 @@
\def\labelitemi{--}
% Quote (smaller)
-\newcommand*{\OriginalQuote}{}
-\let\OriginalQuote\quote
-\renewcommand*{\quote}{\OriginalQuote\small}
+\let\@uve@save@quote\quote
+\renewcommand*{\quote}{\@uve@save@quote\small}
% Quotation (smaller)
-\newcommand*{\OriginalQuotation}{}
-\let\OriginalQuotation\quotation
-\renewcommand*{\quotation}{\OriginalQuotation\small}
+\let\@uve@save@quotation\quotation
+\renewcommand*{\quotation}{\@uve@save@quotation\small}
% Description (normal italic)
\setkomafont{descriptionlabel}{\normalfont\itshape}
-\ifcovington
-\RequirePackage{covington}
-\renewcommand{\p@equation}[1]{(#1)}
+\if@uve@covington
+ \RequirePackage{covington}
+ \renewcommand{\p@equation}[1]{(#1)}
\fi
%% =============================================================
@@ -619,19 +578,19 @@
%% captionlabel bold
\setkomafont{captionlabel}{\bfseries}
-\ifcaptionp
-\RequirePackage[format=plain,
- justification=RaggedRight,
- singlelinecheck=false
- ]{caption}
+\if@uve@captionp
+ \RequirePackage[format=plain,
+ justification=RaggedRight,
+ singlelinecheck=false
+ ]{caption}
\fi
%% =============================================================
%% POLYGLOSSIA:
%% =============================================================
-\ifpolyglossia
- \ifcaptionp
+\if@uve@polyglossia
+ \if@uve@captionp
\RequirePackage{ragged2e}
\fi
\RequirePackage{polyglossia}
@@ -642,9 +601,9 @@
%% =============================================================
% Biblatex
-\ifbiblatex
+\if@uve@biblatex
-\ifapa
+\if@uve@apa
% Load biblatex with apa style
\RequirePackage[%
style=apa,
@@ -707,10 +666,10 @@
% Change cite command for integrated csquotes env.
\SetCiteCommand{\parencite}
-% End of apa condition
+% End of @uve@apa condition
\fi
-% End of biblatex condition
+% End of @uve@biblatex condition
\fi
%% =============================================================
@@ -719,9 +678,9 @@
\let\origtableofcontents\tableofcontents
\renewcommand*\tableofcontents{%
-\thispagestyle{plain}
-\origtableofcontents
-\clearpage
+ \thispagestyle{plain}
+ \origtableofcontents
+ \clearpage
}
@@ -729,7 +688,7 @@
%% X-REFS:
%% =============================================================
-\ifrefsp
+\if@uve@refsp
\AtBeginDocument{%
% Varioref:
@@ -739,19 +698,19 @@
\def\reftextfaceafter{auf der gegen\"uberliegenden Seite}%
\def\reftextbefore{auf der \reftextvario{vorhergehenden}{vorangegangenen} Seite}%
\def\reftextfacebefore{auf der gegen\"uberliegenden Seite}%
- \def\reftextfaraway[1]{auf S.~\pageref{##1}}%
- \def\reftextpagerange[2]{auf S.~\pageref{##1}--\pageref{##2}}%
+ \def\reftextfaraway#1{auf S.~\pageref{#1}}%
+ \def\reftextpagerange#1#2{auf S.~\pageref{#1}--\pageref{#2}}%
}%
% Prettyref:
% (varioref-Befehle mit eingebunden)
\RequirePackage{prettyref}
- \newrefformat{sec}{\GetTranslation{section}~\ref{#1}}
- \newrefformat{sub}{\GetTranslation{section}~\ref{#1}}
- \newrefformat{anm}{\GetTranslation{footnote}~\ref{#1}}
+ \newrefformat{sec}{\translate{section}~\ref{#1}}
+ \newrefformat{sub}{\translate{section}~\ref{#1}}
+ \newrefformat{anm}{\translate{footnote}~\ref{#1}}
\newrefformat{app}{\appendixname~\vref{#1}}
\newrefformat{tab}{\tablename~\vref{#1}}
\newrefformat{fig}{\figurename~\vref{#1}}
- \newrefformat{exa}{\GetTranslation{example}~\vref{#1}}
+ \newrefformat{exa}{\translate{example}~\vref{#1}}
}
\fi
@@ -761,9 +720,9 @@
%% DRAFT:
%% =============================================================
-\ifdraftmark
+\if@uve@draftmark
-\ifdraftmarkfp
+\if@uve@draftmarkfp
\RequirePackage[firstpageonly]{draftwatermark}
\else
\RequirePackage{draftwatermark}
@@ -774,7 +733,7 @@
vpos=10pt,
anchor=ct,
fontsize=14pt,
- text={\GetTranslation{draft} (\today)}
+ text={\translate{draft} (\today)}
}
\fi