Removed legacy options, added compatibility to new TeX distributions.

parent ff754a25
......@@ -5,7 +5,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Options and their defaults
\DeclareBoolOption[false]{legacytexlive} % for the ancient TeX Live shipped with Ubuntu
\DeclareBoolOption[false]{natbib}
\DeclareBoolOption[false]{babelbib}
\DeclareBoolOption[true]{biblatex}
......@@ -77,31 +76,6 @@
\RequirePackage{xifthen}
\RequirePackage{expl3}
\RequirePackage{xparse}
\ExplSyntaxOn
%% workaround for syntax change in newer expl3 implementations
\cs_if_exist:NF \prg_case_str:nnn
{ \cs_new_eq:NN \prg_case_str:nnn \str_case:nnn }
\cs_if_exist:NF \str_case:nnn
{ \cs_new_eq:NN \str_case:nnn \prg_case_str:nnn }
%% workaround for a temporary problem (july 2015)
\cs_if_exist:NF \str_case:nnn
{ \cs_new_eq:NN \str_case:nnn \str_case:nnF }
\cs_if_exist:NF \str_case_x:nnn
{ \cs_new_eq:NN \str_case_x:nnn \str_case_x:nnF }
\cs_if_exist:NF \int_case:nnn
{ \cs_new_eq:NN \int_case:nnn \int_case:nnF }
\ExplSyntaxOff
\ifthenelse{\boolean{ifiseries@legacytexlive}}{% FIXME why can't i use \ififiseries@legacytexlive?
\let\ifiseries@natbibtrue\@undefined%
\let\ifiseries@natbibfalse\@undefined%
\let\ififiseries@natbib\@undefined%
\let\ifiseries@biblatextrue\@undefined%
\let\ifiseries@biblatexfalse\@undefined%
\let\ififiseries@biblatex\@undefined%
\DeclareBoolOption[true]{natbib}%
\DeclareBoolOption[false]{biblatex}%
}{}
\ififiseries@largepaper
\let\ifiseries@marginfrac\@undefined%
......@@ -113,11 +87,7 @@
\fi
\ExplSyntaxOn
% TeX Live 2009 (still shipped with Ubuntu in 2012) does not provide the 'onn' version.
% So we have to use a little trick to get the argument expanded.
% This will occur frequently in this code.
\newcommand{\ifiseries@temp}[1]{
\str_case:nnn{#1}{
\str_case:onF{\ifiseries@language}{
{english} {\relax}
{german} {
\let\ifiseries@babelOptions\@undefined%
......@@ -130,18 +100,9 @@
\DeclareStringOption[ngerman]{variorefOptions}%
\DeclareStringOption[Bibliografie]{refname}%
\DeclareBoolOption[true]{dottednumbers}%
\ifthenelse{\boolean{ifiseries@legacytexlive}}{%
\let\ifiseries@babelbibtrue\@undefined%
\let\ifiseries@babelbibfalse\@undefined%
\let\ififiseries@babelbib\@undefined%
\let\ifiseries@bibliographystyle\@undefined%
\DeclareBoolOption[true]{babelbib}%
\DeclareStringOption[babalpha]{bibliographystyle}%
}{}
}
}{\PackageError{ifiseries}{Unsupported~language:~#1}\@ehc}}
}{\PackageError{ifiseries}{Unsupported~language:~\ifiseries@language}\@ehc}
\ExplSyntaxOff
\expandafter\ifiseries@temp\expandafter{\ifiseries@language}
\ifthenelse{\equal{\ifiseries@theorems}{numberslast}}%
{\let\ifiseries@theoremswithin\@undefined%
......@@ -165,13 +126,11 @@
% To avoid a possible error with TeXLive 2015 (at least on Mac), we
% include floatrow as early as possible.
\ExplSyntaxOn
\renewcommand{\ifiseries@temp}[1]{
\str_case:nnn{#1}{
{} {\relax}
{floatrow} {\RequirePackage{floatrow}\DeclareCaptionSubType[alph]{figure}}
{subfig} {\RequirePackage[\ifiseries@subfigOptions]{subfig}\RequirePackage{sidecap}\sidecaptionvpos{figure}{t}}
}{\PackageError{ifiseries}{Unknown~figure~system:~#1}\@ehc}}
\expandafter\ifiseries@temp\expandafter{\ifiseries@figure}
\str_case:onF{\ifiseries@figure}{
{} {\relax}
{floatrow} {\RequirePackage{floatrow}\DeclareCaptionSubType[alph]{figure}}
{subfig} {\RequirePackage[\ifiseries@subfigOptions]{subfig}\RequirePackage{sidecap}\sidecaptionvpos{figure}{t}}
}{\PackageError{ifiseries}{Unknown~figure~system:~\ifiseries@figure}\@ehc}
\ExplSyntaxOff
\RequirePackage{amsmath}
......@@ -370,8 +329,7 @@
%%%% Theorems. If 'theorems' is empty, nothing happens here.
\ExplSyntaxOn
\renewcommand{\ifiseries@temp}[1]{
\str_case:nnn{#1}{
\str_case:onF{\ifiseries@theorems}{
{} {\relax}
{numbersfirst} {
\ififiseries@dottednumbers% FIXME how can I pass through boolean options?
......@@ -391,9 +349,8 @@
\RequirePackage[within=\ifiseries@theoremswithin,numbersfirst=false,language=\ifiseries@language,dottednumbers=false,plainfont=\ifiseries@theoremsplainfont,remarkfont=\ifiseries@theoremsremarkfont]{localTheorem}%
\fi%
}
}{\PackageError{ifiseries}{Unknown~theorem~system:~#1}\@ehc}}
}{\PackageError{ifiseries}{Unknown~theorem~system:~\ifiseries@theorems}\@ehc}
\ExplSyntaxOff
\expandafter\ifiseries@temp\expandafter{\ifiseries@theorems}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Display settings.
......@@ -565,8 +522,7 @@
%% Font and linespread.
\ExplSyntaxOn
\renewcommand{\ifiseries@temp}[1]{
\str_case:nnn{#1}{
\str_case:onF{\ifiseries@font}{
{} {\relax}
{Arial} {
\RequirePackage[sfmath]{kpfonts}
......@@ -792,66 +748,65 @@
\RequirePackage[scaled=.82]{beramono}%
\linespread{1.05}%
}
}{\PackageError{ifiseries}{Unknown~font:~#1}\@ehc}}
}{\PackageError{ifiseries}{Unknown~font:~\ifiseries@font}\@ehc}
\ExplSyntaxOff
\expandafter\ifiseries@temp\expandafter{\ifiseries@font}
%% \prg_case_str cannot occur inside an argument.
%% So we have to prepare several commands here to be called later
%% inside the \@ifclassloaded.
\ExplSyntaxOn
%
\newcommand{\ifiseries@temp@paper}[1]{
\str_case:nnn{#1} {
{} {\relax}
{ustrade} {\geometry{paperwidth=15.24cm, paperheight=22.86cm}}
{15522} {\geometry{paperwidth=15.50cm, paperheight=22.00cm}}
{royal} {\geometry{paperwidth=15.57cm, paperheight=23.39cm}}
{crownquarto} {\geometry{paperwidth=18.91cm, paperheight=24.589cm}}
{kindlefirehd7} {\geometry{paperwidth=3.703704in, paperheight=5.925926in}}
{5x8} {\geometry{paperwidth=12.7cm, paperheight=20.32cm}}
\newcommand{\ifiseries@temp@paper}{
\str_case:onF{\ifiseries@paper} {
{} {\relax}
{ustrade} {\geometry{paperwidth=15.24cm, paperheight=22.86cm}}
{15522} {\geometry{paperwidth=15.50cm, paperheight=22.00cm}}
{royal} {\geometry{paperwidth=15.57cm, paperheight=23.39cm}}
{crownquarto} {\geometry{paperwidth=18.91cm, paperheight=24.589cm}}
{kindlefirehd7} {\geometry{paperwidth=3.703704in, paperheight=5.925926in}}
{5x8} {\geometry{paperwidth=12.7cm, paperheight=20.32cm}}
}{\geometry{paper=\ifiseries@paper}}}
%
\newcommand{\ifiseries@temp@compact}[1]{
\str_case:nnn{#1}{
{} {\relax}
{moderate} {
\setlength{\headsep}{.5\baselineskip}%
\setlength{\footskip}{\baselineskip}%
\nomargin%
}
{strong} {
%% This does the same as the '\ebook' command in 'localKit'.
\fancyhf{}%
\fancyfoot[R]{\thepage}%
\fancypagestyle{plain}{\fancyhf{}\fancyfoot[R]{\thepage}}%
\setlength{\headsep}{0pt}%
\setlength{\headheight}{0pt}%
%\setlength{\topskip}{0pt}% affects height of textblock in ways difficult to determine!
\setlength{\footskip}{1.5\baselineskip}%
\setlength{\oddsidemargin}{.02\textwidth-1in}%
\setlength{\evensidemargin}{.02\textwidth-1in}%
\setlength{\paperwidth}{1.04\textwidth}%
\setlength{\paperheight}{\textheight+\footskip}%
\setlength{\topmargin}{.005\paperheight-1in}% CHANGE
\setlength{\paperheight}{1.02\paperheight}%
}
{expand} {
%% This gives a compact layout, but by expanding the textblock into the margins.
%% Page width and height is maintained.
\geometry{%
headheight=0em,%
headsep=0em,%
left=.02\paperwidth,%
right=.02\paperwidth,%
top=.01\paperheight,%
footskip=\baselineskip,%
bottom=\baselineskip}%
\setlength{\headwidth}{\textwidth}%
\fancyhf{}\fancyfoot[R]{\thepage}%
\fancypagestyle{plain}{\fancyhf{}\fancyfoot[R]{\thepage}}%
}
}{\PackageError{ifiseries}{Unknown~compact~system:~#1}\@ehc}}
\newcommand{\ifiseries@temp@compact}{
\str_case:onF{\ifiseries@compact}{
{} {\relax}
{moderate} {
\setlength{\headsep}{.5\baselineskip}%
\setlength{\footskip}{\baselineskip}%
\nomargin%
}
{strong} {
%% This does the same as the '\ebook' command in 'localKit'.
\fancyhf{}%
\fancyfoot[R]{\thepage}%
\fancypagestyle{plain}{\fancyhf{}\fancyfoot[R]{\thepage}}%
\setlength{\headsep}{0pt}%
\setlength{\headheight}{0pt}%
%\setlength{\topskip}{0pt}% affects height of textblock in ways difficult to determine!
\setlength{\footskip}{1.5\baselineskip}%
\setlength{\oddsidemargin}{.02\textwidth-1in}%
\setlength{\evensidemargin}{.02\textwidth-1in}%
\setlength{\paperwidth}{1.04\textwidth}%
\setlength{\paperheight}{\textheight+\footskip}%
\setlength{\topmargin}{.005\paperheight-1in}% CHANGE
\setlength{\paperheight}{1.02\paperheight}%
}
{expand} {
%% This gives a compact layout, but by expanding the textblock into the margins.
%% Page width and height is maintained.
\geometry{%
headheight=0em,%
headsep=0em,%
left=.02\paperwidth,%
right=.02\paperwidth,%
top=.01\paperheight,%
footskip=\baselineskip,%
bottom=\baselineskip}%
\setlength{\headwidth}{\textwidth}%
\fancyhf{}\fancyfoot[R]{\thepage}%
\fancypagestyle{plain}{\fancyhf{}\fancyfoot[R]{\thepage}}%
}
}{\PackageError{ifiseries}{Unknown~compact~system:~\ifiseries@compact}\@ehc}}
\ExplSyntaxOff
%% End of preparations.
......@@ -859,7 +814,7 @@
%% Page layout.
\ififiseries@pagelayout
\RequirePackage{geometry}
\expandafter\ifiseries@temp@paper\expandafter{\ifiseries@paper}
\ifiseries@temp@paper
\ifdefempty{\ifiseries@paperheight}{}{\ifdefempty{\ifiseries@paperwidth}{}%
{\geometry{paperwidth=\ifiseries@paperwidth,paperheight=\ifiseries@paperheight}}}
%
......@@ -945,7 +900,7 @@ top=\paperheight/\ifiseries@marginfrac, vmarginratio=1:2}
\fi
%% Compact system: reduce margins.
\expandafter\ifiseries@temp@compact\expandafter{\ifiseries@compact}
\ifiseries@temp@compact
%% Empty clearpages (i.e., pages left blank before a chapter start).
\renewcommand*{\cleardoublepage}{%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment