Custom Folding for LaTeX

Discuss any topics about the editor here

Custom Folding for LaTeX

Postby toeholds » Fri Apr 09, 2010 8:24 pm

Hello all. I've been (unknowingly) using Editra for some time as it was wrapped in the Enthought python distribution. A few days ago I decided to try out Editra-proper, and have been very intrigued about the thought of using it to write my current paper.

The paper, sadly for me, involves a few hundred figures. I would very much like to be able to have code-folding (either on indent ala python, or faux braces %{ %} pairs), and I found myself on this page: http://editra.org/syntax_highlighting_customization. However, I have only managed to kill all LaTeX highlighting with my efforts. Suggestions?
toeholds
Limited User
 
Posts: 2
Joined: Fri Apr 09, 2010 8:11 pm

Re: Custom Folding for LaTeX

Postby cody » Fri Apr 09, 2010 10:46 pm

For Latex Editra uses the builtin Scintilla lexer. If it does not support folding then you would have to write a custom lexer that does support it which would mean code changes since it is not possible to do this with the xml interface.

If you wanted to try this I would suggest getting the Scintilla source code translating its LaTex highlighter to Python then adding additional code to implement the folding (see scintillas documentation for this). There are some examples of custom lexers in Editra/src/syntax, see _xtext.py, though none of them have implemented any folding.



Cody
User avatar
cody
Site Admin
 
Posts: 1314
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Custom Folding for LaTeX

Postby toeholds » Fri Apr 09, 2010 11:14 pm

Thanks Cody for the super-quick reply. (And, of course, writing the great editor at first place!) I had a look at the scintilla lexer business, and it's abit more than I can chew on right now. Ah, c'est la vie...
toeholds
Limited User
 
Posts: 2
Joined: Fri Apr 09, 2010 8:11 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron