GNOME Bugzilla – Bug 361209
[PATCH] Better LaTeX .lang file
Last modified: 2008-06-20 06:40:11 UTC
See the enclosed patch against gtksourceview as in Gedit 2.14.4 (Ubuntu Dapper). Relative to the current one, the new .lang file does the following: * it matches words enclosed in braces, so that they can be colored differently. Thus, e.g., \begin{theorem} can result in "begin" being colored in blue and "{theorem}" in green. * it has greater granularity in matching commands: in particular, it explicitly recognizes \section & friends, \ref & friends, \begin-\end pairs. * it also recognizes a variety of math commands (e.g. greek letters) so they can be colored differently. * it catches \emph{xxxx}, \textit{xxxx} and \textbf{xxxx} so that they can be colored differently, emphasized and/or boldfaced as needed. My current settings for the various elements (foreground only: I did not touch the backgrounds). "default" means I did not change settings for a particular element (e.g. Command) --- this applies to elements that are also defined in the latex.lang file that comes with gedit by default. BeginEndCommand: Bold #231BA6 BoldCommands: Bold #641B1B Command: default Comment: default Comment Environment: default EmphItCommands: Italic #4D0909 InBraces: #288A3B Include: default Keyword: default Math: default MathSymbols: Bold #61167D RefCommands: Bold #299F12 SectionCommands: Bold #962183 TODO: Bold #FB1008
Created attachment 74426 [details] [review] Patch for latex.lang
Created attachment 74427 [details] Modified latex.lang file Just to be sure, I'm attaching the patched latex.lang file as well.
The latex.lang in svn is a new format one, and it already tries to match commands, and some special commands. Would be nice if someone (Marciano) looked at it and added those greek letters and whatnot.
I've added the commands from the patch.