\input{basesetup}
% Set page layout.
% \setstocksize{477pt}{315pt}
% \settrimmedsize{477pt}{315pt}{*}
% \settrims{0pt}{0pt}
% \settypeblocksize{420pt}{252pt}{*}
% {spine}{edge}{ratio}
%% print as TASCHENBUCH (much cheaper).
% A5 with increased height to be scaled to TASCHENBUCH for epubli (190mmx125mm);
% only adjusts placement of images, not of the text (because I do not use \setulmarginsandblock
\setstocksize{225.04mm}{148mm}
\settrimmedsize{225.04mm}{148mm}{*}
%% For Komascript
% \documentclass[9pt,pagesize,DIV12,normalheadings,idxtotoc,BCOR5mm,headexclude,footexclude]{scrbook}
% \setlength{\paperwidth}{120mm}% Engelsdorf
% \setlength{\paperheight}{190mm}
% \usepackage{calc}
% \typearea[current]{last}
% Format: Mitte Rand Text
\setlrmarginsandblock{20mm}{52mm}{*}
\setulmarginsandblock{40mm}{38mm}{*}
\marginparsep6.2mm
% \setulmargins{30pt}{*}{*}
% \setheadfoot{10pt}{10pt}
\setheaderspaces{65pt}{*}{*}
% move footnotes into the margin
\footnotesinmargin%
% ensure that sidefootnotes and footnotes use the same counter
\letcountercounter{sidefootnote}{footnote}
% finalize the layout
\checkandfixthelayout%
% Reduce spacing of lists
\firmlists%
% align sublists in the spell-lists to the paragraph.
\setlength{\leftmargini}{\parindent}
\addtolength{\leftmargini}{1pt}
% fix the sidefootnotes
\setlength{\sidefootwidth}{\marginparwidth}
\setlength{\sidefoothsep}{\marginparsep}
\setlength{\sidefootparindent}{1em}
% elegant sidefootnotemarks, works up to 99 sidefootnotes per chapter.
\newlength{\footmarkwidthoften}
\settowidth{\footmarkwidthoften}{\textsuperscript{10}}
\sidefootmarkstyle{\settowidth{\footmarkwidth}{\textsuperscript{#1}}\checkoddpage\ifoddpage\hspace*{\marginparwidth}\hspace*{-2.8mm}\hspace*{0.5\footmarkwidthoften}\hspace*{-0.5\footmarkwidth}\textsuperscript{#1}\hspace*{\marginparwidth}\vspace{-1.45\onelineskip} \else \hspace*{1.05mm}\hspace*{0.5\footmarkwidthoften}\hspace*{-0.5\footmarkwidth}\textsuperscript{#1}\vspace{-0.5\onelineskip} \fi}
% fix the sidebar
\setsidebars{\marginparsep}{\marginparwidth}{\onelineskip}%
{0pt}{\normalsize\normalfont}{\textheight}
% make every footnote a sidefootnote (otherwise the footnotes flow beyond the lower page border). To align the odd page, adjust hspace* and includegraphics width to fit, scale hspace around 4x width.
\renewcommand{\footnote}[1]{\sidefootnote{\checkoddpage\ifthenelse{\boolean{oddpage}}{%
\hspace*{-3.6mm}\hspace*{0.61\sidefootwidth}\raisebox{-3.2mm}{\reflectbox{\includegraphics[width=.5\sidefootwidth]{seitenzahl-balken-2020-trudy.pdf}}}\par\vspace*{0.5mm}\parindent1.5mm\hangindent1.5mm}{%
\vspace*{2.3mm}\raisebox{-.5mm}{\hspace*{-4.5mm}\includegraphics[width=.5\sidefootwidth]{seitenzahl-balken-2020-trudy.pdf}}\par\vspace*{0.5mm}\parindent1.1mm\hangindent1.1mm}#1}}
\renewcommand{\maketitlehookb}{\newpage} % das verschiebt Autoren
% und Datum auf die nächste Seite.
% Set table column coloring start
\BeforeBeginEnvironment{tabular}{\global\rownum=0\relax}
% Provide roman numerals with \rom{n}
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral%
#1@}
\makeatother
% add hyperref last to avoid some problems with packages
\usepackage{hyperref}
% pdf: with color
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
% print: no color
% \hypersetup{
% colorlinks,
% linkcolor={white!20!black},
% citecolor={white!30!black},
% urlcolor={white!30!black}
% }
\hypersetup{
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 24.4.1 (Org mode 8.2.6)}}