Switching the -no-shell-escape flag
Is it possible to override -no-shell-escape flag somehow? I have an use case where I have to use this flag because of inline images and similar weirdness :)
If it's not possible, would you mind if I send an extremely simple pull request which would allow switching this flag?
Just something simple like this maybe? #13
Currently it's not allowed solely for "err on the side of security" reasons. It seemed conceivable, that someone would use this to build untrusted latex sources from users - not something I'd recommend, but I did not want to be the one responsible for threats emerging from that angle.
I realize that there may be a need for these kinds of things, but I will have to think about that. Can you elaborate a slight bit more why in your case it's not possible to work around these issues with "safe" latex?
I completely understand security reasons behind it...
I am using LaTeX "templates" created in-house, so I trust them 100%. I have to update them with data from database and dynamically generated images embedded as base64 strings. I am no LaTeX user myself so after searching for a while how to do that, I came to the conclusion that this flag has to be set and I came across this SO question. In the very end of the answer this guy is describing exactly my workflow :) Looking at his gist I tried to play around with changing flags in your code and realised that my LaTeX with inline images cannot be compiled without changing to -shell-escape.
I have the same issue when using the barcode module in LaTex. They are generated as pictures and then included. The pdflatex command has to be invoked with the -shell-escape option for this to work.
In this case I have to use pdflatex, so it would be sufficient to make the args a class member in the __init__ of PdfLatexBuilder and use self.args to reference them in the build_pdf. Then I could subclass it and overwrite the args to my needs. Right now I subclass PdfLatexBuilder and have to overwrite the complete build_pdf method having all the required imports. Which is nearly the whole class.