summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/alchemist/manual.sty
blob: b1efc2b6948a87d9e58ecadd4058e42d3fd94492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
%% ============================================================================
 % !Mode:: "TeX:UK:UTF-8"
 % !TEX program = XeLaTeX
 % -----------------------------------------------------------------------------

% Private XeLaTeX style for scientific texts
% copyright 2019 by Dr Engelbert Buxbaum <engelbert_buxbaum@web.de>
% This file may be shared under Gnu copyleft or the LaTeX the Project Public License.

\ProvidesPackage{manual}[2019/09/18 v1.01 standard packages for scientific texts]
\NeedsTeXFormat{LaTeX2e}

\RequirePackage{kpfonts-otf}
\usepackage{polyglossia}%foreign language support

\RequirePackage{acronym}%keep track of acronyms
%\RequirePackage{amssymb}%math symbols, not required with kpfonts-otf
\RequirePackage[backend=biber,bibencoding=UTF8,sorting=none,dateera=christian,style=numeric-comp]{biblatex}%bibliography
\RequirePackage{biochemistry-colors}%defines standard-conform colours for biochem entities
\RequirePackage{booktabs}%proper rules in tables
\RequirePackage{chemarrow}%arrows in chemical reactions
\RequirePackage{colortbl}%coloured background for tables
\RequirePackage{csquotes}%context-sensitive quotes, required for biblatex
\RequirePackage{css-colors}% defines web-safe colours
\RequirePackage{doi}%give DOIs as hyperlinks in bibliography
\RequirePackage{floatrow}%control float placement
\RequirePackage{fontspec}% font selecting commands
\RequirePackage{graphicx}%inclusion of images
\RequirePackage{hypcap} % anchors of captions
\RequirePackage[british]{isodate}%use international format for date and time
\RequirePackage{isotope}%correct typesetting of isotopes
\RequirePackage{letltxmacro}% change LaTeX commands with optional arguments
\RequirePackage{listings}%typeset computer code
\RequirePackage{lscape}%typeset wide material in lanscape mode
\RequirePackage{makeidx}%index generation
\RequirePackage{marvosym}%various symbols
\RequirePackage{mathbbol}%blackboard bold symbols (double line left)
\RequirePackage{mathtools}%extension of amsmath
\RequirePackage{media9}%include video or sound, currently doesn't work because flash-based
\RequirePackage{microtype}%micro-typesetting
\RequirePackage{multicol}%switching between one- and multicolumn
\RequirePackage{placeins}%allows FloatBarriers to be set
\RequirePackage{rotating}%rotate objects} sidewaystables/figures
\RequirePackage{siunitx}%correct typesetting of units
\RequirePackage[labelformat=empty,labelsep=none]{subfig}% several entries in one float
\RequirePackage{supertabular}%tables over several pages
\RequirePackage[breakable,skins,listings]{tcolorbox}%put text into coloured boxes
\RequirePackage[euler]{textgreek}%upright greek characters
\RequirePackage{ulem}%underlining and striking out
\RequirePackage{url}%typeset internet links (preloaded in beamer)
\RequirePackage{wasysym}
\RequirePackage{xcolor}%handle colours

%\RequirePackage{pdfcomment}% use pdf annotations

\RequirePackage{hyperref}%hyperrefs in PDF, must be last package called, preloaded in beamer
\hypersetup{final=true,
            pdfauthor={Dr. Engelbert Buxbaum},
            colorlinks=true,
            citecolor=Blue,%bibliography, dark blue
            linkcolor=Blue,%internal links, dark blue
            urlcolor=DodgerBlue,%internet, middle blue
            allbordercolors=White}

\newcommand{\EURO}{{\footnotesize{\EUR}}} % because \EUR is way too big

\DeclareSIUnit\angstrom{\text{Å}}
\sisetup{% set-up for siunitx and XeTeX
         print-unity-mantissa = false,
         separate-uncertainty,
         negative-color = red
        }

