summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls')
-rw-r--r--macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls371
1 files changed, 184 insertions, 187 deletions
diff --git a/macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls b/macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls
index 3d5259d1cc..1be6bd1ccc 100644
--- a/macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls
+++ b/macros/latex/contrib/univie-ling/tex/univie-ling-wlg.cls
@@ -33,97 +33,75 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{univie-ling-wlg}[2022/05/30 v1.19 WLG journal layout (JSp)]
+\ProvidesPackage{univie-ling-wlg}[2022/10/02 v.2.0 Univie WLG journal layout (JSp)]
%% ============================================================
%% CLASS OPTIONS:
%% ============================================================
-\RequirePackage{xkeyval}
-
-\newif\ifbiblatex\biblatexfalse
-\newif\ifcovington\covingtontrue
-\newif\ifexpert\expertfalse
-
-% biblatex=<true|false>
-% Load biblatex
-\define@boolkey+{wlg}{biblatex}[true]{%
- \ifKV@wlg@biblatex
- \biblatextrue
- \else
- \biblatexfalse
- \fi
-}{%
- \ClassWarning{univie-ling-wlg}{unknown biblatex value}%
-}
-\DeclareOptionX{biblatex}{\setkeys{wlg}{biblatex=#1}}
-
-% covington=<true|false>
-% Load covington
-\define@boolkey+{wlg}{covington}[true]{%
- \ifKV@wlg@covington
- \covingtontrue
- \else
- \covingtonfalse
- \fi
-}{%
- \ClassWarning{univie-ling-wlg}{unknown covington value}%
-}
-\DeclareOptionX{covington}{\setkeys{wlg}{covington=#1}}
-
-
-% expertfonts=<true|false>
-% Load MinionPro
-\define@boolkey+{wlg}{expertf}[true]{%
- \ifKV@wlg@expertf
- \experttrue
- \else
- \expertfalse
- \fi
-}{%
- \ClassWarning{univie-ling-wlg}{unknown expertfonts value}%
-}
-\DeclareOptionX{expertfonts}{\setkeys{wlg}{expertf=#1}}
-
-% Titlepage?
-\newif\iftitlepage\titlepagefalse
-\newif\ifspecialprint\specialprintfalse
-\define@choicekey*+{wlg}{ttp}[\val\nr]{none,specialprint,issue}{%
- \ifcase\nr\relax% none
- \titlepagefalse
- \or% specialprint:
- \titlepagetrue
- \specialprinttrue
- \or% issue:
- \titlepagetrue
- \specialprintfalse
- \fi
-}{%
- \ClassWarning{univie-ling-wlg}{unknown titlepage value '#1'}%
-}
-\DeclareOptionX{titlepage}{\setkeys{wlg}{ttp=#1}}
-
-% preprint=<true|false>
-\define@boolkey+{wlg}{preprint}[true]{%
-}{%
- \ClassWarning{univie-ling-wlg}{unknown preprint value}%
+\newif\if@wlg@biblatex\@wlg@biblatexfalse
+\newif\if@wlg@covington\@wlg@covingtontrue
+\newif\if@wlg@expert\@wlg@expertfalse
+\newif\if@wlg@titlepage\@wlg@titlepagefalse
+\newif\if@wlg@specialprint\@wlg@specialprintfalse
+
+% We use l3keys here since (1) LaTeX2e keys are rather
+% new and (2) do not provide for choice keys yet.
+\ExplSyntaxOn
+\keys_define:nn { wlg }
+{
+ % biblatex=<true|false>
+ % Load biblatex
+ biblatex.legacy_if_set:n = @wlg@biblatex,
+ biblatex.usage:n = preamble,
+ % covington=<true|false>
+ % Load covington
+ covington.legacy_if_set:n = @wlg@covington,
+ covington.usage:n = preamble,
+ % expertfonts=<true|false>
+ % Load MinionPro
+ expertfonts.legacy_if_set:n = @wlg@expert,
+ expertfonts.usage:n = preamble,
+ % preprint=<true|false>
+ preprint.legacy_if_set:n = @wlg@preprint,
+ preprint.usage:n = preamble,
+ % peerrev=<true|false>
+ peerrev.legacy_if_set:n = @wlg@peerrev,
+ peerrev.usage:n = preamble,
+ % titlepage=<none|specialprint|issue>
+ titlepage .choice:,
+ % none
+ titlepage / none .code:n =
+ { \@wlg@titlepagefalse
+ \@wlg@specialprintfalse
+ },
+ % specialprint
+ titlepage / specialprint .code:n =
+ { \@wlg@titlepagetrue
+ \@wlg@specialprinttrue
+ },
+ % issue
+ titlepage / issue .code:n =
+ { \@wlg@titlepagetrue
+ \@wlg@specialprintfalse
+ },
+}
+\ExplSyntaxOff
+
+\IfFormatAtLeastTF{2022-06-01}
+{
+ \ProcessKeyOptions[wlg]
+}{
+ \RequirePackage{l3keys2e}
+ \ProcessKeysOptions{wlg}
}
-\DeclareOptionX{preprint}{\setkeys{wlg}{preprint=#1}}
-% peerrev=<true|false>
-\define@boolkey+{wlg}{peerrev}[true]{%
-}{%
- \ClassWarning{univie-ling-wlg}{unknown peerrev value}%
-}
-\DeclareOptionX{peerrev}{\setkeys{wlg}{peerrev=#1}}
-
-\DeclareOption*{%
-\PassOptionsToClass{\CurrentOption}{scrartcl}%
-}
-\ProcessOptionsX
+%% ============================================================
+%% BASE CLASS:
+%% ============================================================
\LoadClass{scrartcl}[2003/04/22]
@@ -140,9 +118,7 @@
abstract=on,
twoside=semi
}
-\iftitlepage
-\KOMAoptions{titlepage=true}
-\fi
+
\recalctypearea
@@ -162,17 +138,17 @@
%% ============================================================
% Roman Font:
-\ifexpert
-% Adobe Minion (Expert)
-\RequirePackage[footnotefigures]{MinionPro}
+\if@wlg@expert
+ % Adobe Minion (Expert)
+ \RequirePackage[footnotefigures]{MinionPro}
\else
-% Crimson
-\RequirePackage[osf]{cochineal}
-% Enable bold and slanted in IPA
-\AtBeginDocument{%
- \@ifpackageloaded{tipa}{%
- \DeclareFontFamilySubstitution{T3}{Cochineal-TOsF}{cmr}}{}
-}
+ % Crimson
+ \RequirePackage[osf]{cochineal}
+ % Enable bold and slanted in IPA
+ \AtBeginDocument{%
+ \@ifpackageloaded{tipa}{%
+ \DeclareFontFamilySubstitution{T3}{Cochineal-TOsF}{cmr}}{}
+ }
\fi
% Hyperlinks
@@ -204,6 +180,16 @@
\RequirePackage{translator}
\languagealias{naustrian}{German}
+\deftranslation[to=German]{chapter}{Kapitel}
+\deftranslation[to=English]{chapter}{chapter}
+\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]{argumentation}{Argumentation}
+\deftranslation[to=English]{argumentation}{argumentation}
\deftranslation[to=German]{issue}{Ausgabe}
\deftranslation[to=English]{issue}{Issue}
\deftranslation[to=German]{univie}{Universit\"at Wien}
@@ -263,20 +249,20 @@
\AtBeginDocument{%
-\addto\captionsngerman{\renewcommand*\contentsname{Inhalt}}%
-\addto\captionsnaustrian{\renewcommand*\contentsname{Inhalt}}%
-}
-\AtEndPreamble{
-% License
-\PassOptionsToPackage{%
- imagewidth=8em,
- imagedistance=1em,
- imagemodifier=-eu-88x31,
- hyphenation=RaggedRight,
- type={CC},
- modifier={by-nc-nd},
- version={4.0}}{doclicense}
-\RequirePackage{doclicense}
+ \addto\captionsngerman{\renewcommand*\contentsname{Inhalt}}%
+ \addto\captionsnaustrian{\renewcommand*\contentsname{Inhalt}}%
+}
+\AtEndPreamble{%
+ % License
+ \PassOptionsToPackage{%
+ imagewidth=8em,
+ imagedistance=1em,
+ imagemodifier=-eu-88x31,
+ hyphenation=RaggedRight,
+ type={CC},
+ modifier={by-nc-nd},
+ version={4.0}}{doclicense}
+ \RequirePackage{doclicense}
}
\newcommand\impressum{%
@@ -318,7 +304,7 @@
\item[\textbf{\textsc{nbn}:}] BI,078,1063
\end{labeling}
\vspace*{-.5em}
-\ifKV@wlg@peerrev
+\if@wlg@peerrev
\noindent\translate{peerrev}\par\vspace*{.5em}
\fi
\noindent\translate{appform}\par
@@ -344,14 +330,16 @@
%% TOC
%% ============================================================
-\RequirePackage{etoc}
-\etocstandardlines
-\etocsetstyle{chapter}
- {}
- {\normalsize\mdseries\rmfamily}
- {\etocname{}\dotfill\etocpage\par\vspace{12pt}}
- {}
-\setcounter{tocdepth}{0}
+\if@wlg@specialprint\else
+ \RequirePackage{etoc}
+ \etocstandardlines
+ \etocsetstyle{chapter}
+ {}
+ {\normalsize\mdseries\rmfamily}
+ {\etocname{}\dotfill\etocpage\par\vspace{12pt}}
+ {}
+ \setcounter{tocdepth}{0}
+\fi
%% ============================================================
@@ -363,18 +351,18 @@
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\RequirePackage{scrlayer-scrpage}
\renewcommand{\headfont}{\small\rmfamily}
-\clearscrheadings
+\clearmainofpairofpagestyles
\ohead{\pagemark}
\automark{section}
\KOMAoptions{headsepline=true}
\pagestyle{scrheadings}
% Macrotypographic sectioning
-\newif\if@mainmatter\@mainmattertrue
-\newif\if@frontmatter\@frontmatterfalse
+\newif\if@wlg@mainmatter\@wlg@mainmattertrue
+\newif\if@wlg@frontmatter\@wlg@frontmatterfalse
\newcommand*\frontmatter{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi
- \@mainmatterfalse\@frontmattertrue\pagenumbering{roman}%
+ \@wlg@mainmatterfalse\@wlg@frontmattertrue\pagenumbering{roman}%
\edef\computelastpage{%
\romannumeral\numexpr\getpagerefnumber{LastFrontPage}-1\relax}%
\edef\startpageref{%
@@ -383,13 +371,13 @@
\newcommand*\mainmatter{%
\if@twoside\cleardoubleoddpage\else\clearpage\fi%
\immediate\write\@auxout{\noexpand\newlabel{LastFrontPage}{{}{\arabic{page}}}}%
- \@mainmattertrue\@frontmatterfalse%
+ \@wlg@mainmattertrue\@wlg@frontmatterfalse%
\pagenumbering{arabic}%
\def\computelastpage{\pageref{TotPages}}%
\def\startpageref{\thestartpage}%
}
\newcommand*\backmatter{%
- \if@openright\cleardoubleoddpage\else\clearpage\fi\@mainmatterfalse\@frontmatterfalse%
+ \if@openright\cleardoubleoddpage\else\clearpage\fi\@wlg@mainmatterfalse\@wlg@frontmatterfalse%
\def\computelastpage{\pageref{TotPages}}%
\def\startpageref{\thestartpage}%
}
@@ -407,9 +395,9 @@
\AfterPackage*{inputenc}{%
\RequirePackage{csquotes}
\ExecuteQuoteOptions{autostyle=try,german=guillemets,austrian=guillemets,maxlevel=3}
- \ifbiblatex
- % Change cite command for integrated csquotes env.
- \SetCiteCommand{\parencite}
+ \if@wlg@biblatex
+ % Change cite command for integrated csquotes env.
+ \SetCiteCommand{\parencite}
\fi
\renewcommand{\mktextdel}[1]{[\,]}
}
@@ -431,12 +419,14 @@
\RequirePackage{xcolor}
\RequirePackage{graphicx}
-\RequirePackage{hyperref}
-\hypersetup{%
-bookmarksnumbered=true,
-breaklinks=true,
-colorlinks=false,
-pdfborder={0 0 0}
+\AtEndOfClass{%
+ \RequirePackage{hyperref}
+ \hypersetup{%
+ bookmarksnumbered=true,
+ breaklinks=true,
+ colorlinks=false,
+ pdfborder={0 0 0}
+ }%
}
\def\@author{}
@@ -451,8 +441,10 @@ pdfborder={0 0 0}
}
% Author affiliation (starred: corresponding author)
-\DeclareRobustCommand*\aff{%
- \@ifstar\@@aff\@aff
+\DeclareExpandableDocumentCommand{\aff}{som}{%
+ \texorpdfstring
+ {\IfBooleanTF{#1}{\@@aff}{\@aff}[#2]{#3}}
+ {}%
}
% Empty (will be redefined in the article title)
@@ -487,8 +479,8 @@ pdfborder={0 0 0}
\def\@pubyear{}
\newcommand\issue[2]{\def\@issue{#1}\def\@pubyear{#2}}
-\newif\iftitlepageneeded\titlepageneededtrue
-\newif\ifstartpageset\startpagesetfalse
+\newif\if@wlg@titlepageneeded\@wlg@titlepageneededtrue
+\newif\if@wlg@startpageset\@wlg@startpagesetfalse
\def\ljobname{\jobname}
@@ -497,12 +489,12 @@ pdfborder={0 0 0}
\else
\def\and{\texorpdfstring{\unskip\slash}{| }}%
\fi
- \iftitlepage
+ \if@wlg@titlepage
\@maketitlepage[#1]%
\fi
- \ifstartpageset\else
+ \if@wlg@startpageset\else
\setcounter{page}{\thestartpage}
- \global\startpagesettrue
+ \global\@wlg@startpagesettrue
\fi
\rehead{\@@author}
\lohead{\@@title}
@@ -568,8 +560,10 @@ pdfborder={0 0 0}
}%
\newcommand{\@maketitlepage}[1][1]{%
- \iftitlepageneeded
+ \if@wlg@titlepageneeded
\begin{titlepage}
+ \pagenumbering{alph}
+ \thispagestyle{empty}%
\setcounter{page}{%
#1%
}%
@@ -593,7 +587,7 @@ pdfborder={0 0 0}
{\usekomafont{subject}{\@subject\par}}%
\vskip 3em
\fi
- \ifspecialprint
+ \if@wlg@specialprint
{\usekomafont{title}{\@title\par}}%
\vskip 1em
{\ifx\@subtitle\@empty\else\usekomafont{subtitle}{\@subtitle\par}\fi}%
@@ -604,10 +598,10 @@ pdfborder={0 0 0}
}%
}%
\vfill
- {\usekomafont{date}{\ifKV@wlg@preprint\translate{preprintfrom}%
+ {\usekomafont{date}{\if@wlg@preprint\translate{preprintfrom}%
\else\translate{specialprint}\fi\ \emph{Wiener Linguistische Gazette}
(\versal{WLG})
- \@issue\ (\@pubyear)\ifKV@wlg@preprint\else: \startpageref--\lastpageref\fi\par}}
+ \@issue\ (\@pubyear)\if@wlg@preprint\else: \startpageref--\lastpageref\fi\par}}
{\ifx\@issuetitle\@empty\else
\vskip 1em
\usekomafont{date}{\translate{specialissue} \itshape\@issuetitle
@@ -687,14 +681,14 @@ pdfborder={0 0 0}
~\vfill
\impressum
\clearpage
- \ifspecialprint\else
+ \if@wlg@specialprint\else
\ifx\@issuetitle\@empty\else
\thispagestyle{plain}
\tableofcontents
\clearpage
\fi
\fi
- \global\titlepageneededfalse%
+ \global\@wlg@titlepageneededfalse%
\fi%
}
@@ -746,7 +740,7 @@ pdfborder={0 0 0}
\translate{lingdep}\par
\translate{univie}\par
\translate{issue} \@issue\ (\@pubyear):
- \ifKV@wlg@preprint\translate{preprint}%
+ \if@wlg@preprint\translate{preprint}%
\else\thepage--\lastpageref\fi%
}%
\vskip \z@ \@plus 1em
@@ -758,6 +752,7 @@ pdfborder={0 0 0}
\end{flushright}%
\par
\vskip 2em
+ \pagenumbering{arabic}
}%
% Rewrite \include for local LastPage counter
@@ -781,7 +776,7 @@ pdfborder={0 0 0}
\immediate\openout\@partaux #1.aux
\immediate\write\@partaux{\relax}%
\fi
- \ifbiblatex
+ \if@wlg@biblatex
\newrefsection
\fi
\@input@{#1.tex}%
@@ -836,11 +831,12 @@ pdfborder={0 0 0}
% Increase distance between text and footnotes
\renewcommand\footnoterule{%
-% Distance between text and footnote rule (1 line)
+ % Distance between text and footnote rule (1 line)
\kern-3\p@\hrule\@width.4\columnwidth%
\kern2.6\p@%
-% Distance between footnote rule and foot notes (0.2em)
- \vspace{0.2em}}%
+ % Distance between footnote rule and foot notes (0.2em)
+ \vspace{0.2em}%
+}%
% Fotenote mark not superscripted
\newlength{\footnumwidth}
@@ -891,10 +887,10 @@ pdfborder={0 0 0}
\renewcommand*{\dictumrule}{}
\newcommand\motto[2][]{%
-\dictum[#1]{#2}
-\medskip
-\@afterindentfalse
-\@afterheading
+ \dictum[#1]{#2}%
+ \medskip%
+ \@afterindentfalse%
+ \@afterheading%
}
% Lists
@@ -904,14 +900,12 @@ pdfborder={0 0 0}
\def\labelitemi{--}
% Quote (smaller)
-\newcommand*{\OriginalQuote}{}
-\let\OriginalQuote\quote
-\renewcommand*{\quote}{\OriginalQuote\small}
+\let\@wlg@save@quote\quote
+\renewcommand*{\quote}{\@wlg@save@quote\small}
% Quotation (smaller)
-\newcommand*{\OriginalQuotation}{}
-\let\OriginalQuotation\quotation
-\renewcommand*{\quotation}{\OriginalQuotation\small}
+\let\@wlg@save@quotation\quotation
+\renewcommand*{\quotation}{\@wlg@save@quotation\small}
% Description (KOMA) (normal italic)
\setkomafont{descriptionlabel}{\normalfont\itshape}
@@ -920,9 +914,9 @@ pdfborder={0 0 0}
\let\olddots\ldots
\renewcommand*{\ldots}{\olddots\unkern}
-\ifcovington
-\RequirePackage{covington}
-\renewcommand{\p@equation}[1]{(#1)}
+\if@wlg@covington
+ \RequirePackage{covington}
+ \renewcommand{\p@equation}[1]{(#1)}
\fi
@@ -951,18 +945,18 @@ pdfborder={0 0 0}
%% =============================================================
% Biblatex
-\ifbiblatex
-\RequirePackage[%
- style=univie-ling,
- sorting=nyvt,
- autolang=hyphen]
-{biblatex}
+\if@wlg@biblatex
+ \RequirePackage[%
+ style=univie-ling,
+ sorting=nyvt,
+ autolang=hyphen]
+ {biblatex}
\fi
\AtBeginDocument{%
-\@ifundefined{bibhang}{}{%
- \setlength{\bibhang}{\parindent}%
- \renewcommand{\bibfont}{\small}%
-}%
+ \@ifundefined{bibhang}{}{%
+ \setlength{\bibhang}{\parindent}%
+ \renewcommand{\bibfont}{\small}%
+ }%
}
%% =============================================================
@@ -972,23 +966,26 @@ pdfborder={0 0 0}
% Varioref:
\AtBeginDocument{%
\RequirePackage[ngerman]{varioref}
- \renewcommand\reftextafter{auf der \reftextvario{folgenden}{n\"achsten} Seite}%
- \renewcommand\reftextfaceafter{auf der \reftextvario{folgenden}{n\"achsten} Seite}%
- \renewcommand\reftextbefore{auf der \reftextvario{vorhergehenden}{vorangegangenen} Seite}%
- \renewcommand\reftextfacebefore{auf der \reftextvario{vorhergehenden}{vorangegangenen} Seite}%
- \renewcommand\reftextfaraway[1]{auf S.~\pageref{#1}}%
- \renewcommand\reftextpagerange[2]{auf S.~\pageref{#1}--\pageref{#2}}%
+ \vref@addto\extrasnaustrian{%
+ \def\reftextafter{auf der \reftextvario{folgenden}{n\"achsten} Seite}%
+ \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#1#2{auf S.~\pageref{#1}--\pageref{#2}}%
+ }%
% Prettyref:
% (varioref included)
\RequirePackage{prettyref}
- \newrefformat{cha}{Kapitel~\vref{#1}}
- \newrefformat{sec}{Abschnitt~\vref{#1}}
- \newrefformat{sub}{Abschnitt~\vref{#1}}
- \newrefformat{anm}{Anm.~\ref{#1}}
- \newrefformat{app}{Anhang~\vref{#1}}
- \newrefformat{tab}{Tabelle~\vref{#1}}
- \newrefformat{fig}{Abbildung~\vref{#1}}
- \newrefformat{exp}{Argumentation~\vref{#1}}
+ \newrefformat{cha}{\translate{chapter}~\vref{#1}}
+ \newrefformat{sec}{\translate{section}~\vref{#1}}
+ \newrefformat{sub}{\translate{section}~\vref{#1}}
+ \newrefformat{anm}{\translate{footnote}~\vref{#1}}
+ \newrefformat{app}{\appendixname~\vref{#1}}
+ \newrefformat{tab}{\tablename~\vref{#1}}
+ \newrefformat{fig}{\figurename~\vref{#1}}
+ \newrefformat{exp}{\translate{argumentation}~\vref{#1}}
+ \newrefformat{exa}{\translate{example}~\vref{#1}}
}
%% =============================================================