yegor256 / iexec

Execute a command-line command from LaTeX, check the exit code, and then \input the result into the document
https://ctan.org/pkg/iexec
MIT License
6 stars 2 forks source link

Underscore not escaped #7

Closed jgollenz closed 1 year ago

jgollenz commented 2 years ago

\iexec[stdout=foo.txt]{echo $MY_VAR}

will result in

unhbox voidb@x protect penalty @M hskip z@skip T1textunderscore protect discretionary {char hyphenchar font }{}{}protect penalty @M hskip z@skip VAR

A shell variable is not my actual use case, I'm trying to use jq and the json key also contains an underscore. Unfortunately I have no experience with writing latex plugins, so I'm having a hard time figuring out how to fix this. I saw this escaping and tried to append something like \let\__%, but no avail.

yegor256 commented 1 year ago

@jgollenz see 0582fd4 and f66fd29 The test works for me.

yegor256 commented 1 year ago

@jgollenz maybe the problem is related to the fact that you don't use quiet option and the result of execution gets imported into your document. This text may have some issues, that's why your compiler complains.