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

Alec Hill bulk at ahill.io
Thu Jan 5 16:43:32 UTC 2017


On Thu, Jan 5, 2017 at 10:35 AM, Gregory Pittman <gpittman at iglou.com> wrote:

> On 01/05/2017 09:58 AM, Fahad Al-Saidi wrote:
> >>
> >> Hi Alec,
> >>
> >> Please try the following: Enable sytax hightlighting for the language
> you
> > are using in Kate or KWrite (assuming you are using Linux or *BSD).
> Export
> > the file as HTML.
> >>
> >> Launch LibreOffice Writer (*not* LibreOffice Writer Web), open the HTML
> > file and save it as ODT. You can then import the ODT file into a Scribus
> > text frame with all colours intact.
> >>
> >
> > This seems like a great solution, though I can't seem to get it to work.
> > I get the HTML markup in LibreOffice, and then in Scribus after saving
> > as ODT.
> >
> > Greg
> >
> > ___
> >
> >
> > The above solution doesn't work for me but what works for me is copying
> the
> > code from firefox and paste it into libreoffice writer then save it as
> ODT
> > then import it into scribus.
>
> I couldn't get this to work either and retain syntax highlighting. I was
> able to get it to work by exporting as PDF from LibreOffice after
> pasting from the browser, but the downside was that in KWrite I use a
> colored background, which came through to LO and then the PDF.
>
> For me, KWrite -> export as HTML -> print as PS file -> import to
> Scribus as vector works the best, and eliminates the extra step of
> LibreOffice.
>
> Perhaps there is some setting in LO to interpret the HTML markup.
>
> Greg
>
>
Thank you all for the input!  Go team :)

## Method A ##

What's working best for me is:
1) Open code_file.php in Kate/whichever and Export as HTML
2) Open code_file_php.html in Firefox and copy the rendered code
3) Paste that code into LO Writer and save as .odt
4) Import that into a text frame in scribus.

This gives me code in scribus that looks exactly how it does in Kate --
except that background color is missing in Scribus, which is fine because
it's easy to re-create.

## Method B ##

Printing to postscript from the web browser changes the coloring (greys get
turned to black, background color is removed, perhaps other changes) --
which I presume is the web browser trying to make the document more
"printer friendly".  This is a drawback here, as the Solarized color theme
looks really good in kate or other editors, but once I import the .ps file
into scribus the code comments are darker (instead of lighter) than
function names.

Regarding putting the .ps in an image frame:
> Did you try to export to PDF? Or try to change the preview resolution to
high?
> Because normally Scribus renders preview at a lower resolution to improve
performance.
No I didn't think of / realize that.  Noted for future use.  Thank you.

## Method D (for Danger) ##

Noone's said anything about Tex... is this a scary subject?  It kinda
scares me ;^)
When trying to use Minted with LaTex inside a Render Frame I had previously
ignored the error message because it was in a tiny dialog/window that was
near-impossible to read from, but this time I copy/pasted it into a text
document (attached for reference) and got some insight in it...

The error sounds like the minted library is expecting to be used from a
command line with the --shell-escape flag passed to it and that it wants to
be producing a pdf file.  It also says "pygmentize" must be installed, but
I suspect this results from not being able to effectively run the command
as I think pygmentize is actually installed.

Previously I was able to run some command (linux shell) (I have no idea
what the command actually was, a critical omission in my notes) and it
successfully generated (from a tex file) a pdf file of syntax-highlighted
code.  It generated a log file and I can see in that log that pygmentize
command is successfully executed.

Anyhow... the errors in this attached file sound like Scribus is struggling
to invoke Minted.
Anyone know about this?  Is this user error?  Or is this incompatibility
between the software packages?
FYI https://www.sharelatex.com/learn/Code_Highlighting_with_minted and
https://github.com/gpoore/minted.

Thanks,
Alec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20170105/00e1317e/attachment.html>
-------------- next part --------------
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(/tmp/scribus_temp_render_mK2504
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 78 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/extsizes/extarticle.cls
Document Class: extarticle 1996/10/08 v1.0 Non Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo)
(/usr/share/texlive/texmf-dist/tex/latex/base/exscale.sty))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/minted/minted.sty
(/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/float/float.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/catchfile.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))

Package ifplatform Warning: 
    shell escape is disabled, so I can only detect \ifwindows.

))

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

See the minted package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8 \usemintedstyle
                   {monokai}

! Package minted Error: You must have `pygmentize' installed to use this packag
e.

See the minted package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8 \usemintedstyle
                   {monokai}

! LaTeX Error: File `scribus_temp_render_mK2504.pyg' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: pyg)

Enter file name: 
! Emergency stop.
<read *> 
         
l.8 \usemintedstyle{monokai}
                            ^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on scribus_temp_render_mK2504.log.



More information about the scribus mailing list