[scribus] designing instructional posters on code/programming -- lots of syntax highlighting

Alec Hill bulk at ahill.io
Wed Jan 4 17:33:02 UTC 2017


On Wed, Jan 4, 2017 at 10:42 AM, Gregory Pittman <gpittman at iglou.com> wrote:

> On 01/04/2017 10:00 AM, Alec Hill wrote:
> > Hello folks :)
> >
> > I would greatly appreciate some advice about what direction to go...
> > realizing this may be a bit of a rabbit hole that might require I spend
> > several hours learning various things, if it's a rabbit hole indeed I'd
> > like to avoid travelling the wrong tunnels if possible...
> >
> > I need to design informational/instructional posters that have lots of
> code
> > samples in which the code is properly syntax-highlighted like you'd see
> in
> > Kate/Gedit/Vim/any IDE etc.
> >
> > What approach should I take for this?
> >
>
> Thanks for checking this out Greg!!

> Here is something I tried just now, that worked surprisingly well.
> I used Kwrite, and imported a python file. In Kwrite, I have an option
> to Export as HTML, which I did. I then loaded into firefox, and
> "printed" as a PS file.
> I could then in Scribus import the PS file, and all the syntax
> highlighting was intact. Checking at high zoom, the resolution of
> characters was excellent. I noted that I could have sent from firefox as
> a PDF file, which should also work.
>
This method is humorously different than what I had imagined :)
It does work.  Though there seems to be a "gotcha" that would be
problematic if I can't find a way to work around it....

- When I import the .ps file through the "Import > Get vector file" option,
the code is placed on a large white canvas, the code takes up a small
portion of the canvas, and there doesn't seem to be any way to crop it.
- When I import it as an image frame the resolution is horrible, so I go
into the filename.html and set large fontsize, reopen that in firefox, and
re-print to the post script file.  By the time I've enlarged the font
enough to get a good resolution in Scribus, half of the code is
clipped/cropped out of the image.  And playing with this some more, the
background color that is specified in the .html file does not seem to get
preserved when firefox goes to print it and the font colors get altered
then as well.

I would add that I tried importing the HTML to Scribus into a text
> frame, and the highlighting was lost. If you look at the HTML file in a
> text editor, you will see that the various colors used should be easily
> editable with Find/Replace.
>
Yeah I see the colors are lost.  Line breaks also seem to be lost.

This is a very different angle than what I anticipated.  I wonder if it
would be better to go forward in this direction trying to resolve the
issues I'm seeing or if it would be better to try something more along the
lines of what I did previously with LaTex?  Or maybe there are still other
methods?  The LaTex method seems like it might be most appropriate, but I'm
a bit ignorant here so that might be a poor assessment.

Thanks,
Alec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20170104/0449753b/attachment.html>


More information about the scribus mailing list