Debian Codegraph @

texmf-dist/doc/latex/schule/schule-dokumentation.sty

raw
1 \RequirePackage{tcolorbox}
2 \tcbuselibrary{skins,breakable}
3 \tcbset{enhanced,enhanced jigsaw}
4
5 \newtcolorbox{cnltxcode}[1][]{
6 boxrule = 1pt ,
7 colback = cnltxbg ,
8 colframe = cnltx ,
9 arc = 5pt ,
10 beforeafter skip = .5\baselineskip ,%
11 #1%
12 }
13
14 \newcounter{examplefile}
15 \NewDocumentCommand{\Beispieldatei}{m m}{
16 \begin{cnltxcode}[
17 step and label={examplefile}{example:#1} ,
18 sidebyside align=top seam,sidebyside,
19 righthand width=\linewidth/4,
20 sidebyside gap=0pt,
21 lower separated=false,
22 title=Beispiel~\theexamplefile\ \enquote{\texttt{#2}}~%
23 \href{Beispiele/#1.tex}{ \color{white} [\TeX]}~%
24 \href{Beispiele/#1.pdf}{ \color{white} [PDF]}
25 ]
26 \lstinputlisting[style=cnltx,lastline=10]{Beispiele/#1.tex}
27 \tcblower
28 \fbox{\href{Beispiele/#1.pdf}{\includegraphics[width=.8\linewidth]{Beispiele/#1.pdf}}}%
29 \end{cnltxcode}
30 }