Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

add shell-escape in comunity edition #45

Closed
metal3d opened this issue May 3, 2016 · 4 comments
Closed

add shell-escape in comunity edition #45

metal3d opened this issue May 3, 2016 · 4 comments

Comments

@metal3d
Copy link

metal3d commented May 3, 2016

Hello

Is there a way to tell pdflatex to use -shel-escape options ? I tried to change the LatexCompiler options in source but, even if I restart container, the option won't be use (using minted says that the option is not set)

Thanks

@vagnum08
Copy link

Hi,

I also had this problem with minted. I tried changing the _pdflatexCommand in LatexRunner.js and it worked.

Security wise is not the best solution, but if you really want to add shell escape to pdflatex you can do the following.

Enter into the running ShareLatex container using:

 docker exec -it CONTAINER_NAME bash

Then using an editor, let's say vi, and edit /var/www/sharelatex/clsi/app/js/LatexRunner.js
Go to line 66 and change the _pdflatexCommand from

_pdflatexCommand: function(mainFile) {
return LatexRunner._latexmkBaseCommand.concat(["-pdf", "-e", "$pdflatex='pdflatex -synctex=1 -interaction=batchmode %O %S'", Path.join("$COMPILE_DIR", mainFile)]);
  }

to

_pdflatexCommand: function(mainFile) {
return LatexRunner._latexmkBaseCommand.concat(["-pdf", "-e", "$pdflatex='pdflatex -synctex=1 -shell-escape -interaction=batchmode %O %S'", Path.join("$COMPILE_DIR", mainFile)]);
}

Then exit from the container and restart it.

Similarly you can add -shell-escape to any other compiler by changing the corresponding function.

Hope this helps.
Cheers

@metal3d
Copy link
Author

metal3d commented Jan 16, 2017

No news... ?

@vagnum08 that's what I did, it works - so I overrided the docker image to do this. But really, the community version should add this option

@Gibbus2
Copy link

Gibbus2 commented Nov 12, 2019

This is still not fixed..? LatexRunner.js have changed so I don't think I can use the fix suggested by @vagnum08...

@mserranom
Copy link
Contributor

We’ve merged this repository into https://github.com/overleaf/overleaf, so we’re closing all of its issues and will archive it. If this is still a problem, please open a new issue on https://github.com/overleaf/overleaf . Thanks!

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

No branches or pull requests

4 participants