Add LaTeX highlighting

Added a new highlighting mode from LaTeX which understands
commands, inline math and comments. It's a very simple parser, but
it doesn't understand comments inside inline math and it doesn't
do anything complicated with command arguments.
This commit is contained in:
James Allen 2011-08-11 01:21:35 +01:00
commit 7ab31f2f87
4 changed files with 131 additions and 1 deletions

View file

@ -36,6 +36,7 @@
<option value="textile">Textile</option>
<option value="groovy">Groovy</option>
<option value="scala">Scala</option>
<option value="latex">LaTeX</option>
</select>
</td>
</tr>
@ -65,6 +66,7 @@
<option value="textile">Textile</option>
<option value="groovy">Groovy</option>
<option value="scala">Scala</option>
<option value="latex">LaTeX</option>
</select>
</td>
</tr>
@ -683,6 +685,29 @@ object implicits extends Application {
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y))
}</script>
<script type="text/editor" id="latex">\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
\maketitle
\LaTeX{} is a document preparation system for the \TeX{}
typesetting program. It offers programmable desktop publishing
features and extensive facilities for automating most aspects of
typesetting and desktop publishing, including numbering and
cross-referencing, tables and figures, page layout, bibliographies,
and much more. \LaTeX{} was originally written in 1984 by Leslie
Lamport and has become the dominant method for using \TeX; few
people write in plain \TeX{} anymore. The current version is
\LaTeXe.
% This is a comment; it will not be shown in the final output.
% The following shows a little of the typesetting power of LaTeX:
\begin{align}
E &= mc^2 \\
m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
\end{align}
\end{document}
</script>
<input id="cockpitInput" type="text"/>
<!-- DEVEL-->