After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 361209 - [PATCH] Better LaTeX .lang file
[PATCH] Better LaTeX .lang file
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2006-10-10 17:38 UTC by Marciano Siniscalchi
Modified: 2008-06-20 06:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch for latex.lang (4.59 KB, patch)
2006-10-10 17:39 UTC, Marciano Siniscalchi
none Details | Review
Modified latex.lang file (5.02 KB, text/plain)
2006-10-10 17:40 UTC, Marciano Siniscalchi
  Details

Description Marciano Siniscalchi 2006-10-10 17:38:28 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
Comment 1 Marciano Siniscalchi 2006-10-10 17:39:12 UTC
Created attachment 74426 [details] [review]
Patch for latex.lang
Comment 2 Marciano Siniscalchi 2006-10-10 17:40:54 UTC
Created attachment 74427 [details]
Modified latex.lang file

Just to be sure, I'm attaching the patched latex.lang file as well.
Comment 3 Yevgen Muntyan 2007-09-04 15:10:29 UTC
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.
Comment 4 Yevgen Muntyan 2008-06-20 06:40:11 UTC
I've added the commands from the patch.