% special chars in listings environment under XeTeX
\lstset{literate=%
    {Ö}{{\"O}}1
    {Ä}{{\"A}}1
    {Ü}{{\"U}}1
    {ß}{{\ss}}1
    {ü}{{\"u}}1
    {ä}{{\"a}}1
    {ö}{{\"o}}1
    {~}{{\textasciitilde}}1
    }

\let\wasymale\male                        % start to undo overwriting of wasy by kpfonts_otf
\let\wasyfemale\female                    % complete after \begin{document}
% after \begin{document} add:
%\let\male\wasymale
%\let\female\wasyfemale

\setmainlanguage{en-GB}
\setotherlanguage{arabic}
\setotherlanguage{russian}
\setotherlanguage{greek}

\newfontfamily\arabicfont[Script=Arabic]{FreeSerif}
\newfontfamily\russianfont{FreeSerif}
\newfontfamily\greekfont{FreeSerif}


\newcommand{\Name}[1]{\textsc{#1}}        % proper names
\newcommand{\Foreign}[1]{\textit{#1}}     % words from foreign languages
\newcommand{\Species}[1]{\textit{#1}}     % biological species

% Fonts for math-entities
\newcommand{\skalar}[1]{\ensuremath{#1}}
\newcommand{\Vector}[1]{\ensuremath{\vec{\mathfrak{#1}}}}
\newcommand{\AbsVec}[1]{\ensuremath{\mathfrak{#1}}}
\newcommand{\arr}[1]{\ensuremath{\mathcal{#1}}}
\newcommand{\tensor}[1]{\textsf{\bfseries{#1}}}
\newcommand{\set}[1]{\ensuremath{\mathbb{#1}}}

% move super- and subscripts to make them more readable
\makeatletter
  \frozen@everymath={\check@mathfonts
    \fontdimen16 \textfont2=\fontdimen17 \textfont2
    \the\everymath}
  \frozen@everydisplay={\check@mathfonts
    \fontdimen16 \textfont2=\fontdimen17 \textfont2
    \the\everymath}
\makeatother

%% "closed" sqrt sign, https://tex.stackexchange.com/questions/29834/closed-square-root-symbol

\LetLtxMacro{\OldSqrt}{\sqrt}
\newcommand{\ClosedSqrt}[1][\hphantom{3}]{\def\DHLindex{#1}\mathpalette\DHLhksqrt}
\makeatletter
    \newcommand*\bold@name{bold}
    \def\DHLhksqrt#1#2{%
        \setbox0=\hbox{$#1\OldSqrt{#2\,}$}\dimen0=\ht0\relax%
        \advance\dimen0-0.2\ht0\relax% size of the added box is still 0.2 times ht0
        \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
        {\hbox{$#1\expandafter\OldSqrt\expandafter[\DHLindex]{#2\,}$}
        \lower\ifx\math@version\bold@name0.6pt\else0.4pt\fi\box2}
    }
    % root index positioning and added space at the end, mostly noticeable in inline math mode
    \renewcommand*{\sqrt}[2][\ ]{\ClosedSqrt[\leftroot{-2}\uproot{1}#1]{#2}\kern0.1em}
\makeatother

\DeclareMathOperator{\logit}{logit}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\var}{var}
\DeclareMathOperator{\cov}{Cov}
\DeclareMathOperator{\trace}{tr}
\DeclareMathOperator{\abs}{abs}
\DeclareMathOperator{\rk}{rk}
\DeclareMathOperator{\svd}{svd}
\DeclareMathOperator{\median}{median}
\DeclareMathOperator{\dist}{dist}
\DeclareMathOperator{\ld}{ld}
\DeclareMathOperator{\modulo}{modulo}

% physicochemical entities
\newcommand{\ph}{\Foreign{p}H}
\newcommand{\poh}{\Foreign{p}OH}
\newcommand{\pka}{\Foreign{p}K\textsubscript{a}}
\newcommand{\pkb}{\Foreign{p}K\textsubscript{b}}
\newcommand{\pkw}{\Foreign{p}K\textsubscript{w}}
\newcommand{\pkr}{\Foreign{p}K\textsubscript{r}}
\newcommand{\pI}{\Foreign{p}I}

% Chemical formulas in text
\makeatletter
 \DeclareRobustCommand{\single}{\raisebox{0.25ex}{$\m@th-$}}
 \DeclareRobustCommand{\dotted}{\raisebox{0.6ex}{$\m@th.. $}}
 \DeclareRobustCommand{\Lewis}{\raisebox{0.6ex}{$\m@th.$}}
 \DeclareRobustCommand{\double}{\raisebox{0.25ex}{$\m@th=$}}
 \DeclareRobustCommand{\triple}{\raisebox{0.25ex}{$\m@th\equiv$}}
 \DeclareRobustCommand*{\Doth}{\LARGE{.}}
 \DeclareRobustCommand{\radic}{\hspace{-0.1em}{\raisebox{1.4ex}{\Doth}}}
 \DeclareRobustCommand{\chemical}[1]{%
    {\(\m@th
     \edef\resetfontdimens{\noexpand\)%
         \fontdimen16 \textfont2=\the\fontdimen16 \textfont2
         \fontdimen17 \textfont2=\the\fontdimen17 \textfont2 \relax}%
     \fontdimen16 \textfont2=2.7pt \fontdimen17 \textfont2=2.7pt
     \mathsf{#1}%
     \resetfontdimens}}
\makeatother
\renewcommand{\isotopestyle}{\mathsf}% if package isotope is used

% use academic colours: philosophers blue, physicians green, lawyers red, theologists black
\newtcolorbox{advanced}[1]{colback=blue!5!white,colframe=blue!75!black,fonttitle=\bfseries,title=#1,breakable}
\newtcolorbox{medical}{colback=green!5!white,colframe=green!75!black,breakable}
\newtcolorbox{medtitle}[1]{colback=green!5!white,colframe=green!75!black,fonttitle=\bfseries,title=#1,breakable}
\newtcolorbox{rules}{colback=red!5!white,colframe=red!75!black,breakable}

\lstloadlanguages{[Borland6]Pascal,R,[x86masm]assembler}
\lstset{backgroundcolor=\color{Cornsilk},
        language=[Borland6]Pascal,
        alsolanguage=[x86masm]assembler,
        alsolanguage=R,
        extendedchars=false,                 % chars 128-255 not printed
        breaklines=true,                     % long lines broken
        breakatwhitespace=true,              % ... but only at whitespace
        numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=0pt,
        basicstyle=\ttfamily\small\color{black}, % print listing small monospaced
        keywordstyle=\bfseries,
        identifierstyle=\color{DarkRed},     %
        morecomment=[l]{//},                 % allow inline comments from Object Pascal
        commentstyle=\color{Blue},
        stringstyle=\color{DodgerBlue},
        showstringspaces=false               % no special string spaces
       }
\defaultfontfeatures{Scale=MatchLowercase}
\setmonofont{Fantasque Sans Mono}            % 0O, 1Il -~ clearly distinguished, Jany Belluz <jany.belluz@hotmail.fr>

% definitions for biblatex     http://www.khirevich.com/latex/biblatex/, https://3d.bk.tudelft.nl/hledoux/blog/fiddling-biblatex/,
% moewe94@live.de on comp.text.tex, https://tex.stackexchange.com/questions/211199/changing-the-position-of-the-editor-with-biblatex-inbook

\DeclareNameAlias{sortname}{last-first}

\renewcommand{\multinamedelim}{\addcomma\space}
\renewcommand{\finalnamedelim}{\addspace\&\space}

\DefineBibliographyStrings{british}{%
        andothers = {\textit{et\addabbrvspace al\adddot}},
        editor    = {(ed\adddot):},
        editors   = {(eds\adddot):},
        byeditor  = {(ed\adddot):},
}

\DefineBibliographyStrings{german}{%
        andothers = {\textit{et\addabbrvspace al\adddot}},				
        editor    = {(Hrsg.):},
        editors   = {(Hrsg.):},
        byeditor  = {(Hrsg.):},
}

%(ed.) after name list:

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor][1-1]{editor}%
     \setunit{\addspace}%
     \usebibmacro{byeditor+othersstrg}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}

\renewcommand{\emph}[1]{\textnormal{\textit{#1}}}
\renewcommand*{\mkbibnamefamily}[1]{\textnormal{\textsc{#1}}}       %
\renewcommand{\newunitpunct}{\addspace\midsentence}
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}           %Doppelpunkt nach Namen, kein Punkt
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\textnormal{#1}\addcomma} % keine Anführungszeichen um Titel und kursiv
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1}}                   % italic journal title, no comma
\DeclareFieldFormat[inbook,thesis]{title}{\mkbibemph{#1\addcomma}}  % italic title with comma
\DeclareFieldFormat[article]{title}{#1\addcomma}                    % title of journal article is printed as normal text
\DeclareFieldFormat{titlecase}{#1}                                  % keine übermäßig vielen Großbuchstaben im Titel
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}                % Volume in bold
\DeclareFieldFormat[article]{number}{#1}                            % issue textnormal
\DeclareFieldFormat{pages}{#1}				                        % Kein Präfix der Seitenzahlen

\renewbibmacro*{volume+number+eid}{%
   \printfield{volume}%
   \setunit{\addcolon}%
   \printfield{number}%
  }

\DeclareSourcemap{
   \maps[datatype=bibtex]{
     \map{
       \step[fieldset=pagetotal, null]
      }
    }
  }
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{In\intitlepunct}}
  }

% ------ setup for document

\floatsetup[table]{style=plaintop}
\setlength{\rotFPtop}{10pt plus 1fil} % quick fix for sidewaysfigures appearing to high, so that caption is cropped

\frenchspacing

\hyphenation{ATP-ase GTP-ase dia-be-tes phy-sio-logi-cal bio-lo-gy
pro-teo-ly-sis trans-cy-to-sis hy-dro-ly-sis telo-mere hy-dro-lysed
im-mu-no-glo-bu-lin Cali-for-nia mini-mum mini-ma phos-pha-ti-dyl pyro-phos-phate
phos-pho-pro-tein}

\makeatletter % \provideenvironment in analogy to \providecommand, https://tex.stackexchange.com/questions/20687/does-newenvironment-have-a-provideenvironment-cousin-as-newcommand-has-prov
\def\provideenvironment{\@star@or@long\provide@environment}
\def\provide@environment#1{%
        \@ifundefined{#1}%
                {\def\reserved@a{\newenvironment{#1}}}%
                {\def\reserved@a{\renewenvironment{dummy@environ}}}%
        \reserved@a
}
\def\dummy@environ{}
\makeatother

% Abstracts in book + scrbook
\providecommand\abstractname{Abstract}% doesn't change pre-existing command
\provideenvironment{abstract}[1]{%
  \begin{center}\normalfont\bfseries\abstractname\end{center}
  \begin{quotation} #1 \end{quotation}
  }{%
  \vspace{1cm}
  }