On 01/01/2012 06:46 PM, Bogdan wrote:
On 01-Jan-12 10:00 pm, Richard Heck wrote:
On 01/01/2012 04:27 PM, Bogdan wrote:

pdflatex "\def\myvar{true}\input{myfile.tex}"

One way to do this, then, would be (a) to define a new file format, call
it pdfx (more or less copy over the definition of the PDF (pdflatex)
format, but making that one change from pdf2 to pdfx) and then define a
custom converter for latex --> pdfx. The one for latex --> pdf2 is:
pdflatex $$i
so you'd have to get the quotes right, etc, to make that work.

Not ideal, I know. But if we fix this, it will be 2.1 before the fix is
out, since it will definitely change the file format (probably of layout
files).

Thanks for replying Richard. I already defined a new converter like the above. I use it to compile two versions of the same problem sheet, one with answers, one without (there is a bug with defining that converter for which I found a workaround but I'll make a separate post about it).

However, as you say, it's quite far from ideal for the purpose of paper margins since I'd have to keep modifying the converter and/or file format to fit each document margin requirements etc. Gets the job done for now but it would quite nice to have the possibility of adding code before calling \documentclass{} in the future. Shall I file an enhancement request about this, pointing to this discussion?

Sure.

Richard

Reply via email to