add (really bad) code package
This commit is contained in:
parent
02c2acd330
commit
778f5297d1
1 changed files with 27 additions and 0 deletions
27
src/wip/code/code.pysty
Normal file
27
src/wip/code/code.pysty
Normal 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
|
||||||
|
}
|
Loading…
Reference in a new issue