Menu

#398 cairolatex generate both pdf and eps

open
nobody
cairolatex (2)
5
2015-10-15
2014-07-15
Bo Jakobsen
No

Hi

It would be very nice if the cairolatex terminal had an option to generate both eps and pdf output at the same time (like the equivalent output in the drawing program xfig).

I am often in the situation that I both need to include the generated tex file in ordinary latex and in pdflatex (for e.g. generating eps and pdf final output files). In most cases I could use a replot after changing the terminal but if multiplot is in use this is not possible.

Discussion

  • Christoph Bersch

    In recent TeXLive distributions (since 2010), the conversion of eps to pdf images is done on-the-fly if you compile with pdflatex. So, the following should work fine (cannot test it at the moment):

    set terminal cairolatex eps color standalone
    set output 'conversion-test.tex'
    plot x
    set output
    system('latex conversion-test.tex && dvips -o conversion-test-latex.ps conversion-test.dvi && ps2pdf conversion-test-latex.ps')
    system('pdflatex -shell-escape conversion-test.tex')
    

    I'm not sure, if the -shell-escape option is mandatory in this case.

     
  • Bo Jakobsen

    Bo Jakobsen - 2014-07-16

    Thanks for the quick reply.

    I totally agree that the route you suggest works nicely.
    However, my use case is a bit the opposite.

    While preparing a series of figures for a publication I prefer to use pdflatex, which has much nicer looking transparent plots and allows for having all figures in one common document.

    Now the journal which I am submitting to requires eps files.
    I can of course convert the eps file to pdf by something like
    pdftops -eps file.pdf file.eps
    But this would not be done automatically.

    So I still think it would be a nice/usefull feature to have the terminal directly generate the best quality output in the two formats.

    Best
    Bo

     
    • Christoph Bersch

      Have you tried my example? That would work fine in you case, because it generates eps files, which you can send to the journal. And for your compilation the conversion to pdf is done automatically if you're using TeXLive >= 2010.

       
  • Bo Jakobsen

    Bo Jakobsen - 2014-07-16

    Yes I totally agree with your solution the auto conversion works nicely.

    However, I have transparent filledcurves plots (I can try to make a minimal example later), and the pdf output from cairolatex is nicer than the eps
    therefore I prefer pdf output.
    (as I understand eps does not allow natively for transparency, and pdf does)

     
  • Matthew Halverson

    I second this. Working with MiKTeX on windows, this would be a very nice feature.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.