tectonic
tectonic copied to clipboard
Unknown package results in error: terminal input forbidden
The following minimal sample results in the mentioned error using tectonic -X build
:
\documentclass{article}
\usepackage{dfdfdfdf}
\begin{document}
hello
\end{document}
When removing the \usepackage
command it compiles.
Since the package cannot be found, it's expected that no document is compiled, but the error message can be improved.
Tectonic Version: 0.5.2
Thanks for the report! Indeed, we should provide a better error message here. This might only be possible with a patch to the TeXLive code, but such patches are going to become necessary sooner or later ...
I appreciate the project and would like to provide something instead of just complain :) I will have time to concentrate on the topic in a few weeks, what needs to be done until then?
(Issue can be closed from my side, as fix will take a long time)
Thanks for volunteering! I'd like to keep this issue open to keep track of this issue for the time being.
While the issue is fairly straightforward, I think it will take some fairly in-depth technical work to decide how best to solve it. I think that the first step would be to trace through the LaTeX source code to understand where the request for terminal input is coming from — which would involve digging though lots of low-level TeX code. Not everyone's idea of fun ...
This seems to also happen when you try to \input
a nonexistant file, e.g. this gives error: terminal input forbidden
\documentclass{article}
\begin{document}
\input{missing.tex}
\end{document}
It looks like the error is coming from \@missingfileerror
here: https://github.com/latex3/latex2e/blob/43065449eb954a1170340ec4b75e145619cf289a/base/ltfiles.dtx#L1413-L1418
\gdef\@missingfileerror#1#2{%
\typeout{^^J! LaTeX Error: File `#1.#2' not found.^^J^^J%
Type X to quit or <RETURN> to proceed,^^J%
or enter new name. (Default extension: #2)^^J}%
\message{Enter file name: }%
{\endlinechar\m@ne
\global\read\m@ne to\@gtempa}%
...
And LaTeX overrides \input
to emit it here: https://github.com/latex3/latex2e/blob/43065449eb954a1170340ec4b75e145619cf289a/base/ltfiles.dtx#L1302
\def\input{\@ifnextchar\bgroup\@iinput\@@input}
...
\def\@iinput#1{%
\InputIfFileExists{#1}{}%
{\filename@parse\@curr@file
\edef\reserved@a{\noexpand\@missingfileerror
{\filename@area\filename@base}%
{\ifx\filename@ext\relax tex\else\filename@ext\fi}}%
...
Thanks, that's very helpful! My current vision for this sort of thing is that the default bundle will basically have to patch LaTeX/TexLive in the bundle to change \@missingfileerror
into something that triggers a Tectonic-specific error-reporting builtin. It feels a bit gross but I think that I'd prefer to customize the bundle rather than trying to patch the code on-the-fly, or whatever.
Another tip to workaround the issue is to run with "-p" to print engine messages and identify the offending package, then act upon.
@paulomach, oh man, this tip is amazing!! Instead of
error: terminal input forbidden
I now get
error: terminal input forbidden
Error producing PDF.
! LaTeX Error: File `foobar.tex' not found.
which is an error I can actually work with. Thanks so much!
Hey @jnnks, can you run your file with the above mentioned -p
flag, along the lines of tectonic -p --keep-logs test-file.tex
and report the results back so we can see why this issue is being caused?
Hi @mnrvwl, sorry for the late reply. With the sample code provided in the OP I get the following:
Terminal
Running TeX ...
(test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06> (article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(size10.clo))
! LaTeX Error: File `dfdfdfdf.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name: Writing `test.log` (650 B)
error: terminal input forbidden
test.log
**
(test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06> (article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(size10.clo
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count163
\c@section=\count164
\c@subsection=\count165
\c@subsubsection=\count166
\c@paragraph=\count167
\c@subparagraph=\count168
\c@figure=\count169
\c@table=\count170
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
! LaTeX Error: File `dfdfdfdf.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
@jnnks No worries! As you can see -p
is tectonic's verbose mode and it shows what's happening in a less obscure way. I also believe we should have a better error message there, so the issue can remain open to track the improvements on output messages.
Just wanted to make sure you were aware of this option in case that it helps your workflow and saves some headaches ✌🏻😉
Thanks :) I did not have the opportunity to use tectonic in a meaningful manner again yet. Next time I will definitely add the flag to my workflow!
Hey @jnnks, this is the current output of a missing package as of tectonic 0.11
, how do you like it? 💜
$ tectonic test.tex
Running TeX ...
error: test.tex:4: ! LaTeX Error: File `dfdfdfdf.sty' not found.
error: halted on potentially-recoverable error as specified
@mnrvwl Very nice, thanks for letting me know!
@jnnks No probs! Do you consider the issue closed?