[Scribus] Scribus and syntax highlight

Craig Ringer craig
Fri Feb 29 10:00:02 CET 2008

Fl?vio Pereira wrote:
> Hi. I have been using scribus for some time now, doing basic stuff like
> small ads and  pdf  presentations. But recently I was asked to  compile a
> small book about c++ (explaining the code, while.. do.. for.. if..
> incrementation... and so on). So i would like to know if there's any way to
> add a code (c++ and others) syntax highlighting to scribus. I found some
> implementations on python but I lack the knownledge to adapt or use those
> projects into a scribus plugin. I tried the simpliest solution i could
> think, convert all cpp to html and then get text into box but it doesn't
> keep the colours.

Theoretically you could port the Python highlighting code you found to
work directly on scribus text objects instead. This would probably prove
fairly tricky, though, and I expect you'd run into bugs and limitations
in the Scribus Python interface.

The best way I can think of to do it is to import the highlighted
sections from OpenDocument text documents, or to place them as images.
If you import EPS images (rather than using an image frame) you should
be able to retain the vector shapes of the text and avoid landing up
with ugly looking rasterised text.

Craig Ringer

More information about the scribus mailing list