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
inputminted
quoted arguments for <langage>
differ from xelatex
#1114
Comments
Hey @goyalyashpal thx for the issue! 🩵 Could you provide a MWE for me to test things out? Also could you share the output when using |
sure! here's full reproduction details: FILES TREE:% ./src/document.tex
\begin{filecontents}[noheader]{./test.psql}
mysql-> select * from thistable;
\end{filecontents}
\documentclass{article}
\usepackage{minted}
\begin{document}
% \inputminted{psql}{test.psql}
% \inputminted{psql -F keywordcase:case=upper}{test.psql} % <- Naked: works in tectonic
\inputminted{"psql -F keywordcase:case=upper"}{test.psql} % <- "Quoted": works in {pdf,xe}latex
\end{document}
Other / Trivial files$ tree -aC --dirsfirst --noreport
.
├── src
│ ├── _postamble.tex
│ ├── _preamble.tex
│ └── document.tex
├── .latexmkrc
└── Tectonic.toml
# ./Tectonic.toml
[doc]
name = "latexmk_texlab"
bundle = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar"
[[output]]
name = "default"
type = "pdf"
shell_escape = true
index = "document.tex"
# ./.latexmkrc
$pdf_mode = 1; # tex -> pdf
# $pdf_mode = 5; # tex -> xdv -> pdf
@default_files = ('src/document.tex');
# $aux_dir='_build/auxx'; # AVOID .: complications with filecontents
# $out_dir='_build'; # AVOID .: complications with filecontents
ENVIRONMENT & VERSIONS:$ systeminfo | grep -iA1 "os name"
OS Name: Microsoft Windows 10 Home Single Language
OS Version: 10.0.19045 N/A Build 19045
$ tectonic -V
Tectonic 0.14.1
$ pdflatex --version | head -n1 -
MiKTeX-pdfTeX 4.16 (MiKTeX 23.10.12)
$ xelatex --version | head -n1 -
MiKTeX-XeTeX 4.10 (MiKTeX 23.10.12)
CONSOLE I/O:*tex compatible ("quoted")$ pdflatex --shell-escape -interaction=nonstopmode src/document.tex | tail -n4 -
/cm/cmr12.pfb><C:/Program Files/MiKTeX/fonts/type1/public/amsfonts/cm/cmtt12.pf
b>
Output written on document.pdf (1 page, 17232 bytes).
Transcript written on document.log.
$ xelatex --shell-escape -interaction=nonstopmode src/document.tex | tail -n4 -
A7B.pygtex) [1] (document.aux) )
(see the transcript file for additional information)
Output written on document.pdf (1 page).
Transcript written on document.log.
$ tectonic -X build 2>&1 | grep -niA9 "psql"
23:note: running shell command: `pygmentize -l "psql -F keywordcase:case=upper" -f latex -P commandprefix=PYG -F tokenmerge -P stripnl=False -o _minted-default/C08E6104B7DE77ADBE04D2869C2F686CB43FCAD6DFDF36838D64F64DE4C714A2.pygtex test.psql`
24:Error: no lexer for alias '"psql' found
25-warning: command exited with error code 1
26:error: failed to execute the shell-escape command "pygmentize -l "psql -F keywordcase:case=upper" -f latex -P commandprefix=PYG -F tokenmerge -P stripnl=False -o _minted-default/C08E6104B7DE77ADBE04D2869C2F686CB43FCAD6DFDF36838D64F64DE4C714A2.pygtex test.psql": execution of the request failed
27-error: document.tex:19: Package minted Error: Missing Pygments output; \inputminted was
28-probably given a file that does not exist--otherwise, you may need
29-the outputdir package option, or may be using an incompatible build tool,
30-or may be using frozencache with a missing file.
31-
32-See the minted package documentation for explanation.
33-Type H <return> for immediate help
34-error: halted on potentially-recoverable error as specified
tectonic compatible (naked)$ tectonic -X build 2>&1| tail -n4 -
warning: warnings were issued by the TeX engine; use --print and/or --keep-logs for details.
note: Running xdvipdfmx ...
note: Writing `.\build\default\default.pdf` (6.78 KiB)
note: Skipped writing 2 intermediate files (use --keep-intermediates to keep them)
$ xelatex --shell-escape -interaction=nonstopmode src/document.tex 1>/dev/null
Error: no lexer for alias 'psql -F keywordcase:case=upper' found
$ pdflatex --shell-escape -interaction=nonstopmode src/document.tex 1>/dev/null
Error: no lexer for alias 'psql -F keywordcase:case=upper' found |
So far I can't reproduce on macOS/Linux, maybe @vlasakm has some ideas;) |
i.e. for you, tectonic was working on "Quoted" one, and not on naked one; right? |
@goyalyashpal so far only |
Thanks for the MWE, it got me started. I think the problem is your usage of \inputminted[⟨options⟩]{⟨language⟩}{⟨filename⟩} So the first mandatory argument is the language. The fact that it gets literally input into the command line invocation of But, you want \minted@def@optcl{keywordcase}{-F keywordcase:case}{#1} It's from the implementation part, and the details are not important, but it essentially tells us that the \inputminted[keywordcase=upper]{psql}{test.psql} Full MWE: \begin{filecontents}[noheader]{./test.psql}
mysql-> select * from thistable;
\end{filecontents}
\documentclass{article}
\usepackage{minted}
\begin{document}
\inputminted[keywordcase=upper]{psql}{test.psql}
\end{document} In any case the quoted use is wrong, Now, it is actually interesting that the following works: \begin{minted}{psql -F keywordcase:case=upper}
mysql-> select * from thistable;
\end{minted} While this does not (neither quoted nor bare) as also reproduced by @Neved4 : \begin{filecontents}[noheader]{./test.psql}
mysql-> select * from thistable;
\end{filecontents}
\inputminted{psql -F keywordcase:case=upper}{test.psql} In the first case The help message actually mentions this exact use case:
|
i wonder why it worked for me. and also, what's the conclusion? should this behave same as {xe,pdf}latex or how? |
It very likely worked for you because you are Windows, whereas I tested only on Linux.
For me personally, anything that doesn't behave exactly as xelatex is a bug (minus of course the intended differences, like here the need to set |
so, i leave up to you (and others) to decide when to close this issue 😃 |
You uncovered the different behavior and that needs fixing. I suggest to keep the issue open, until we decide whether to do something about it. We could probably start a new issue, but the context is already here. |
inputminted
quoted arguments for <langage>
differ from pdflatex
inputminted
quoted arguments for <langage>
differ from xelatex
details
pdflatex
treats the unquotedpsql ...
as a whole as the alias nametectonic
interprets the quoted"psql ..."
aspygmentize -l "psql -F keywordcase:case=upper" -f latex ...
the syntax for command is:
\inputminted[⟨options⟩]{⟨language⟩}{⟨filename⟩}
it seems that:
{<language>}
in quotes, and so, on using a quoted argument, the quotes matches up and the supplied argument essentially becomes naked one.pygmentize -l "<language>" ...
which with quoted <language> becomes:pygmentize -l ""<language>"" ...
discussion
logs
Console logs _(click to expand)_
tectonic
on quoted"psql ..."
pdflatex
on unquoted "psql ..."The text was updated successfully, but these errors were encountered: