Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching the -no-shell-escape flag #12

Open
bomb-on opened this issue Jun 24, 2016 · 4 comments
Open

Switching the -no-shell-escape flag #12

bomb-on opened this issue Jun 24, 2016 · 4 comments

Comments

@bomb-on
Copy link
Contributor

bomb-on commented Jun 24, 2016

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?

@bomb-on
Copy link
Contributor Author

bomb-on commented Jun 24, 2016

Just something simple like this maybe? #13

@mbr
Copy link
Owner

mbr commented Jun 25, 2016

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?

@bomb-on
Copy link
Contributor Author

bomb-on commented Jun 26, 2016

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.

@ap91484
Copy link

ap91484 commented Jan 15, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants