Change Boxes to use picture instead of pgf
This commit is contained in:
parent
b3261a3812
commit
d8c18fa672
@ -1,25 +1,13 @@
|
||||
\lipsum[1]
|
||||
|
||||
\begin{InfoBox}
|
||||
\textbf{Hinweis:} \lipsum[1]
|
||||
\textbf{Hinweis:} Test
|
||||
% Nested InfoBox
|
||||
\begin{InfoBox}
|
||||
\textbf{Hinweis:} \lipsum[1]
|
||||
\end{InfoBox}
|
||||
\begin{multicols}{2}
|
||||
\begin{InfoBox}
|
||||
\textbf{Hinweis:} Test
|
||||
\end{InfoBox}
|
||||
\columnbreak
|
||||
\begin{InfoBox}
|
||||
\textbf{Hinweis:} Test
|
||||
\end{InfoBox}
|
||||
\end{multicols}
|
||||
\end{InfoBox}
|
||||
|
||||
\begin{WarningBox}
|
||||
\textbf{Warnung:} \lipsum[1]
|
||||
\end{WarningBox}
|
||||
|
||||
\begin{SuccessBox}
|
||||
\textbf{Erfolg:} \lipsum[1]
|
||||
\end{SuccessBox}
|
||||
|
||||
\begin{ImportantBox}
|
||||
\textbf{Wichtig:} \lipsum[1]
|
||||
\end{ImportantBox}
|
||||
|
||||
\begin{CustomBox}{\faIcon{user}}{blue}
|
||||
\textbf{Info:} \lipsum[1]
|
||||
\end{CustomBox}
|
||||
@ -147,6 +147,9 @@
|
||||
% FPeval for floating point calculations
|
||||
\usepackage{xfp}
|
||||
|
||||
% To refer to page text area
|
||||
\usepackage{tikzpagenodes}
|
||||
|
||||
% ==== /Imports ====
|
||||
|
||||
% Tool to import relative to current file using
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
text={\begin{tabular}{c}%
|
||||
\setcounter{it}{1}%
|
||||
\whiledo{\theit<100}{%
|
||||
\foreach \col in {0,...,15}{\color{black!5}\BeginAccSupp{}\waterMarkText~~\EndAccSupp{}}\\%
|
||||
\foreach \col in {0,...,15}{\color{black!5}\BeginAccSupp{ActualText=}\waterMarkText~~\EndAccSupp{}}\\%
|
||||
\stepcounter{it}%
|
||||
}
|
||||
\end{tabular}
|
||||
|
||||
@ -43,52 +43,40 @@
|
||||
\FPeval{\iconOpacity}{\backgroundOpacity + 20}
|
||||
|
||||
%% === Content ===
|
||||
\filbreak
|
||||
\ifnum\value{coloredBoxLevel}=1
|
||||
% Commands to only execute at the page level
|
||||
\filbreak
|
||||
\fi
|
||||
|
||||
\vspace*{0.5\baselineskip}
|
||||
|
||||
\noindent
|
||||
\begin{minipage}{\linewidth}
|
||||
\begin{mdframed}[
|
||||
backgroundcolor={\coloredBoxBackground!\backgroundOpacity},
|
||||
hidealllines=true,
|
||||
skipabove=0.7\baselineskip,
|
||||
skipbelow=0.7\baselineskip,
|
||||
splitbottomskip=2pt,
|
||||
splittopskip=4pt,
|
||||
roundcorner=5pt
|
||||
]
|
||||
\tikzset{every picture/.style={opacity=1}}
|
||||
\begin{tikzpicture}
|
||||
% Icon area
|
||||
\node[
|
||||
% Middle Top
|
||||
anchor=north,
|
||||
inner sep=0pt,
|
||||
outer sep=0pt,
|
||||
align=center,
|
||||
text width=1cm,
|
||||
] at (0,0 |- current bounding box.north) {
|
||||
\coloredBoxIconPrefix
|
||||
\fontsize{\coloredBoxIconSize}{\coloredBoxIconSize}
|
||||
\selectfont
|
||||
\hspace*{\coloredBoxIconOffsetX-1.75cm}
|
||||
\raisebox{\coloredBoxIconOffsetY}
|
||||
{\color{\coloredBoxColor!\iconOpacity} \coloredBoxIcon}
|
||||
};
|
||||
|
||||
% Content area
|
||||
\node[
|
||||
anchor=north west,
|
||||
inner sep=10pt,
|
||||
outer sep=0pt,
|
||||
text width=\linewidth-0.7cm,
|
||||
align=justify
|
||||
] at (-0.5cm,0 |- current bounding box.north) {
|
||||
\BODY
|
||||
};
|
||||
\end{tikzpicture}
|
||||
\end{mdframed}
|
||||
\begin{mdframed}[
|
||||
backgroundcolor={\coloredBoxBackground!\backgroundOpacity},
|
||||
hidealllines=true,
|
||||
skipabove=0.7\baselineskip,
|
||||
skipbelow=0.7\baselineskip,
|
||||
splitbottomskip=2pt,
|
||||
splittopskip=4pt,
|
||||
roundcorner=5pt
|
||||
]
|
||||
% [REFACTOR] using picture environment instead of tikz due to pgf errors
|
||||
\begin{picture}(\textwidth, 0)(0, 0)
|
||||
\put(\coloredBoxIconOffsetX-\coloredBoxIconSize,\coloredBoxIconOffsetY-0.7cm){
|
||||
\fontsize{\coloredBoxIconSize}{\coloredBoxIconSize}
|
||||
\selectfont
|
||||
\color{\coloredBoxColor!\iconOpacity} \coloredBoxIcon
|
||||
}
|
||||
\end{picture}
|
||||
\hspace*{0.25cm}
|
||||
\begin{minipage}{\linewidth-0.5cm}
|
||||
\vspace*{0.5\baselineskip}
|
||||
\BODY
|
||||
\vspace*{0.5\baselineskip}
|
||||
\end{minipage}
|
||||
\end{mdframed}
|
||||
\end{minipage}
|
||||
\vspace*{0.5\baselineskip}
|
||||
%% === /Content ===
|
||||
|
||||
% Reduce the nesting level counter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user