From c5dac27ce9620925a55e37d7042d4ab8a179d61f Mon Sep 17 00:00:00 2001 From: Florian Knoch Date: Sat, 8 Jan 2022 13:50:03 +0100 Subject: [PATCH] Use lstlistings in codeblocks --- commands.tex | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/commands.tex b/commands.tex index 209eb4a..2284a6d 100644 --- a/commands.tex +++ b/commands.tex @@ -126,12 +126,36 @@ }, postbreak=\mbox{{$\hookrightarrow$}\space}, emphstyle={\color{ForestGreen}\bfseries}, - commentstyle=\color{darkgray} + commentstyle=\color{darkgray}, + % Allow special characters in lstlistings. + literate= + {Ö}{{\"O}}1 + {Ä}{{\"A}}1 + {Ü}{{\"U}}1 + {ß}{{\ss}}2 + {ü}{{\"u}}1 + {ä}{{\"a}}1 + {ö}{{\"o}}1 + {é}{{\'e}}1 + {…}{{\textellipsis}}1 } \lstinputlisting{#2}% % }{% - \lstset{language=#1} + \lstset{ + language=#1, + % Allow special characters in lstlistings. + literate= + {Ö}{{\"O}}1 + {Ä}{{\"A}}1 + {Ü}{{\"U}}1 + {ß}{{\ss}}2 + {ü}{{\"u}}1 + {ä}{{\"a}}1 + {ö}{{\"o}}1 + {é}{{\'e}}1 + {…}{{\textellipsis}}1 + } \lstinputlisting{#2} } @@ -170,7 +194,7 @@ \colrules % Left content: code listing: \begin{subfigure}{\widefigurewidth} - \inputminted[breaklines]{tex}{listings/#2.tex} + \codeblock{latex}{listings/#2.tex} \end{subfigure} \hspace{\widefiguregap} % Right content: image or rendered example: