From 394ecc310cf67afd6630fae6d9321e9ea2e2da8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 10 Feb 2022 00:40:13 +0100 Subject: [PATCH] make pip an option --- src/wip/code/code.pysty | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/wip/code/code.pysty b/src/wip/code/code.pysty index b9830a3..50facf2 100644 --- a/src/wip/code/code.pysty +++ b/src/wip/code/code.pysty @@ -1,5 +1,8 @@ __HEADER__(Hacky code setup for verbatim code) +__NEW_IF__(pipe,false) +\DeclareOption{pipe}{__SET_IF__(pipe,true)} +\ProcessOptions \catcode`_=13 \let_\_ @@ -15,18 +18,19 @@ __HEADER__(Hacky code setup for verbatim code) } \newif\ifactive\activefalse -\catcode`|=\active -\def|{ - \ifactive - \endgroup - \activefalse - \else - \begingroup - \catcode`_=13 - \ttfamily - \fi -} - +__IF__(pipe) + \catcode`|=\active + \def|{ + \ifactive + \endgroup + \activefalse + \else + \begingroup + \catcode`_=13 + \ttfamily + \fi + } % Quick fix for tables \AddToHook{env/tabular/begin}[code]{\catcode`|=13} \AddToHook{env/tabular/end}[code]{\catcode`|=8} +\fi