Skip to content

How to make tikzDevice invoke (pdf|xe|lua)latex with -shell-escape ? #172

@EmmanuelCharpentier

Description

@EmmanuelCharpentier

I am stuck with the following problem :

I a .Rnw file, i want to use the minted package, which needs to write files and therefore uses the -shell-escape flag on the latex command line. This is done automagically by my working environment (emacs + AUCTeX).

When knitring a .Rnw file with an R chink generating a figure :

  • tikzDevice builds a .tex file using (most of) the master file's preamble (hence uses \usepackage{minted} if present).
  • tikzDevice calls (pdf|xe|lua)latex on this file, without using the -shell-escape flag

The first invocation of tikz fails with the message :

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

Quitting from lines 34-35 (/home/charpent/Temporaire/Débourrage tikzDevice/Test1/Test1.Rnw)
Erreur : Failed to compile Fig1-1.tex. See Fig1-1.log for more info.

This log file has :

runsystem(mkdir -p _minted-Fig1-1)...disabled (restricted).

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

See the minted package documentation for explanation.

tikzDevice currently does not seem to offer a way to add this flag to the (pdf|xe|lua)latex invocation (I checked that this cannot be done by setting tikzDefaultEngine).

It goes without saying that the same .Rnw file without \usepackage{minted} compiles perfectly...

I'm stuck...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions