A tumblelog CMS built on AJAX, PHP and MySQL.

latex.php 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?php
  2. /*************************************************************************************
  3. * latex.php
  4. * -----
  5. * Author: efi, Matthias Pospiech (mail@matthiaspospiech.de)
  6. * Copyright: (c) 2006 efi, Matthias Pospiech (mail@matthiaspospiech.de), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.7.21
  8. * Date Started: 2006/09/23
  9. *
  10. * LaTeX language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2006/09/23 (1.0.0)
  15. * - First Release
  16. *
  17. * TODO
  18. * -------------------------
  19. * *
  20. *
  21. *************************************************************************************
  22. *
  23. * This file is not yet part of GeSHi. (and is not compatible to the 1.1+ branch)
  24. *
  25. * GeSHi is free software; you can redistribute it and/or modify
  26. * it under the terms of the GNU General Public License as published by
  27. * the Free Software Foundation; either version 2 of the License, or
  28. * (at your option) any later version.
  29. *
  30. * GeSHi is distributed in the hope that it will be useful,
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. * GNU General Public License for more details.
  34. *
  35. * You should have received a copy of the GNU General Public License
  36. * along with GeSHi; if not, write to the Free Software
  37. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  38. *
  39. ************************************************************************************/
  40. if (isset($this) && is_a($this, 'GeSHi')) {
  41. $this->set_symbols_highlighting(false);
  42. $this->set_numbers_highlighting(false);
  43. }
  44. $language_data = array (
  45. 'LANG_NAME' => 'LaTeX',
  46. 'COMMENT_SINGLE' => array(1 => '%'),
  47. 'COMMENT_MULTI' => array(),
  48. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  49. 'QUOTEMARKS' => array(),
  50. 'ESCAPE_CHAR' => '',
  51. 'KEYWORDS' => array(
  52. ),
  53. 'SYMBOLS' => array(
  54. '.', ',','\\',"~", "{", "}", "[", "]", "$"
  55. ),
  56. 'CASE_SENSITIVE' => array(
  57. GESHI_COMMENTS => true,
  58. 1 => false,
  59. 2 => false,
  60. 3 => false,
  61. 4 => false,
  62. ),
  63. 'STYLES' => array(
  64. 'KEYWORDS' => array(
  65. ),
  66. 'COMMENTS' => array(
  67. 1 => 'color: #808080; font-style: italic;'
  68. ),
  69. 'ESCAPE_CHAR' => array(
  70. ),
  71. 'BRACKETS' => array(
  72. ),
  73. 'STRINGS' => array(
  74. ),
  75. 'NUMBERS' => array(
  76. ),
  77. 'METHODS' => array(
  78. ),
  79. 'SYMBOLS' => array(
  80. ),
  81. 'REGEXPS' => array(
  82. 1 => 'color: #00A000; font-weight: bold;', // Math inner
  83. 2 => 'color: #800000; font-weight: normal;', // \keyword #202020
  84. 3 => 'color: #2222D0; font-weight: normal;', // {...}
  85. 4 => 'color: #2222D0; font-weight: normal;', // [Option]
  86. 5 => 'color: #00A000; font-weight: normal;', // Mathe #CCF020
  87. 6 => 'color: #F00000; font-weight: normal;', // Structure \begin
  88. 7 => 'color: #F00000; font-weight: normal;', // Structure \end
  89. 8 => 'color: #F00000; font-weight: normal;', // Structure: Labels
  90. //9 => 'color: #F00000; font-weight: normal;', // Structure
  91. 10 => 'color: #0000D0; font-weight: bold;', // Environment
  92. 11 => 'color: #0000D0; font-weight: bold;', // Environment
  93. ),
  94. 'SCRIPT' => array(
  95. )
  96. ),
  97. 'URLS' => array(
  98. ),
  99. 'OOLANG' => false,
  100. 'OBJECT_SPLITTERS' => array(
  101. ),
  102. 'REGEXPS' => array(
  103. // Math inner
  104. 1 => array(
  105. GESHI_SEARCH => "(\\\\begin\\{)(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign )(\\})(.*)(\\\\end\\{)(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)(\\})",
  106. GESHI_REPLACE => '\\4',
  107. GESHI_MODIFIERS => 's',
  108. GESHI_BEFORE => '\1\2\3',
  109. GESHI_AFTER => '\5\6\7'
  110. ),
  111. // \keywords
  112. 2 => array(
  113. GESHI_SEARCH => "(\\\\)([a-zA-Z]+)",
  114. GESHI_REPLACE => '\1\2',
  115. GESHI_MODIFIERS => '',
  116. GESHI_BEFORE => '',
  117. GESHI_AFTER => ''
  118. ),
  119. // {parameters}
  120. 3 => array(
  121. GESHI_SEARCH => "(\\{)(.*)(\\})",
  122. GESHI_REPLACE => '\2',
  123. GESHI_MODIFIERS => 'U',
  124. GESHI_BEFORE => '\1',
  125. GESHI_AFTER => '\3'
  126. ),
  127. // [Option]
  128. 4 => array(
  129. GESHI_SEARCH => "(\[)(.+)(\])",
  130. GESHI_REPLACE => '\2',
  131. GESHI_MODIFIERS => 'U',
  132. GESHI_BEFORE => '\1',
  133. GESHI_AFTER => '\3'
  134. ),
  135. // Mathe mit $ ... $
  136. 5 => array(
  137. GESHI_SEARCH => "(\\$)(.+)(\\$)",
  138. GESHI_REPLACE => '\1\2\3',
  139. GESHI_MODIFIERS => '',
  140. GESHI_BEFORE => '',
  141. GESHI_AFTER => ''
  142. ),
  143. // Structure begin
  144. 6 => array(
  145. GESHI_SEARCH => "(\\\\begin)(?=[^a-zA-Z])",
  146. GESHI_REPLACE => '\\1',
  147. GESHI_MODIFIERS => '',
  148. GESHI_BEFORE => '',
  149. GESHI_AFTER => '\\2'
  150. ),
  151. // Structure end
  152. 7 => array(
  153. GESHI_SEARCH => "(\\\\end)(?=[^a-zA-Z])",
  154. GESHI_REPLACE => '\\1',
  155. GESHI_MODIFIERS => '',
  156. GESHI_BEFORE => '',
  157. GESHI_AFTER => '\\2'
  158. ),
  159. //Structure: Label
  160. 8 => array(
  161. GESHI_SEARCH => "(\\\\)(label|pageref|ref|cite)(?=[^a-zA-Z])",
  162. GESHI_REPLACE => '\\1\\2',
  163. GESHI_MODIFIERS => '',
  164. GESHI_BEFORE => '',
  165. GESHI_AFTER => '\\3'
  166. ),
  167. // Structure: sections
  168. /*9 => array(
  169. GESHI_SEARCH => "(\\\\)(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])",
  170. GESHI_REPLACE => '\1\\2',
  171. GESHI_MODIFIERS => '',
  172. GESHI_BEFORE => '',
  173. GESHI_AFTER => '\\3'
  174. ),*/
  175. // environment begin
  176. 10 => array(
  177. GESHI_SEARCH => "(\\\\begin)(\\{)(.*)(\\})",
  178. GESHI_REPLACE => '\\3',
  179. GESHI_MODIFIERS => '',
  180. GESHI_BEFORE => '',
  181. GESHI_AFTER => ''
  182. ),
  183. // environment end
  184. 11 => array(
  185. GESHI_SEARCH => "(\\\\end)(\\{)(.*)(\\})",
  186. GESHI_REPLACE => '\\3',
  187. GESHI_MODIFIERS => '',
  188. GESHI_BEFORE => '',
  189. GESHI_AFTER => ''
  190. ),
  191. // ---------------------------------------------
  192. ),
  193. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  194. 'SCRIPT_DELIMITERS' => array(
  195. ),
  196. 'HIGHLIGHT_STRICT_BLOCK' => array(
  197. )
  198. );
  199. ?>