Page 1 of 1

Can't get LaTeX code formatting to work...

Posted: Tue Feb 26, 2013 9:46 am
by ac.verbeck
ACV,

I'm using CodeLite 5.0.6213.
I've followed the WIKI (http://codelite.org/LiteEditor/AddingNewLexer). I looked up the ID for LaTeX and found that it's 14 ( wxSTC_LEX_LATEX 14). I followed the link to identify all the states and built up a LaTeX lexer following the defaults for states 0..12. I added a few keywords.

I cannot get it to show up in the syntax highlighting page. I've checked everything over. I've deleted the %appdata%\CodeLite\lexers in an attempt to get CodeLite to reload it from the Program Files (x86).

What am I doing wrong???

ACV

P.S. LaTeX Lexer is attached...

Re: Can't get LaTeX code formatting to work...

Posted: Tue Feb 26, 2013 10:20 am
by eranif
Hi,

If you look under C:\Program Files (x86)\CodeLite\lexers there are 2 files over there. (lexers_black.xml and lexers_default.xml)
You need to open this XML files and add your lexer into that files so your syntax highlight is part of the theme.

Once you have done that:

- Close codelite
- delete the local lexers file (the ones under %appdata%\codelite\lexers)
- start codelite

You should now have the LaTeX lexer available
Eran

Re: Can't get LaTeX code formatting to work...

Posted: Thu Feb 28, 2013 12:25 pm
by ac.verbeck
Eran,

I got this to work, but it was a lot more touchy than I would have thought.

First, as far as I can tell, all modifications within the c:\Program Files (x86)\CodeLite\lexers directory must be done as administrator. If not, windows 7 will save the original files in a VirtualStore directory. For me this was C:\Users\acv\AppData\Local\VirtualStore\Program Files (x86)\CodeLite. This caused a mysterious problem where explorer could not see the files that I had placed into the directory. Once I switched to the administrator account, this issue was resolved.

Second, the XML parser is very touchy. Any error will cause it to silently fail reading all of the lexers -- not just the broken one. I had several problems in my original lexer that caused this issue. I have attached the working files here.

ACV