This project is read-only.

TEX Syntax Highlighting

Topics: Developer Forum
Aug 17, 2009 at 9:56 AM
Edited Aug 18, 2009 at 7:57 PM


I currently work on a TEX editor. I descided to use Scintilla because it supports Line-Wrapping. But it seems that the TEX language isn't fully supportet by Scintilla. If I set ConfigurationManager.CustomLanguage to tex, only the part behind \ gets highlighted.

Now I try to colorize comments in a TEX file. Line comments start with % in TEX, but if I set LineCommentPrefix to % in the configuration file, comments still not highlighting.

Here's my current code:

sc.ConfigurationManager.CustomLocation = "def.xml";
sc.ConfigurationManager.Language = "tex";
sc.Styles["COMMENT"].ForeColor = Color.Gray;

def.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Language Name="default">
<Style Name="DEFAULT" FontName="Courier New" Size="10" />
<Language Name="tex">
<Indentation TabWidth="2" UseTabs="false"/>
<Lexer LineCommentPrefix="%">
<Style Name="CHARACTER" ForeColor="Black" BackColor="Red"/>

Any suggestions? :)

Thanks in advance

Aug 18, 2009 at 6:16 PM

Try defining these Styles: