[Font] Make font change better, document it
This commit is contained in:
BIN
docs/docs.pdf
BIN
docs/docs.pdf
Binary file not shown.
@@ -29,7 +29,10 @@
|
|||||||
\item \verb|\setcounter{descriptorShadeStrength}|\{\textit{number}\} Change the colour saturation of the inline descriptors
|
\item \verb|\setcounter{descriptorShadeStrength}|\{\textit{number}\} Change the colour saturation of the inline descriptors
|
||||||
\item \verb|\setcounter{shadeStrength}|\{\textit{number}\} Change the colour saturation of the \verb|\shade| command
|
\item \verb|\setcounter{shadeStrength}|\{\textit{number}\} Change the colour saturation of the \verb|\shade| command
|
||||||
\item \verb|\setLang|\{\textit{language}\} Change the language. Will automatically load babel in German. Can only be used once and only at the start of the document or in the preamble, as repeated usage leads to undefined behaviour
|
\item \verb|\setLang|\{\textit{language}\} Change the language. Will automatically load babel in German. Can only be used once and only at the start of the document or in the preamble, as repeated usage leads to undefined behaviour
|
||||||
\item To change the font for the entire document, load the font package using \verb|\usepackage|, then select it by using \verb|\setFont{<font name>}|. A list of fonts is available \color{Cyan}\href{https://www.overleaf.com/learn/latex/Font_typefaces#Reference_guide}{here}\color{black}. You may change the font only for a specific section, by enclosing \verb|\setFont| and the text that should be written in said typeface in curly braces.
|
\item To change the font for the entire document, load the font package using \verb|\usepackage|, with the last occurrence of a font package determining the active one.
|
||||||
|
Then select the type by using \verb|\setFontType|\textit{\{mono $|$ serif $|$ sans\}}.
|
||||||
|
A list of fonts is available \color{Cyan}\href{https://www.overleaf.com/learn/latex/Font_typefaces#Reference_guide}{here}\color{black}.
|
||||||
|
You may change the font only for a specific section, by enclosing \verb|\setFont| and the text that should be written in said typeface in curly braces.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\newpage
|
\newpage
|
||||||
|
@@ -10,57 +10,68 @@
|
|||||||
|
|
||||||
% Global style configs for tcolorbox (to reduce bloat)
|
% Global style configs for tcolorbox (to reduce bloat)
|
||||||
\newcommand{\usetcolorboxes}{
|
\newcommand{\usetcolorboxes}{
|
||||||
\tcbset{
|
\tcbset{
|
||||||
mainboxstyle/.style={
|
mainboxstyle/.style={
|
||||||
arc=3mm,
|
arc=3mm,
|
||||||
colback=red!5!white,
|
colback=red!5!white,
|
||||||
colframe=red!75!black,
|
colframe=red!75!black,
|
||||||
colbacktitle=red!75!black,
|
colbacktitle=red!75!black,
|
||||||
fonttitle=\bfseries,
|
fonttitle=\bfseries,
|
||||||
enhanced,
|
enhanced,
|
||||||
attach boxed title to top left={yshift=-2mm,xshift=5mm},
|
attach boxed title to top left={yshift=-2mm,xshift=5mm},
|
||||||
breakable,
|
breakable,
|
||||||
top=0.4cm,
|
top=0.4cm,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\tikzset{
|
\tikzset{
|
||||||
overlaystyle/.style={
|
overlaystyle/.style={
|
||||||
draw=red!75!black,
|
draw=red!75!black,
|
||||||
thick,
|
thick,
|
||||||
fill=red!75!black,
|
fill=red!75!black,
|
||||||
left,
|
left,
|
||||||
anchor=east,
|
anchor=east,
|
||||||
text=white,
|
text=white,
|
||||||
rounded corners=1mm,
|
rounded corners=1mm,
|
||||||
font=\bfseries,
|
font=\bfseries,
|
||||||
xshift=-5mm,
|
xshift=-5mm,
|
||||||
yshift=1mm,
|
yshift=1mm,
|
||||||
inner xsep=3mm,
|
inner xsep=3mm,
|
||||||
inner ysep=1.5mm
|
inner ysep=1.5mm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
% -------------------- %
|
% -------------------- %
|
||||||
% Small style elements %
|
% Small style elements %
|
||||||
% -------------------- %
|
% -------------------- %
|
||||||
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
|
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
|
||||||
|
\newcommand{\setFontType}[1]{
|
||||||
|
\ifthenelse{\equal{#1}{mono}}{
|
||||||
|
\renewcommand{\familydefault}{\ttdefault}
|
||||||
|
}{
|
||||||
|
\ifthenelse{\equal{#1}{serif}}{
|
||||||
|
\renewcommand{\familydefault}{\rmdefault}
|
||||||
|
}{
|
||||||
|
\renewcommand{\familydefault}{\sfdefault}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
\renewcommand{\footrulewidth}{0.4pt}
|
\renewcommand{\footrulewidth}{0.4pt}
|
||||||
\newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}}
|
\newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}}
|
||||||
\newcommand{\bi}[1]{\textbf{\textit{#1}}}
|
\newcommand{\bi}[1]{\textbf{\textit{#1}}}
|
||||||
|
|
||||||
% Add a color shade (similar to \fhlc, but nicer boxes)
|
% Add a color shade (similar to \fhlc, but nicer boxes)
|
||||||
\newcommand{\background}[3]{\tcbox[on line,
|
\newcommand{\background}[3]{\tcbox[on line,
|
||||||
boxsep=2pt,
|
boxsep=2pt,
|
||||||
left=0pt,
|
left=0pt,
|
||||||
right=0pt,
|
right=0pt,
|
||||||
top=0pt,
|
top=0pt,
|
||||||
bottom=0pt,
|
bottom=0pt,
|
||||||
colframe=white,
|
colframe=white,
|
||||||
frame empty,
|
frame empty,
|
||||||
colback=#1!#2!white,
|
colback=#1!#2!white,
|
||||||
highlight math style={enhanced}
|
highlight math style={enhanced}
|
||||||
] {\textbf{#3}}}
|
] {\textbf{#3}}}
|
||||||
|
|
||||||
% Abstraction of background, where the brightness is set to 20%
|
% Abstraction of background, where the brightness is set to 20%
|
||||||
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
|
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
|
||||||
@@ -89,12 +100,12 @@
|
|||||||
|
|
||||||
% Print a table of contents as a tcolorbox
|
% Print a table of contents as a tcolorbox
|
||||||
\newcommand{\printtoc}[1]{
|
\newcommand{\printtoc}[1]{
|
||||||
\renewcommand{\cfttoctitlefont}{}
|
\renewcommand{\cfttoctitlefont}{}
|
||||||
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
|
\renewcommand{\cftaftertoctitle}{\vspace{-0.75cm}}
|
||||||
\renewcommand{\contentsname}{}
|
\renewcommand{\contentsname}{}
|
||||||
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm},
|
\begin{tcolorbox}[colback=black!5!white,colbacktitle=#1!75!black,coltitle=black,enhanced,attach boxed title to top center={yshift=-2mm},
|
||||||
title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
|
title={\Large \ifnum\value{lang}<2{Contents}\else {Inhaltsverzeichnis}\fi},fonttitle=\bfseries,breakable]
|
||||||
\hspace{1cm}
|
\hspace{1cm}
|
||||||
\tableofcontents
|
\tableofcontents
|
||||||
\end{tcolorbox}
|
\end{tcolorbox}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user