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

CodeLite installation/troubleshooting forum
User avatar
ac.verbeck
CodeLite Curious
Posts: 7
Joined: Tue Oct 25, 2011 11:04 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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...
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
Make sure you have read the HOW TO POST thread
User avatar
ac.verbeck
CodeLite Curious
Posts: 7
Joined: Tue Oct 25, 2011 11:04 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
You do not have the required permissions to view the files attached to this post.
Post Reply