SourceForge has been redesigned. Learn more.

AW: [texstudio:discussion] compile with shell-escape

TXS - Help
  • Jan  Sundermeyer

    Jan Sundermeyer - 2014-01-27

    Have you tried the exact command in a terminal ?

    -------- Ursprüngliche Nachricht --------
    Von PatrickT
    Datum: 27.01.2014 12:00 (GMT+01:00)
    An "[texstudio:discussion]"
    Betreff [texstudio:discussion] compile with shell-escape

    I would like to compile a .tex file with shell-escape. I am using imagemagick and have the following lines of code:

    \immediate\write18{pdflatex table}
    \immediate\write18{convert -density 300 -alpha on table.pdf table.png}
    \immediate\write18{convert -trim table.png table-trimmed.png}

    I installed imagemagick from

    I created a Build -> User Commands as follows:

    pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex

    but that doesn't work and the log file shows:

    runsystem(pdflatex 1)...disabled (restricted)

    I have also added this line to my .tex file:

    % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]

    which TeXStudio reads and warns about, but the outcome is the same.

    I'm on Mac OS X.

    Note that I can compile the file properly on TeXShop (by simply adding --shell-escape to the default build).

    Below is the full .tex file:

    % !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]
    \node[anchor=base, inner sep=0pt, outer sep=0pt, text=Brown4!30!DarkBlue,scale=50]{1};%
    \immediate\write18{pdflatex 1}
    \immediate\write18{convert -density 300 -alpha on 1.pdf 1.png}
    \immediate\write18{convert -trim 1.png 1-trimmed.png}

    compile with shell-escape

    Sent from because you indicated interest in

    To unsubscribe from further messages, please visit

  • PatrickT

    PatrickT - 2014-01-27

    Have you tried the exact command in a terminal ?

    It works in TeXShop. In the Terminal, I just tried the following, which doesn't give the expected output. Is that what you mean for me to try?

    $ pdflatex -synctex=1 -interaction=nonstopmode --shell-escape test.tex
    This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
    \write18 enabled.
    entering extended mode
    LaTeX2e <2011/06/27>
    Babel <3.9h> and hyphenation patterns for 78 languages loaded.
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class

    LaTeX Warning: Overwriting file `./table.tex'.


    Output written on table.pdf (1 page, 9394 bytes).
    Transcript written on table.log.
    ! Emergency stop.
    <*> test.tex

    ! ==> Fatal error occurred, no output PDF file produced!
    Transcript written on test.log.


Log in to post a comment.