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

feat: add --[no-]shell-escape flag #153

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

feat: add --[no-]shell-escape flag #153

wants to merge 1 commit into from

Conversation

dmke
Copy link
Member

@dmke dmke commented Nov 5, 2024

This allows or prohibits shell command execution from within TeX files.

TODO: Verify whether latexmk -showextraoptions mentions direct support for passing either flag. latexmk(1) does not, but has examples passing it via the -pdf{lua,xe,}latex="COMMAND" options. This would complicate the construction of the latexmk command.

Fixes: #152

@dmke dmke force-pushed the feat/shell-escape branch from d9e5b50 to 0f32231 Compare November 5, 2024 21:45
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 57.57576% with 14 lines in your changes missing coverage. Please review.

Project coverage is 71.10%. Comparing base (d0ecbbf) to head (5bdbbbb).

Files with missing lines Patch % Lines
cmd/texd/main.go 0.00% 11 Missing ⚠️
tex/engine.go 86.36% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
- Coverage   71.32%   71.10%   -0.23%     
==========================================
  Files          34       34              
  Lines        1859     1886      +27     
==========================================
+ Hits         1326     1341      +15     
- Misses        470      482      +12     
  Partials       63       63              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmke dmke force-pushed the feat/shell-escape branch from 0f32231 to 3c8d02f Compare November 8, 2024 18:47
@dmke dmke force-pushed the feat/shell-escape branch from 3c8d02f to 998ab89 Compare November 8, 2024 19:09
@dmke dmke force-pushed the feat/shell-escape branch 4 times, most recently from c08a977 to d11b2c0 Compare November 26, 2024 18:27
This allows or prohibits shell command execution from within TeX files.

The use case here is to allow users to download images from within the
build process, e.g. compiling something like this with `lualatex`:

    \documentclass{article}
    \usepackage{luacode}
    \usepackage{graphicx}

    \begin{document}
    \begin{luacode*}
      os.execute("curl -o apod.jpg https://apod.nasa.gov/apod/")
    \end{luacode*}
    \includegraphics{apod.jpeg}
    \end{document}

To this end, I've included `curl` into the base image.

Fixes: #152
@dmke dmke force-pushed the feat/shell-escape branch from d11b2c0 to 5bdbbbb Compare November 26, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow --shell-escape equivalent
1 participant