Fine Tuning; Fonts in ToC are still wrong

This commit is contained in:
Frederik Beimgraben 2024-11-22 01:24:59 +00:00
parent 8d6d766c32
commit 643916396c
8 changed files with 189 additions and 62 deletions

View File

@ -1,11 +1,51 @@
% !TEX root = ../Main.tex
\chapter{Infoboxen}
\section{API / Benutzung von Infoboxen}
% Commands for InfoBoxes
Dieses Template erlaubt die Verwendung von verschiedenen Infoboxen, die in \texttt{TeX/Modules/Infoboxes.tex} definiert sind. Diese Infoboxen können in beliebigen \texttt{.tex}-Dateien verwendet werden.
\smallskip
\begin{lstlisting}[language=tex]
\begin{InfoBox}
\textbf{Hinweis:} \lipsum[75]~\cite{wombat2016}
<content>
\end{InfoBox}
\end{lstlisting}
\smallskip
Die vordefinierten Infobox-Typen sind:
\begin{itemize}
\item \texttt{InfoBox}
\item \texttt{WarningBox}
\item \texttt{SuccessBox}
\item \texttt{ImportantBox}
\end{itemize}
Des Weiteren können eigene Infoboxen mit dem Befehl \texttt{CustomBox} erstellt werden. Dieser Befehl erwartet zwei Argumente: ein Icon und eine Farbe.
\smallskip
\begin{lstlisting}[language=tex]
\begin{CustomBox}{\faIcon{<fa-icon>}}{<color>}
<content>
\end{CustomBox}
\end{lstlisting}
\smallskip
Als Farbe können entweder die \LaTeX-Standardfarben oder eigene Farben verwendet werden. Die Icons können der \href{https://fontawesome.com/icons?d=gallery&m=free}{Font Awesome Icon Library} entnommen werden.
\section{Beispiele}
\begin{InfoBox}
\subsubsection{Äußere InfoBox}
Diese InfoBox enthält mehrere andere Infoboxen, die über eine \texttt{multicols}-Umgebung in zwei Spalten angeordnet sind.
\vspace*{-1em}
\begin{multicols}{2}
\begin{CustomBox}{\faIcon{user-graduate}}{britishracinggreen}
\textbf{Hinweis:} \lipsum[66]
\subsubsection{Custom Box 1}
Diese Box hat das \texttt{user-graduate}-Icon und die Farbe \texttt{britishracinggreen}.
\end{CustomBox}
\begin{CustomBox}{\faIcon{chart-pie}}{britishracinggreen}
\subsubsection{Custom Box 2}
\vspace{0.5em}
\begin{tikzpicture}[scale=0.6]
\pie [cloud, explode=0.1, text=legend, style=very thin] {
10/A,
@ -14,36 +54,80 @@
40/D
}
\end{tikzpicture}
\lipsum[66]
\vspace{0.5em}\\
Diese Box hat das \texttt{chart-pie}-Icon und die Farbe \texttt{britishracinggreen}.
Sie enthält ein Tortendiagramm im \texttt{cloud}-Stil, das über das \texttt{pgf-pie}-Paket in TikZ erstellt wurde.
\end{CustomBox}
\columnbreak
\begin{InfoBox}
\textbf{Hinweis:} \lipsum[75]
\subsubsection{Innere InfoBox}
Diese InfoBox enthält eine doppelt geschachtelte \texttt{CustomBox}.
% Nested UserBox
\begin{CustomBox}{\faIcon{user}}{blue}
\textbf{Info:} \lipsum[66]~\cite{lion2010}
\subsubsection{User Box}
Diese Box hat das \texttt{user}-Icon und die Farbe \texttt{blue}.
\end{CustomBox}
\end{InfoBox}
\begin{WarningBox}
\subsubsection{Warning Box}
Diese Box ist eine \texttt{WarningBox}.
\end{WarningBox}
\begin{SuccessBox}
\subsubsection{Success Box}
Diese Box ist eine \texttt{SuccessBox}.
\end{SuccessBox}
\end{multicols}
\end{InfoBox}
\begin{WarningBox}
\textbf{Warnung:} \lipsum[1]~\cite{wikibook}
\end{WarningBox}
\pagebreak
\begin{SuccessBox}
\textbf{Erfolg:} \lipsum[1]
\end{SuccessBox}
\section{Code}
\begin{ImportantBox}
\textbf{Wichtig:} \lipsum[1]
\end{ImportantBox}
\begin{lstlisting}[language=tex]
\begin{InfoBox}
\subsubsection{Äußere InfoBox}
Diese InfoBox enthält mehrere andere Infoboxen, die über eine \texttt{multicols}-Umgebung in zwei Spalten angeordnet sind.
\vspace*{-1em}
\begin{multicols}{2}
\begin{CustomBox}{\faIcon{user-graduate}}{britishracinggreen}
\subsubsection{Custom Box 1}
Diese Box hat das \texttt{user-graduate}-Icon und die Farbe \texttt{britishracinggreen}.
\end{CustomBox}
\begin{CustomBox}{\faIcon{chart-pie}}{britishracinggreen}
\subsubsection{Custom Box 2}
\vspace{0.5em}
\begin{tikzpicture}[scale=0.6]
\pie [cloud, explode=0.1, text=legend, style=very thin] {
10/A,
20/B,
30/C,
40/D
}
\end{tikzpicture}
\vspace{0.5em}\\
Diese Box hat das \texttt{chart-pie}-Icon und die Farbe \texttt{britishracinggreen}.
Sie enthält ein Tortendiagramm im \texttt{cloud}-Stil, das über das \texttt{pgf-pie}-Paket in TikZ erstellt wurde.
\end{CustomBox}
\columnbreak
\begin{InfoBox}
\subsubsection{Innere InfoBox}
Diese InfoBox enthält eine doppelt geschachtelte \texttt{CustomBox}.
\begin{CustomBox}{\faIcon{user}}{blue}
\textbf{Info:} \lipsum[1]
\end{CustomBox}
\begin{VotingResults}{3}{2}{3}
\textbf{Abstimmung:} \lipsum[75]
\end{VotingResults}
% Nested UserBox
\begin{CustomBox}{\faIcon{user}}{blue}
\subsubsection{User Box}
Diese Box hat das \texttt{user}-Icon und die Farbe \texttt{blue}.
\end{CustomBox}
\end{InfoBox}
\begin{WarningBox}
\subsubsection{Warning Box}
Diese Box ist eine \texttt{WarningBox}.
\end{WarningBox}
\begin{SuccessBox}
\subsubsection{Success Box}
Diese Box ist eine \texttt{SuccessBox}.
\end{SuccessBox}
\end{multicols}
\end{InfoBox}
\end{lstlisting}

View File

@ -52,6 +52,7 @@
\RequirePackage{arrayjobx}
\RequirePackage{etoolbox}
\RequirePackage{transparent}
\RequirePackage{tocloft}
%----------------------------------------
% REFS
@ -138,6 +139,9 @@
\let\newglobalarray\newarray
\patchcmd{\newglobalarray}{\edef}{\xdef}{}{}
% Set the array to expand the elements
\expandarrayelementtrue
% AddLogo Command with automatic counter
% Array to store the logos and to be used in pgffor later
\newglobalarray\LogosPaths
@ -146,7 +150,6 @@
\newglobalarray\LogosExtensions
\newcounter{logoCounter}
\setcounter{logoCounter}{0}
\expandarrayelementtrue
% Command to add a logo to the array
% Usage: \AddLogoToArray{<Name>}{<Scale>}{<Opacity>}
\DeclareRobustCommand{\AddLogo}[4]{
@ -162,6 +165,27 @@
\expand{\LogosOpacities(#1)}
}
% Command to add a data line for the title page (key, value)
% Use a token register to store the data
\newtoks\titlePageData
\def\tand{&}
\titlePageData={\tand}
\DeclareRobustCommand{\AddTitlePageDataSpace}[1]{
% Add vertical space of size #1
\titlePageData=\expandafter{\the\titlePageData \vspace{#1}}
}
\DeclareRobustCommand{\AddTitlePageDataLine}[2]{
\titlePageData=\expandafter{\the\titlePageData\\ \textbf{#1}\tand #2}
}
% Command to get all the data for the title page (to be inserted in tabular)
% ({tabular}{@{} p{40mm} l}) Key is always bold
\DeclareRobustCommand{\GetTitlePageDataTable}{
\begin{tabular}{@{} p{40mm} l}
\the\titlePageData
\end{tabular}
}
% =============================================================================
\def\skylinePath{TeX/Assets/Images/Skyline.svg}
@ -235,11 +259,11 @@
}
% Set font for all headings
\setkomafont{disposition}{\sffamily\bfseries}
\setkomafont{chapter}{\Large\sffamily\bfseries}
\setkomafont{section}{\Large\sffamily\bfseries}
\setkomafont{subsection}{\large\sffamily\bfseries}
\setkomafont{subsubsection}{\large\sffamily\bfseries}
\setkomafont{disposition}{\blenderfont\bfseries}
\setkomafont{chapter}{\Large\blenderfont\bfseries}
\setkomafont{section}{\Large\blenderfont\bfseries}
\setkomafont{subsection}{\large\blenderfont\bfseries}
\setkomafont{subsubsection}{\large\blenderfont\bfseries}
\RedeclareSectionCommand[
beforeskip=1ex,
@ -259,9 +283,14 @@
%----------------------------------------
% TABLE OF CONTENTS
%----------------------------------------
%\usepackage{tocloft}
%\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
%\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
% Page Numbering in the Table of Contents
\renewcommand\cftchappagefont{\blenderfont\color{gray}}
\renewcommand\cftsecpagefont{\blenderfont\color{gray}}
\renewcommand\cftsubsecpagefont{\blenderfont\color{gray}}
\renewcommand\cftsubsubsecpagefont{\blenderfont\color{gray}}
% Set Chapter font size in TOC
%\renewcommand{\cftchapfont}{\sffamily\bfseries\large}
% Chap/Sec/... Title in the Table of Contents
\renewcommand\cftchapfont{\blenderfont\color{gray}}
\renewcommand\cftsecfont{\blenderfont\color{gray}}
\renewcommand\cftsubsecfont{\blenderfont\color{gray}}
\renewcommand\cftsubsubsecfont{\blenderfont\color{gray}}

View File

@ -44,9 +44,9 @@
% title
\begin{flushleft}
{
\noindent
\color{gray}\textbf{
\blenderfont\Huge
\@title
\blenderfont\Huge\hspace*{-2.5pt}\@title
}
}
\color{lightgray}
@ -60,8 +60,6 @@
\noindent
\setstretch{1.0}
\begin{tabular}{@{} p{40mm} l}
\textbf{Datum} & \@createdon\\
\end{tabular}
\GetTitlePageDataTable
\end{titlepage}
}

View File

@ -13,4 +13,4 @@
\renewcommand\cftchapfont{\blenderfont\color{gray}}
\renewcommand\cftsecfont{\blenderfont\color{gray}}
\renewcommand\cftsubsecfont{\blenderfont\color{gray}}
\renewcommand\cftsubsubsecfont{\blenderfont\color{gray}}
\renewcommand\cftsubsubsecfont{\blenderfont\color{gray}}

View File

@ -2,15 +2,16 @@
% ==== Watermark ====
\newcounter{it}
\DraftwatermarkOptions{
scale=0.08,
angle=45,
text={\begin{tabular}{c}%
\setcounter{it}{1}%
\whiledo{\theit<100}{%
\foreach \col in {0,...,15}{\color{black!5}\BeginAccSupp{ActualText=}\waterMarkText~~\EndAccSupp{}}\\%
\stepcounter{it}%
}
\end{tabular}
},
color=black!12,
scale=0.08,
angle=45,
text={
\begin{tabular}{c}%
\setcounter{it}{1}%
\whiledo{\theit<100}{%
\foreach \col in {0,...,15}{\color{black!5}\BeginAccSupp{ActualText=}\waterMarkText~~\EndAccSupp{}}\\%
\stepcounter{it}%
}
\end{tabular}
},
color=black!12,
}

View File

@ -5,18 +5,18 @@
\input{TeX/Imports}
% ==== Settings ====
\inputrelative{Settings/General}
\inputrelative{Settings/Logos}
\inputrelative{Settings/BibTeX}
\input{TeX/Settings/General}
\input{TeX/Settings/Logos}
\input{TeX/Settings/BibTeX}
% ==== Tools ====
\inputrelative{Modules/Listings}
\inputrelative{Modules/Floats}
\inputrelative{Modules/MeetingPresence}
\inputrelative{Modules/InfoBlocks}
\inputrelative{Modules/Watermark}
\inputrelative{Modules/ToC}
\inputrelative{Modules/Typography}
\input{TeX/Modules/Listings}
\input{TeX/Modules/Floats}
\input{TeX/Modules/MeetingPresence}
\input{TeX/Modules/InfoBlocks}
\input{TeX/Modules/Watermark}
\input{TeX/Modules/ToC}
\input{TeX/Modules/Typography}
% ==== Glossary ====
\input{Content/99_glossary.tex}

View File

@ -7,4 +7,21 @@
\createdon{\today}
% Title
\title{HSRT \LaTeX\ Report Template of @frederikbeimgraben}
\title{HSRT \LaTeX\ Report Template of Frederik Beimgraben}
% Data fields for the title page
\makeatletter
\AddTitlePageDataLine{Titel}{\@title}
\AddTitlePageDataSpace{5pt}
\AddTitlePageDataLine{Autor:innen}{Frederik Beimgraben}
\AddTitlePageDataLine{}{Max Mustermann}
\AddTitlePageDataLine{}{Erika Musterfrau}
\AddTitlePageDataSpace{5pt}
\AddTitlePageDataLine{Studiengang}{Medizinisch Technische Informatik B.Sc.}
\AddTitlePageDataLine{Modul}{MTI.00.00 - Mustermodul}
\AddTitlePageDataLine{Dozent:in}{Prof. Dr. Max Mustermann}
\AddTitlePageDataLine{Semester}{Wintersemester 2024/2025}
\makeatother
% Disable indentation
\setlength{\parindent}{0pt}

View File

@ -1,7 +1,5 @@
% !TEX root = ../../Main.tex
%%%% ORDER IS CRITICAL %%%%
% STUPA Logo
%\AddLogo{STUPA}{1.1}{0.7}{png}