From 778f5297d1c4a221f7a0ea7ed3426c7ed5cd5904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 10 Feb 2022 00:06:34 +0100 Subject: [PATCH] add (really bad) code package --- src/wip/code/code.pysty | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/wip/code/code.pysty diff --git a/src/wip/code/code.pysty b/src/wip/code/code.pysty new file mode 100644 index 0000000..dbff810 --- /dev/null +++ b/src/wip/code/code.pysty @@ -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 +}