1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
############################## -*- Mode: a2ps -*- #############################
## tex.ssh --- Sheet definitions for (La)TeX files
##
## Author : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
## Created the : Wed May 6 15:35:36 1997
## Last mod. by : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
## Last mod. the : Thu Jun 26 11:18:14 1997
###############################################################################
## 1.10 Akim
# * Inherit from symbols.ssh for \Alpha and the like
# * Make sure that specific rules are always _after_ generic rules
# (see the \def section)
# * Cleaner handling of \begin et \end, \newcommand and the like
# (as operators not sequences)
# * Highlight title given to environment (\begin{foo}[title])
# * Support (sub)*sections, chapter and part
## 1.9 Akim
# Case sensitive, updated to new syntax for closers, and requirement
## 1.8 Akim
# The prescript-like symbols are keywords, not operators.
# Put them as optional
style TeX is
written by "Denis Girou <Denis.Girou@idris.fr>"
version is 1.11
requires a2ps version 4.12a
ancestors are
symbols
end ancestors
case sensitive
documentation is
"This is the style for (La)TeX files."
"It's mainly useful for people who develop (La)TeX packages."
"With samp(-g)samp, common mathematical symbols are represented graphically."
end documentation
operators are
# It happens to see \' or \" outside a string, for instance in \catcodes.
"\\\'", "\\\"",
# LaTeX environments
(/\\\\(begin|end)([[:blank:]]*)\\{/
/([^}]+)\\}/
"\\" Keyword_strong, \1 Keyword_strong, \2 Plain, "{" Plain,
\3 Label, "}" Plain),
# LaTeX environments with title
(/\\\\(begin|end)([[:blank:]]*)\\{/ # \1 and \2
/([^}]+)\\}([[:blank:]]*)\\[/ # \3, \4
/([^]]+)\\]/ # \5
"\\" Keyword_strong, \1 Keyword_strong, \2 Plain, "{" Plain,
\3 Label, "}" Plain, \4 Plain, "[" Plain,
\5 Label, "]" Plain),
# LaTeX sections
(/\\\\((sub)*section|part|chapter)([[:blank:]]*)\\{/
/([^}]+)\\}/
"\\" Keyword_strong, \1 Keyword_strong, \3 Plain, "{" Plain,
\4 Label_strong, "}" Plain),
# LaTeX macros definitions
(/\\\\/
/((new|renew|provide)command|environment)/ # \1
/([[:blank:]]*)\\{/ # \3
/([^}]+)\\}/ # \4
"\\" Keyword_strong, \1 Keyword_strong, \3 Plain, "{" Plain,
\4 (Label_strong + Index1), "}" Plain)
end operators
sequences are
# (La)TeX comments
% Comment,
# Strings
"\"" Plain String "\"" Plain,
# TeX macros definitions
"\\def" Keyword_strong (Label_strong + Index1)
closers are
"{" Plain,
" " Plain,
"\#" Plain
end closers,
"\\edef" Keyword_strong (Label_strong + Index1)
closers are
"{" Plain,
" " Plain,
"\#" Plain
end closers,
"\\gdef" Keyword_strong (Label_strong + Index1)
closers are
"{" Plain,
" " Plain,
"\#" Plain
end closers,
"\\xdef" Keyword_strong (Label_strong + Index1)
closers are
"{" Plain,
" " Plain,
"\#" Plain
end closers,
# We must not mark other commands beginning by \def !
"\\defaulthyphenchar" Keyword_strong Keyword_strong "" Plain,
"\\defaultskewchar" Keyword_strong Keyword_strong "" Plain,
"\\definecolor" Keyword_strong Keyword_strong "" Plain,
"\\define@key" Keyword_strong Keyword_strong "" Plain,
"\\defineshortverb" Keyword_strong Keyword_strong "" Plain,
"\\defineverbatimenvironment" Keyword_strong Keyword_strong "" Plain,
# LaTeX class of document
"\\documentclass" Keyword_strong Label_strong
closers are
" " Plain,
/$/ Plain
end closers,
"\\documentclass{" Keyword_strong Label_strong "}" Plain,
# LaTeX packages
"\\usepackage" Keyword_strong Label_strong
closers are
" " Plain,
/$/ Plain
end closers,
"\\usepackage{" Keyword_strong Label_strong "}" Plain,
# (La)TeX macros usage
"\\\\" Keyword_strong Keyword_strong
closers in Plain are
/[-{}%[(),=<>+]/, "\#", "\$", "/$/"
end closers
end sequences
end style
|