mailr20231 - /trunk/docs/latex/relax.tex


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 20, 2013 - 15:21:
Author: bugman
Date: Thu Jun 20 15:21:06 2013
New Revision: 20231

URL: http://svn.gna.org/viewcvs/relax?rev=20231&view=rev
Log:
Created a new listings language definition for relax for the user manual.

This is for better highlighting of relax scripts and code in the relax manual.


Modified:
    trunk/docs/latex/relax.tex

Modified: trunk/docs/latex/relax.tex
URL: 
http://svn.gna.org/viewcvs/relax/trunk/docs/latex/relax.tex?rev=20231&r1=20230&r2=20231&view=diff
==============================================================================
--- trunk/docs/latex/relax.tex (original)
+++ trunk/docs/latex/relax.tex Thu Jun 20 15:21:06 2013
@@ -39,9 +39,54 @@
             urlcolor=blue}
 
 % Source code and scripts.
-\usepackage{listings}
+\usepackage[procnames]{listings}
 \usepackage[svgnames]{xcolor}
 \usepackage{textcomp}
+\lstdefinelanguage{relax}{
+    alsoletter={.},
+    morekeywords={
+        and,
+        assert,
+        break,
+        continue,
+        del,
+        else,
+        exec,
+        global,
+        if,
+        in,
+        is,
+        for,
+        not,
+        or,
+        pass,
+        print,
+        raise,
+        return,
+        while,
+        yield,
+    },
+    morekeywords=[2]{
+        as,
+        from,
+        import,
+    },
+    morekeywords=[3]{
+        class,
+        def,
+    },
+    morekeywords=[4]{
+        pipe.create,
+        spin.name,
+        spin.element,
+    },
+    moreprocnamekeys={def,class},
+    sensitive=true,
+    morecomment=[l]{\#},
+    morestring=[b]',
+    morestring=[b]",
+    morestring=[b]""",
+}
 \lstset{
     backgroundcolor=\color{white},
     basewidth=0.5em,
@@ -50,23 +95,26 @@
     breaklines=true,
     captionpos=b,
     columns=fixed,
-    commentstyle=\color{blue},
+    commentstyle=\color{Blue},
     frame=none,
     keepspaces=true,
     keywordstyle=\bfseries \color{ForestGreen},
-    language=Python,
+    keywordstyle=[2]\bfseries \color{BlueViolet},
+    keywordstyle=[3]\bfseries \color{SaddleBrown},
+    keywordstyle=[4]\bfseries \color{MidnightBlue},
+    language=relax,
     numbers=left,
     numbersep=15pt,
-    numberstyle=\tiny \color{orange},
+    numberstyle=\tiny \color{DarkOrange},
+    procnamestyle=\color{LightSeaGreen},
     showspaces=false,
     showstringspaces=false,
     showtabs=false,
     stepnumber=1,
-    stringstyle=\color{Crimson},
+    stringstyle=\color{FireBrick},
     tabsize=4,
     upquote=true,
 }
-
 
 % New commands.
 \newcommand{\example}[1]{\vspace{-1ex} \sloppy{\footnotesize \texttt{#1}}}




Related Messages


Powered by MHonArc, Updated Thu Jun 20 16:00:02 2013