Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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

TXS - Help
2014-01-27
2014-01-27
  • Have you tried the exact command in a terminal ?

    -------- Ursprüngliche Nachricht --------
    Von PatrickT ptoche@users.sf.net
    Datum: 27.01.2014 12:00 (GMT+01:00)
    An "[texstudio:discussion]" 907840@discussion.texstudio.p.re.sf.net
    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 http://cactuslab.com/imagemagick/

    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]
    \documentclass{article}
    \usepackage{filecontents}
    \begin{filecontents}{1.tex}
    \PassOptionsToPackage{svgnames,x11names}{xcolor}
    \documentclass[tikz,margin=0pt]{standalone}
    \begin{document}%
    \fontfamily{pzc}\selectfont%
    \begin{tikzpicture}%
    \node[anchor=base, inner sep=0pt, outer sep=0pt, text=Brown4!30!DarkBlue,scale=50]{1};%
    \end{tikzpicture}%
    \end{document}%
    \end{filecontents}
    \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 sourceforge.net because you indicated interest in https://sourceforge.net/p/texstudio/discussion/907840/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
  • 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
    (./test.tex
    LaTeX2e <2011/06/27>
    Babel <3.9h> and hyphenation patterns for 78 languages loaded.
    (/usr/local/texlive/2013/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
    (/usr/local/texlive/2013/texmf-dist/tex/latex/base/size10.clo))
    (/usr/local/texlive/2013/texmf-dist/tex/latex/filecontents/filecontents.sty)

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

    [LONG SECTION DELETED]

    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.