add (really bad) code package

This commit is contained in:
Maximilian Keßler 2022-02-10 00:06:34 +01:00
parent 02c2acd330
commit 778f5297d1

27
src/wip/code/code.pysty Normal file
View file

@ -0,0 +1,27 @@
__HEADER__(Hacky code setup for verbatim code)
\catcode`_=13
\let_\_
\catcode`_=8
\newcommand\code{
\begingroup
\catcode`_=\active
\code@impl
}
\newcommand\code@impl[1]{
\texttt{#1}
\endgroup
}
\newif\ifactive\activefalse
\catcode`|=\active
\def|{
\ifactive
\endgroup
\activefalse
\else
\begingroup
\catcode`_=13
\ttfamily
\fi
}