3

Is it possible and if so how can you pass flags to the ShareLaTeX compiler which one would have passed as parameters to the LaTeX compiler?

I am using the minted package and need to pass the -shell-escape flag.

  • 6
    You are very unlikely to be allowed shell escape on a server-based installation. – Joseph Wright Apr 22 '13 at 6:19
4

ShareLaTeX announced in their newsletter from January 28th 2014, that their compiler now supports the minted package

  • 2
    ONLY if you place it in the root folder of your project - if you place it in a subdirectory it breaks. – Centril Jan 30 '16 at 0:40
  • Wow, that really got me confused. Thanks. They should be more clear with that. – lindhe Apr 22 '16 at 9:22
  • Note that it also supports converting images from pdf format to png images – Thorbjørn E. K. Christensen Nov 15 '17 at 7:55
3

Without an 'official line' from the ShareLaTeX people, the answer we can give is almost certainly 'no'. The -shell-escape system is turned off as standard for a reason: there are security issues. On a server, these become even more important than on a stand-alone machine. Even if you were allowed -shell-escape, without Pygmentize installed minted still won't work.

It would be possible for ShareLaTeX to install Pygmentize and add it to the 'trusted' list of programs that LaTeX can run without -shell-escape, but minted actually checks for -shell-escape so this wouldn't work. You are therefore out of luck, I think.

0

Alltough a few weeks old now, people might still be interested in a solution. If you are running your own docker, you get this done quite simple by activating the

-shell-escape

flag and installing the software and packages you need (in your case minted). But keep in mind, this is a severe security issue as users can basically run every bash command out of LaTeX now! Edit /var/www/pdflatex and add the flag, thats all you need to do. You can also move

pdflatex (in /usr/bin/ or something like this) to pdflatex_orig

and replace pdflatex through a script calling pdflatex_orig with addtionally added flags. Not much work to be done to edit this, but of course you need your own ShareLaTeX docker to do so.

  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you. – user36296 Sep 23 '16 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.