Example stylesheets for syntax highlight of code snippets.
[docutils/kirr.git] / sandbox / code-block-directive / data / pygments-docutilsroles.sty
blob55c4f8c118e4b0a0becfd60860d2d2ff2f7af563
1 % Stylesheet for pygments enhanced reStructured Text
2 % ==================================================
4 % :Author: Günter Milde
5 % :Contact: milde@users.berlios.de
6 % :Revision: $Revision: 5534 $
7 % :Date: $Date: 2005-06-28$
8 % :Copyright: © 2007, 2009 G. Milde,
9 % Released without warranties or conditions of any kind
10 % under the terms of the Apache License, Version 2.0
11 % http://www.apache.org/licenses/LICENSE-2.0
13 % This example style sheet provides syntax highlight for documents generated
14 % with the `rst2latex-highlight` pygments-enhanced Docutils front end.
17 % Separate paragraphs by vertical space
18 % -------------------------------------
20 % This is not required for syntax highlight, but usually a good idea for
21 % documents with lots of source code.
22 % ::
24 \usepackage{parskip}
26 % Highlight code blocks
27 % ---------------------
29 % Pygments_ has an option to generate stylesheets for HTML and LaTeX.
30 % However, the "kryptic" codes used for HTML and LaTeX differ, so that
31 % the output of the command
32 % `pygmentize -S default -f latex -O commandprefix=docutilsrole`
33 % fails to work with rst2latex-highlight.
34 % ::
36 % Colours with LaTeX
37 \usepackage{color}
39 % Standard Postscript fonts
40 \usepackage[sc]{mathpazo}
41 \RequirePackage[scaled=.95]{helvet} % scaled to fit Palatino
43 % Courier monotype fonts with bold and italic variants
44 % \usepackage{courier}
45 % TXfonts monotype
46 \renewcommand{\ttdefault}{txtt}
48 % keyword
49 \newcommand\DUrolek[1]{\textbf{\textbf{#1}}}
50 % new function
51 \newcommand\DUrolenf[1]{\textcolor[rgb]{0.00,0.25,0.82}{#1}}
52 % punktuation
53 % \newcommand\DUrolep[1]{\textcolor[rgb]{0.72,0.53,0.04}{#1}}
54 % string
55 \newcommand\DUroles[1]{\textcolor[rgb]{0.40,0.40,0.40}{\textit{#1}}}
56 % number
57 % \newcommand\DUrolemf[1]{\textcolor[rgb]{0.00,0.53,0.00}{#1}}
58 % operator
59 \newcommand\DUrolear[1]{\textcolor[rgb]{0.72,0.53,0.04}{#1}}
61 % Incomplete!
63 % All STANDARD_TYPES below may appear in the output. (But only the ones
64 % you like to style need to be defined :-)
66 % STANDARD_TYPES = {
67 % Token: '',
69 % Text: '',
70 % Whitespace: 'w',
71 % Error: 'err',
72 % Other: 'x',
74 % Keyword: 'k',
75 % Keyword.Constant: 'kc',
76 % Keyword.Declaration: 'kd',
77 % Keyword.Pseudo: 'kp',
78 % Keyword.Reserved: 'kr',
79 % Keyword.Type: 'kt',
81 % Name: 'n',
82 % Name.Attribute: 'na',
83 % Name.Builtin: 'nb',
84 % Name.Builtin.Pseudo: 'bp',
85 % Name.Class: 'nc',
86 % Name.Constant: 'no',
87 % Name.Decorator: 'nd',
88 % Name.Entity: 'ni',
89 % Name.Exception: 'ne',
90 % Name.Function: 'nf',
91 % Name.Property: 'py',
92 % Name.Label: 'nl',
93 % Name.Namespace: 'nn',
94 % Name.Other: 'nx',
95 % Name.Tag: 'nt',
96 % Name.Variable: 'nv',
97 % Name.Variable.Class: 'vc',
98 % Name.Variable.Global: 'vg',
99 % Name.Variable.Instance: 'vi',
101 % Literal: 'l',
102 % Literal.Date: 'ld',
104 % String: 's',
105 % String.Backtick: 'sb',
106 % String.Char: 'sc',
107 % String.Doc: 'sd',
108 % String.Double: 's2',
109 % String.Escape: 'se',
110 % String.Heredoc: 'sh',
111 % String.Interpol: 'si',
112 % String.Other: 'sx',
113 % String.Regex: 'sr',
114 % String.Single: 's1',
115 % String.Symbol: 'ss',
117 % Number: 'm',
118 % Number.Float: 'mf',
119 % Number.Hex: 'mh',
120 % Number.Integer: 'mi',
121 % Number.Integer.Long: 'il',
122 % Number.Oct: 'mo',
124 % Operator: 'o',
125 % Operator.Word: 'ow',
127 % Punctuation: 'p',
129 % Comment: 'c',
130 % Comment.Multiline: 'cm',
131 % Comment.Preproc: 'cp',
132 % Comment.Single: 'c1',
133 % Comment.Special: 'cs',
135 % Generic: 'g',
136 % Generic.Deleted: 'gd',
137 % Generic.Emph: 'ge',
138 % Generic.Error: 'gr',
139 % Generic.Heading: 'gh',
140 % Generic.Inserted: 'gi',
141 % Generic.Output: 'go',
142 % Generic.Prompt: 'gp',
143 % Generic.Strong: 'gs',
144 % Generic.Subheading: 'gu',
145 % Generic.Traceback: 'gt',