Closed dbitouze closed 2 years ago
I can't reproduce this. Here's what I'm seeing with 2.19.2:
% pandoc parent.tex -t markdown
Foo
Tried with both release and dev version, on macos and linux.
Quite strange! Here is what I'm seeing:
$ pandoc parent.tex -t markdown
[WARNING] Could not load include file child.tex at parent.tex line 1 column 53
$
Just to be sure:
$ cat parent.tex && cat child.tex
\documentclass{article}\begin{document}\input{child}\end{document}
Foo
$ pandoc parent.tex -t markdown
[WARNING] Could not load include file child.tex at parent.tex line 1 column 53
$ pandoc -v
pandoc 2.19.2
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4
User data directory: /home/bitouze/.local/share/pandoc
Copyright (C) 2006-2022 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
% cat parent.tex && cat child.tex
\documentclass{article}\begin{document}\input{child}\end{document}
Foo
% /usr/local/bin/pandoc parent.tex
<p>Foo</p>
% /usr/local/bin/pandoc --version
pandoc 2.19.2
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4
User data directory: /Users/jgm/.local/share/pandoc
Copyright (C) 2006-2022 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
Sigh... From the beginning (Mageia 8
doesn't provide pandoc
):
$ cd
$ mkdir temp
$ cd temp
$ wget -q https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-linux-amd64.tar.gz
$ tar xfz pandoc-2.19.2-linux-amd64.tar.gz
$ cd pandoc-2.19.2/bin
$ printf '%s' '\documentclass{article}\begin{document}\input{child}\end{document}' > parent.tex
$ printf '%s' 'Foo' > child.tex
$ ./pandoc parent.tex
[WARNING] Could not load include file child.tex at parent.tex line 1 column 53
$
I tried that exact sequence of commands on my debian box, and got
<p>Foo</p>
So, I don't know what is happening on your machine. This is strange indeed.
Runs smoothly with a Docker
image. Would be nice to fix this issue though...
I'd like to fix it too, but we need some diagnosis of where the problem lies. Since I can't reproduce it, we're at a dead end unless you can supply more relevant information. I haven't seen any other reports like this. Is there something different about Mageia linux that might be relevant?
You could try compiling pandoc from source.
Compiling pandoc
from source looks very difficult on Mageia
. I asked for help on the Mageia
bug tracker where, since a long time, the lack of pandoc
was deplored.
Let me know if they have any ideas. Otherwise we may need to close this as a dead end.
Looking at the code, I have an idea. Is the TEXINPUTS environment variable set on your system, and if so to what?
echo $TEXINPUTS
Another useful test would be to try a restructured text document with an include. a.rst
.. include:: b.rst
b.rst
Hello
pandoc a.rst -t markdown
This would tell us if the issue is tex-specific.
Looking at the code, I have an idea. Is the TEXINPUTS environment variable set on your system, and if so to what?
Yes, indeed:
$ echo $TEXINPUTS
~/Images//:
[...] This would tell us if the issue is tex-specific.
Seems to be the case:
$ echo ".. include:: b.rst" > a.rst
$ echo "Hello" > b.rst
$ pandoc a.rst -t markdown
Hello
OK! Then that's your issue. You have TEXINPUTS set up to look only in the Images directory. Try
export TEXINPUTS=$HOME/Images/:.
and that should add the working directory . to the list of directories pandoc will search.
Reopening because I can see we're not handling TEXINPUTS quite right (the latex build succeeded).
Reopening because I can see we're not handling TEXINPUTS quite right (the latex build succeeded).
Indeed: the extra dot in export TEXINPUTS=$HOME/Images/:.
makes a mess in LaTeX which makes all compilations fail :smile:.
Right, I think you always want a colon at the end -- this tells tex to use its default directories -- and the dot should go at the beginning.
export TEXINPUTS=.:$HOME/Images//:
In the commit above, I've fixed pandoc so that it will no longer require the dot, but this should get you going for now.
Explain the problem.
pandoc
seems to no longer support LaTeX's\input
, as shown by the following commands:the last one returning:
and the
parent.md
file being empty.Pandoc version?
I'm running a
Mageia 8 GNU/Linux
box.