otfried / ipe

The Ipe extensible drawing editor
http://ipe.otfried.org
125 stars 9 forks source link

Passing arguments to pdflatex #494

Closed LenAgain closed 1 month ago

LenAgain commented 5 months ago

I've looked for other issues covering this and found this mailing list thread but I found the solution wasn't very satisfactory.

My Ipe figures have a fairly large preamble which I would like to dump into a format file using -ini mode. I use this method with my LaTeX documents to drastically reduce compile time. To use the format I either need to put a magic %&preamble comment at the top of the file (which I can't do as the preamble from the stylesheet is inserted part way through the latex file that's compiled), or I need to pass -fmt=preamble to pdflatex.

Since there are already the latex engine and latex preamble options in the Ipe document properties window, it would make sense to add an field for arguments to pass in too. Is this something that could be implemented or is there a better way to do what I'm trying?

otfried commented 1 month ago

What I have implemented now is the following:

If the LaTeX preamble starts with %& , then the first line of the preamble is placed at the top of the LaTeX source file.

Will this solve your problem?

LenAgain commented 1 month ago

Cheers for getting round to this.

Sounds like that should solve my problem, I'll give it a test at some point tonight/ tomorrow.

otfried commented 1 month ago

Please let me know if 7.2.29 solves your needs, so we can close this issue or do something more complicated.

LenAgain commented 1 month ago

Apologies, I've been a little busy lately.

I've tested dumping a format and using the magic comment, which works as expected. It does feel like a bit of a hacky solution though, but it's good enough for me.

I'll close this issue as my problem is solved, but it might be worth having the option to pass arguments to the LaTeX engine if it's not too much hassle to implement. Cheers.