Bug 29121 - markdown2pdf calls pdflatex with invalid args
Summary: markdown2pdf calls pdflatex with invalid args
Status: CLOSED WONTFIX
Alias: None
Product: Branch t6
Classification: Distributions
Component: pandoc (show other bugs)
Version: не указана
Hardware: all Linux
: P3 normal
Assignee: Nobody's working on this, feel free to take it
QA Contact: QA t6
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-30 10:10 MSK by Ivan Zakharyaschev
Modified: 2018-08-23 18:41 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2013-06-30 10:10:21 MSK
$ rpm -qf /usr/bin/markdown2pdf /usr/bin/pdflatex 
pandoc-1.6.0.1-alt1
tetex-latex-2.0-alt10
$ 

markdown2pdf doesn't work:

[imz@localhost markdown2pdf-pdflatex_tetex]$ echo 'Hello, world!' > hello.md
[imz@localhost markdown2pdf-pdflatex_tetex]$ markdown2pdf hello.md 
markdown2pdf: Could not read log file
[imz@localhost markdown2pdf-pdflatex_tetex]$ ls
hello.md
[imz@localhost markdown2pdf-pdflatex_tetex]$ 

The problem is: invalid args passed to pdflatex.

[imz@localhost markdown2pdf-pdflatex_tetex]$ strace -e trace=all -fF markdown2pdf hello.md 2> trace
[imz@localhost markdown2pdf-pdflatex_tetex]$ fgrep pdflatex trace 
[pid 26446] stat64("/home/imz/bin/pdflatex", 0xb7c7d590) = -1 ENOENT (No such file or directory)
[pid 26446] stat64("/bin/pdflatex", 0xb7c7d620) = -1 ENOENT (No such file or directory)
[pid 26446] stat64("/usr/bin/pdflatex", {st_mode=S_IFREG|0755, st_size=829468, ...}) = 0
[pid 26451] execve("/home/imz/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = -1 ENOENT (No such file or directory)
[pid 26451] execve("/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = -1 ENOENT (No such file or directory)
[pid 26451] execve("/usr/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = 0
[pid 26451] write(2, "pdflatex: unrecognized option '-"..., 50) = 50
[pid 26451] write(2, "Try `pdflatex --help' for more i"..., 44) = 44
[pid 26448] read(11, "pdflatex: unrecognized option '-"..., 8192) = 94
[imz@localhost markdown2pdf-pdflatex_tetex]$ 


Perhaps, pdflatex from teTeX and from TeXlive take different options.

A solution could be to build two additional subpackages from the pandoc src.rpm: markdown2pdf-texlive and markdown2pdf .

They should depend on the needed TeX packages (everything that is needed for the conversion, any TeX packages), and pass valid arguments to pdflatex.

(Now, pandoc doesn't depend on a TeX distro, and that is OK, because TeX is not needed for most of the conversions done by pandoc, apart from the conversion to PDF done by this separate tool.)
Comment 1 Ivan Zakharyaschev 2013-06-30 10:12:36 MSK
Captured longer error messages from pdflatex:

[imz@localhost markdown2pdf-pdflatex_tetex]$ strace -s 256 -e trace=all -fF markdown2pdf hello.md 2> trace
[imz@localhost markdown2pdf-pdflatex_tetex]$ fgrep pdflatex trace 
[pid 26489] stat64("/home/imz/bin/pdflatex", 0xb7b7d590) = -1 ENOENT (No such file or directory)
[pid 26489] stat64("/bin/pdflatex", 0xb7b7d620) = -1 ENOENT (No such file or directory)
[pid 26489] stat64("/usr/bin/pdflatex", {st_mode=S_IFREG|0755, st_size=829468, ...}) = 0
[pid 26494] execve("/home/imz/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = -1 ENOENT (No such file or directory)
[pid 26494] execve("/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = -1 ENOENT (No such file or directory)
[pid 26494] execve("/usr/bin/pdflatex", ["pdflatex", "-interaction=batchmode", "-output-directory", "/tmp/.private/imz/pandoc", "/tmp/.private/imz/pandoc/hello"], [/* 54 vars */]) = 0
[pid 26494] write(2, "pdflatex: unrecognized option '-output-directory'\n", 50) = 50
[pid 26494] write(2, "Try `pdflatex --help' for more information.\n", 44) = 44
[pid 26491] read(11, "pdflatex: unrecognized option '-output-directory'\nTry `pdflatex --help' for more information.\n", 8192) = 94
[imz@localhost markdown2pdf-pdflatex_tetex]$
Comment 2 Grigory Ustinov 2018-08-23 18:41:26 MSK
В p8 проблема решена.

pandoc hello.md -o hello.pdf

Предварительно установив texlive-recommended.

t6 уже не поддерживается, так что WONTFIX.