cvfosammmm / Setzer

LaTeX editor written in Python with Gtk
https://www.cvfosammmm.org/setzer/
Other
393 stars 36 forks source link

Feature Request: Postscript build options #223

Open steve8988 opened 3 years ago

steve8988 commented 3 years ago

I was wondering whether it was possible to add more build options. I use lots of "tricks" that work only in postscript, which don't seem to work using the provided build processes (xelatex, pdflatex, lualatex). So being provided with a build path of tex -> dvi -> ps or tex -> dvi -> ps -> pdf would be good. This could probably be done by latexmk, since you can pass switches (such as -ps) to it to get it to generate postscript files or -pdfps to generate pdfs through the postscript stage. Thank you.

cvfosammmm commented 3 years ago

What do you use currently to make it work? Can you upload a sample document?

steve8988 commented 3 years ago

No problems, here is a test file, where I'm using a package called psfrag.

test.zip

I usually use latexmk with the -pdfps switch, which compiles using latex/dvips to create a postscript file, and then ps2pdf to create the final pdf. Going through the postscript allows packages (like psfrag) to replace text in eps files. If using just pdflatex, it skips the postscript creation stage, which means packages such as psfrag and pstricks won't work.

I've managed to get this to work by using pdflatex, setting "Use latexmk" and then modifying the builder_build_latex.py, where I set the latexmk interpreter_option to pdfps

if query.build_data['use_latexmk']:
          if query.build_data['latex_interpreter'] == 'pdflatex':
              interpreter_option = 'pdfps'