make pip an option

This commit is contained in:
Maximilian Keßler 2022-02-10 00:40:13 +01:00
parent 78e06ed17d
commit 394ecc310c

View File

@ -1,5 +1,8 @@
__HEADER__(Hacky code setup for verbatim code) __HEADER__(Hacky code setup for verbatim code)
__NEW_IF__(pipe,false)
\DeclareOption{pipe}{__SET_IF__(pipe,true)}
\ProcessOptions
\catcode`_=13 \catcode`_=13
\let_\_ \let_\_
@ -15,18 +18,19 @@ __HEADER__(Hacky code setup for verbatim code)
} }
\newif\ifactive\activefalse \newif\ifactive\activefalse
\catcode`|=\active __IF__(pipe)
\def|{ \catcode`|=\active
\ifactive \def|{
\endgroup \ifactive
\activefalse \endgroup
\else \activefalse
\begingroup \else
\catcode`_=13 \begingroup
\ttfamily \catcode`_=13
\fi \ttfamily
} \fi
}
% Quick fix for tables % Quick fix for tables
\AddToHook{env/tabular/begin}[code]{\catcode`|=13} \AddToHook{env/tabular/begin}[code]{\catcode`|=13}
\AddToHook{env/tabular/end}[code]{\catcode`|=8} \AddToHook{env/tabular/end}[code]{\catcode`|=8}
\fi