134 lines
4.9 KiB
TeX
134 lines
4.9 KiB
TeX
% !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}
|
|
<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}
|
|
\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}.
|
|
|
|
% 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}
|
|
|
|
\pagebreak
|
|
|
|
\section{Code}
|
|
|
|
\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}.
|
|
|
|
% 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}
|