2 /*************************************************************************************
5 * Author: efi, Matthias Pospiech (matthias@pospiech.eu)
6 * Copyright: (c) 2006 efi, Matthias Pospiech (matthias@pospiech.eu), Nigel McNie (http://qbnz.com/highlighter)
7 * Release Version: 1.0.8.3
8 * Date Started: 2006/09/23
10 * LaTeX language file for GeSHi.
14 * 2008/08/18 (1.0.8.1)
15 * - Changes in color and some additional command recognition
16 * - No special Color for Brackets, it is only distracting
17 * if color should be reintroduced it should be less bright
18 * - Math color changed from green to violett, since green is now used for comments
19 * - Comments are now colored and the only green. The reason for coloring the comments
20 * is that often important information is in the comments und was merely unvisible before.
21 * - New Color for [Options]
22 * - color for labels not specialised anymore. It makes sence in large documents but less in
24 * - \@keyword introduced
25 * - Fixed \& escaped ampersand
30 * -------------------------
33 *************************************************************************************
35 * This file is part of GeSHi.
37 * GeSHi is free software; you can redistribute it and/or modify
38 * it under the terms of the GNU General Public License as published by
39 * the Free Software Foundation; either version 2 of the License, or
40 * (at your option) any later version.
42 * GeSHi is distributed in the hope that it will be useful,
43 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 * GNU General Public License for more details.
47 * You should have received a copy of the GNU General Public License
48 * along with GeSHi; if not, write to the Free Software
49 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 ************************************************************************************/
53 $language_data = array (
54 'LANG_NAME' => 'LaTeX',
55 'COMMENT_SINGLE' => array(
58 'COMMENT_MULTI' => array(),
59 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
60 'QUOTEMARKS' => array(),
64 'appendix','backmatter','caption','captionabove','captionbelow',
65 'def','documentclass','edef','equation','flushleft','flushright',
66 'footnote','frontmatter','hline','include','input','item','label',
67 'let','listfiles','listoffigures','listoftables','mainmatter',
68 'makeatletter','makeatother','makebox','mbox','par','raggedleft',
69 'raggedright','raisebox','ref','rule','table','tableofcontents',
70 'textbf','textit','texttt','today'
74 "&", "\\", "{", "}", "[", "]"
76 'CASE_SENSITIVE' => array(
78 GESHI_COMMENTS => false,
82 1 => 'color: #800000; font-weight: bold;',
85 1 => 'color: #2C922C; font-style: italic;'
87 'ESCAPE_CHAR' => array(
88 0 => 'color: #000000; font-weight: bold;'
93 0 => 'color: #000000;'
100 0 => 'color: #E02020; '
103 1 => 'color: #8020E0; font-weight: normal;', // Math inner
104 2 => 'color: #C08020; font-weight: normal;', // [Option]
105 3 => 'color: #8020E0; font-weight: normal;', // Maths
106 4 => 'color: #800000; font-weight: normal;', // Structure: Labels
107 5 => 'color: #00008B; font-weight: bold;', // Structure (\section{->x<-})
108 6 => 'color: #800000; font-weight: normal;', // Structure (\section)
109 7 => 'color: #0000D0; font-weight: normal;', // Environment \end or \begin{->x<-} (brighter blue)
110 8 => 'color: #C00000; font-weight: normal;', // Structure \end or \begin
111 9 => 'color: #2020C0; font-weight: normal;', // {...}
112 10 => 'color: #800000; font-weight: normal;', // \%, \& etc.
113 11 => 'color: #E00000; font-weight: normal;', // \@keyword
114 12 => 'color: #800000; font-weight: normal;', // \keyword
120 1 => 'http://www.golatex.de/wiki/index.php?title=\\{FNAME}',
123 'OBJECT_SPLITTERS' => array(
128 GESHI_SEARCH => "(\\\\begin\\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\})(.*)(\\\\end\\{\\2\\})",
129 GESHI_REPLACE => '\3',
130 GESHI_MODIFIERS => 'Us',
131 GESHI_BEFORE => '\1',
136 GESHI_SEARCH => "(?<=\[).+(?=\])",
137 GESHI_REPLACE => '\0',
138 GESHI_MODIFIERS => 'Us',
142 // Math mode with $ ... $
144 GESHI_SEARCH => "\\$.+\\$",
145 GESHI_REPLACE => '\0',
146 GESHI_MODIFIERS => 'Us',
151 4 => "\\\\(?:label|pageref|ref|cite)(?=[^a-zA-Z])",
152 // Structure: sections
154 GESHI_SEARCH => "(\\\\(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph|addpart|addchap|addsec)\*?\\{)(.*)(?=\\})",
155 GESHI_REPLACE => '\\2',
156 GESHI_MODIFIERS => 'U',
157 GESHI_BEFORE => '\\1',
160 // Structure: sections
161 6 => "\\\\(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph|addpart|addchap|addsec)\*?(?=[^a-zA-Z])",
162 // environment \begin{} and \end{} (i.e. the things inside the {})
164 GESHI_SEARCH => "(\\\\(?:begin|end)\\{)(.*)(?=\\})",
165 GESHI_REPLACE => '\\2',
166 GESHI_MODIFIERS => 'U',
167 GESHI_BEFORE => '\\1',
170 // Structure \begin and \end
171 8 => "\\\\(?:end|begin)(?=[^a-zA-Z])",
174 GESHI_SEARCH => "(?<=\\{)(?!<\|!REG3XP5!>).*(?=\\})",
175 GESHI_REPLACE => '\0',
176 GESHI_MODIFIERS => 'Us',
181 10 => "\\\\(?:[_$%]|&)",
183 11 => "(?<!<\|!REG3XP[8]!>)\\\\@[a-zA-Z]+\*?",
185 12 => "(?<!<\|!REG3XP[468]!>)\\\\[a-zA-Z]+\*?",
187 // ---------------------------------------------
189 'STRICT_MODE_APPLIES' => GESHI_NEVER,
190 'SCRIPT_DELIMITERS' => array(
192 'HIGHLIGHT_STRICT_BLOCK' => array(
194 'PARSER_CONTROL' => array(
196 'DISALLOWED_BEFORE' => '\\'
199 'DISALLOWED_BEFORE' => "(?<=\\\\)",
200 'DISALLOWED_AFTER' => "(?=\b)(?!\w)"
202 'ENABLE_FLAGS' => array(
203 'NUMBERS' => GESHI_NEVER,
204 'BRACKETS' => GESHI_NEVER