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

[LaTeX]: file ending ".tex" is required for \input{} #8092

Closed
gerritzen opened this issue May 28, 2022 · 6 comments
Closed

[LaTeX]: file ending ".tex" is required for \input{} #8092

gerritzen opened this issue May 28, 2022 · 6 comments
Labels

Comments

@gerritzen
Copy link

Explain the problem.
When exporting an Inkscape drawing as PDF, there is an option "Omit text in PDF and create LaTeX file". In addition to foo.pdf, a file foo.pdf_tex is created which is meant to be included using \input{foo.pdf_tex}. This all works well, but pandoc adds .tex to the input file and then complains it doesn't find it:

[WARNING] Could not load include file test.pdf_tex.tex at foo.tex line 6 column 21

(See MRE attached mre.zip)

Proposed solution
Try to find input file exactly as specified and only add .tex if it cannot be found.

Pandoc version?

pandoc 2.14.0.3
Compiled with pandoc-types 1.22, texmath 0.12.3, skylighting 0.10.5.2,
citeproc 0.4.0.1, ipynb 0.1.0.1

Using Fedora 36, pandoc and texlive 2021 from the official repositories.

@gerritzen gerritzen added the bug label May 28, 2022
@mb21
Copy link
Collaborator

mb21 commented May 30, 2022

Thanks for the report. Can you please try with the newest pandoc version? See https://pandoc.org/installing.html

@gerritzen
Copy link
Author

Hoi, unfortunately the output is exactly the same.

$ ~/.local/bin/pandoc --version         
pandoc 2.18
Compiled with pandoc-types 1.22.2, texmath 0.12.5, skylighting 0.12.3,
citeproc 0.7, ipynb 0.2, hslua 2.2.0
Scripting engine: Lua 5.4
[...]

@jgm
Copy link
Owner

jgm commented May 31, 2022

See 11810ed for the reason.
I'll add pdf_tex as a recognized extension.

@jgm
Copy link
Owner

jgm commented May 31, 2022

Wait a second. I just tried compiling a simple tex file with

\include{test.pdf_tex}

using pdflatex, which complained:

No file test.pdf_tex.tex.

So pandoc seems to be doing exactly what pdflatex is doing here. If so, I don't see that a change is warranted.

@gerritzen
Copy link
Author

Interesting. For me, pdflatex and lualatex both compile just fine.

I'm not very super proficient in reading TeX, but page 340 of source2e sounds to me as if the .tex extension is only assumed if \filename@ext is empty. But in the case of Inkscape, it should be pdf_tex.

I tested this by inserting \input{doesnotexist} and \input{doesnotexist.foo}. The first one produces the error

! LaTeX Error: File `doesnotexist.tex' not found.

and the second one

! LaTeX Error: File `doesnotexist.foo' not found.

I am using pdflatex from TeX Live from the Fedora repository.

$ pdflatex --version
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021)
kpathsea version 6.3.3
Copyright 2021 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11

@jgm
Copy link
Owner

jgm commented Jun 1, 2022

I think I was being sloppy; I tried with \include{} not \input{}. Apparently they behave differently. \include always adds .tex (even if the argument already ends in .tex) but \input behaves as you've described.

@jgm jgm closed this as completed in e8be78f Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants