diff options
author | Norbert Preining <norbert@preining.info> | 2022-02-26 03:00:34 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-02-26 03:00:34 +0000 |
commit | 740a11f29a3551babe3d7edbb57ac3baa2280a3f (patch) | |
tree | 5d6d449e762f5ab95042e3517d03c5ac3ddaf7c3 /macros/latex/contrib/stex/tex/etc/lststex.sty | |
parent | 157cc9e776520d0b7d488317a69a10d4ae4d493b (diff) |
CTAN sync 202202260300
Diffstat (limited to 'macros/latex/contrib/stex/tex/etc/lststex.sty')
-rw-r--r-- | macros/latex/contrib/stex/tex/etc/lststex.sty | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/macros/latex/contrib/stex/tex/etc/lststex.sty b/macros/latex/contrib/stex/tex/etc/lststex.sty new file mode 100644 index 0000000000..e3865cb464 --- /dev/null +++ b/macros/latex/contrib/stex/tex/etc/lststex.sty @@ -0,0 +1,45 @@ +\RequirePackage{xcolor} +\RequirePackage{listings} + +\lstdefinelanguage{pseudocode} +{morekeywords={procedure,function,end,loop,return,to,local,Value,fail,if,then,do,for,else,elif,foreach,in,true,false, + inputs,returns,persistent,repeat,until,while}, + morecomment=[s]{(*}{*)}, + morecomment=[s]{/*}{*/}, % preferred over (* ... *) + morecomment=[s][\sl]{<}{>} +} + +\lstdefinelanguage[sTeX]{TeX}[LaTeX]{TeX}% + {moretexcs={[2]defin,twindef,atwindef,definalt,twindefalt,atwindefalt,definiendum, + importmodule,usemodule,importmhmodule,usemhmodule,gimport,guse, + symdef,symvariant,symtest, + defi,defii,defiii,adefi,adefii,adefiii,defis,defiis,defiiis, + trefi,trefii,trefiii,atrefi,atrefii,atrefiii,mtrefi,mtrefii,mtrefiii, + trefis,trefiis,trefiiis,atrefis,atrefiis,atrefiiis, + symi,symii,symiii, + termref,sref}, + morekeywords={module,definition,axiom,assertion,omtext, + mhmodule,mhmodsig,mhmodnl,modsig,modnl, + inputref, + sproof,spfstep,spfcases,spfcase,justification,premise}} + +\definecolor{backcolor}{gray}{.96} + +\lstset{columns=fullflexible,basicstyle=\ttfamily} +\lstset{frame=none,numbers=none,lineskip=-.7ex}%,aboveskip=-1em,belowskip=-2em} +\lstset{keywordstyle=[2]\color{red},keywordstyle=[3]\color{blue}} +\lstset{keywordstyle=[4]\color{green},keywordstyle=[5]\color{magenta}} +\lstset{emphstyle=[2]\color{red},emphstyle=[3]\color{blue}} +\lstset{emphstyle=[4]\color{green},emphstyle=[5]\color{magenta}} +\lstset{commentstyle=\color{brown}} +\lstset{backgroundcolor=\color{backcolor}} +\newcommand{\lstkeycolor}[2]{\ifcase#1\textbf{#1}\or\red{#2}\or\blue{#2}\or\green{#2}\or\magenta{#2}\fi} +\define@key{stexlisting}{id}{\def\sref@id{#1}} +\define@key{stexlisting}{id}{\def\stexlst@id{#1}} + +% LocalWords: lstdefinelanguage morekeywords morecomment moretexcs defin sref +% LocalWords: twindef atwindef definalt twindefalt atwindefalt termref lstset +% LocalWords: basicstyle scriptsize fullflexible lineskip aboveskip belowskip +% LocalWords: keywordstyle keywordstyle newcommand lstkeycolor ifcase textbf +% LocalWords: stexlisting stexlst sproof spfstep symdef spfcases spfcase tt +% LocalWords: texcsstyle emphstyle emphstyle ttfamily |