Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option for -shell-escape #969

Closed
protz opened this issue Sep 5, 2013 · 13 comments
Closed

Add an option for -shell-escape #969

protz opened this issue Sep 5, 2013 · 13 comments

Comments

@protz
Copy link

protz commented Sep 5, 2013

Hi,

Would it be difficult to add an option to call LaTeX with the -shell-escape flag when compiling to PDF? My use-case is custom minted blocks that I'm adding directly, and this package requires latex to be called with the flag. Granted, I could generate .tex and then compile it myself, but it would definitely be more convenient to have pandoc add the right flag :).

Thanks,

jonathan

@bbolker
Copy link

bbolker commented Nov 28, 2013

+1 ....

@itavero
Copy link

itavero commented Apr 10, 2014

👍

@zackp30
Copy link

zackp30 commented Sep 25, 2014

👍 Really need this (might also be of use to add a generic option for extra LaTeX flags).

jgm added a commit that referenced this issue Mar 7, 2015
Fix issue #969, #1779 by providing --latex-engine-opt
@jgm
Copy link
Owner

jgm commented Mar 29, 2015

We now have --latex-engine-opt, so this can be closed.

@jgm jgm closed this as completed Mar 29, 2015
@bsamadi
Copy link

bsamadi commented Nov 5, 2015

I get an empty space instead of highlighted LaTeX code with the following code. I have added the minted package in a template. To get the right output, I have to compile the generated TeX file with -shell-escape option before the file name. I was wondering if someone has an example of using -shell-escape that works.

title: "Code Chunk with Highlight"
author: "Behzad Samadi"
output:
beamer_presentation:
pandoc_args: [
"--latex-engine-opt", "-shell-escape"
]
keep_tex: true
template: src/beamertemplate.tex

fonttheme: structurebold

Basic - Interfaces {.fragile}

  • LaTeX

\begin{minted}{latex}
\bein{itemize}
\item Here
\end{itemize}
\end{minted}

@jgm
Copy link
Owner

jgm commented Nov 5, 2015

I don't know what version of pandoc you're using, but
there was a problem with --latex-engine-opt that was fixed
(#1779) in pandoc 1.15.0.5.

+++ Behzad Samadi [Nov 05 15 08:11 ]:

I get an empty space instead of highlighted LaTeX code with the following code.
I have add the minted package in a template. To get the right output, I have to
compile the generated TeX file with -shell-escape option before the file name. I
was wondering if someone has an example of using -shell-escape that works.

title: "Code Chunk with Highlight"
author: "Behzad Samadi"
output:
beamer_presentation:
pandoc_args: [
"--latex-engine-opt", "-shell-escape"
]
keep_tex: true
template: src/beamertemplate.tex

fonttheme: structurebold

Basic - Interfaces {.fragile}

* LaTeX

\begin{minted}{latex}
\bein{itemize}
\item Here
\end{itemize}
\end{minted}


Reply to this email directly or [1]view it on GitHub.

References

  1. Add an option for -shell-escape #969 (comment)

@bsamadi
Copy link

bsamadi commented Nov 5, 2015

I was using 1.15.0.6. and then I updated to 1.15.1.1. The issue was the same.

@jgm
Copy link
Owner

jgm commented Nov 5, 2015

I assume you're running pandoc via some kind of wrapper
script? Because pandoc-options in YAML metadata is not
support in pandoc.

+++ Behzad Samadi [Nov 05 15 11:54 ]:

I was using 1.15.0.6. and then I updated to 1.15.1.1. The issue was the
same.


Reply to this email directly or [1]view it on GitHub.

References

  1. Add an option for -shell-escape #969 (comment)

@bsamadi
Copy link

bsamadi commented Nov 5, 2015

Yes. I am using RStudio. When I use:
pandoc_args: [
"--latex-engine-opt", "-shell-escape"
]
The -shell-escape option is passed to the latex engine because it generates the PDF file with no error. If I remove the -shell-escape option, I receive an error.

@jgm
Copy link
Owner

jgm commented Nov 9, 2015

@bsamadi I'm confused about what problem you're encountering, if any.
When using minted, you do need the -shell-escape option, that's true.
And you say it works when you provide this. So, all is well, no?

@bsamadi
Copy link

bsamadi commented Nov 9, 2015

John, I am able to generate the PDF with no error but instead of the highlighted code, I get an empty space. If I compile the generated tex file, I then get the right output. Does the pandoc job finishes with generating the tex file? If that is the case, then the problem is with RStudio and the way it calls pdflatex.

@Lesik
Copy link

Lesik commented Dec 6, 2017

I have the exact same issue as @bsamadi: There is only empty space. I am running

pandoc % --output=file.pdf --latex-engine=pdflatex --latex-engine-opt="-shell-escape"

No RStudio, just editing the file in vim.

@jgm
Copy link
Owner

jgm commented Dec 6, 2017

@Lesik I'm not sure, but this is a closed issue.
If you want to open a new issue, go ahead, but please give full instructions (exact command line, sample input) for reproducing the problem you're having.

jgm added a commit that referenced this issue Aug 15, 2018
We can't always tell if it's LaTeX, ConTeXt, or plain TeX.
Better just to use "tex" always.

Also changed:

ConTeXt writer: now outputs raw "tex" blocks as well as "context".
(Closes #969).

RST writer: uses ".. raw:: latex" for "tex" content.
(RST doesn't support raw context anyway.)

Note that if "context" or "latex" specifically is desired,
you can still force that in a markdown document by using
the raw attribute (see MANUAL.txt):

    ```{=latex}
    \foo
    ```

Note that this change may affect some filters, if they assume that raw
tex parsed by the Markdown reader will be RawBlock (Format "latex").
In most cases it should be trivial to modify the filters to accept
"tex" as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants