Closed htvogler closed 4 years ago
Personally I always output to TeX, and the use the -B option to actually build the PDF. You seem to be using the pandoc direct PDF output template?
Hi Ian! Thank you so so much for an awesome tool, I've spent some time with it and I'm loving being able to export to multiple file types simultaneously.
I've also been trying to export to both Word and PDF simultaneously, and I get the same error code and 'Script does not exist' - the funny thing is the PDF still exports (seemingly) perfectly with no noticeable issues as of yet. Tried searching around for insights but I don't have any expertise in Ruby/Pandoc/Pandocomatic really. Thought I should post this here in case it helps you decode what's going on.
Separately, when you say you build with -B does that just mean scrivomatic -B my.tex
?
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.27 Report @ 2020-04-12 17:29:03 +0800 ===
=== ------------------------------------------------------ ===
Working directory: /Users/hubert/Desktop
Initiating with Ruby 2.6.3
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="Summative_Scrivener.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/hubert/bin:/Library/TeX/texbin:/usr/local/bin:/Users/hubert/anaconda3/bin:/Users/hubert/.local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/hubert/bin:/Library/TeX/texbin:/usr/local/bin:/Users/hubert/anaconda3/bin:/Users/hubert/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Scrivener.app/Contents/Resources/MultiMarkdown/bin
===------ TOOL PATHS: ------===
---pandoc: /usr/local/bin/pandoc | V: 2.9.2.1
---pandocomatic: /usr/local/bin/pandocomatic | V: 0.2.6
---ruby: /usr/bin/ruby | V: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
---python: /Users/hubert/anaconda3/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /Library/TeX/texbin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic --debug Summative_Scrivener.md
::: (3) + converting /Users/hubert/Desktop/Summative_Scrivener.md 2 times:
::: (2) - convert Summative_Scrivener.md -> Summative_Scrivener.docx
::: pandoc --standalone \
::: --verbose \
::: --filter=/usr/local/bin/pandoc-citeproc \
::: --filter=/Users/hubert/.local/share/pandoc/filters/prependAll \
::: --filter=/Users/hubert/.local/share/pandoc/filters/simplifyMetadata \
::: --lua-filter=/Users/hubert/.local/share/pandoc/filters/pagebreak.lua \
::: --bibliography=/Users/hubert/.local/share/pandoc/Bibliography.json \
::: --csl=/Users/hubert/.local/share/pandoc/csl/chicago-author-date.csl \
::: --reference-links \
::: --from=markdown \
::: --to=docx \
::: --reference-doc=/Users/hubert/.local/share/pandoc/templates/custom.docx \
::: --output=/Users/hubert/Desktop/Summative_Scrivener.docx
::: [INFO] Running filter /usr/local/bin/pandoc-citeproc
::: [INFO] Completed filter /usr/local/bin/pandoc-citeproc in 79 ms
::: [INFO] Running filter /Users/hubert/.local/share/pandoc/filters/prependAll
::: [INFO] Completed filter /Users/hubert/.local/share/pandoc/filters/prependAll in 72 ms
::: [INFO] Running filter /Users/hubert/.local/share/pandoc/filters/simplifyMetadata
::: [INFO] Completed filter /Users/hubert/.local/share/pandoc/filters/simplifyMetadata in 56 ms
::: [INFO] Running filter /Users/hubert/.local/share/pandoc/filters/pagebreak.lua
::: [INFO] Completed filter /Users/hubert/.local/share/pandoc/filters/pagebreak.lua in 37 ms
::: [INFO] Not rendering RawInline (Format "tex") "\\cite{Amatulli}"
::: (1) - convert Summative_Scrivener.md -> Summative_Scrivener.pdf
::: pandoc --to=latex \
::: --pdf-engine=xelatex \
::: --standalone \
::: --verbose \
::: --filter=/usr/local/bin/pandoc-citeproc \
::: --filter=/Users/hubert/.local/share/pandoc/filters/assimilateMetadata \
::: --lua-filter=/Users/hubert/.local/share/pandoc/filters/pagebreak.lua \
::: --bibliography=/Users/hubert/.local/share/pandoc/Bibliography.json \
::: --csl=/Users/hubert/.local/share/pandoc/csl/chicago-author-date.csl \
::: --reference-links \
::: --from=markdown \
::: --template=/Users/hubert/.local/share/pandoc/templates/custom.latex \
::: --output=/Users/hubert/Desktop/Summative_Scrivener.pdf
::: [INFO] Running filter /usr/local/bin/pandoc-citeproc
::: [INFO] Completed filter /usr/local/bin/pandoc-citeproc in 69 ms
::: [INFO] Running filter /Users/hubert/.local/share/pandoc/filters/assimilateMetadata
::: [INFO] Completed filter /Users/hubert/.local/share/pandoc/filters/assimilateMetadata in 70 ms
::: [INFO] Running filter /Users/hubert/.local/share/pandoc/filters/pagebreak.lua
::: [INFO] Completed filter /Users/hubert/.local/share/pandoc/filters/pagebreak.lua in 24 ms
::: Script does not exist: ''.
:: exit status: pid 60941 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug Summative_Scrivener.md !!!
Hi @hubertau, I always output to latex rather than final PDF with Pandoc, so for example in my scrivener metadata (build to docx and latex):
pandocomatic_:
use-template: [docx-refs, latex-refs]
Then in the post-processing command-line if I want a PDF to be built from the latex:
The benefit of this is I get the source .tex file I can inspect if there are some rendering errors or glitches (like missing references in the bib file), and I get more debug info in scrivomatic.log as I can capture all the output of latexmk
(the tool that is used for building PDFs from latex files).
Pandoc's direct-to-pdf doesn't allow scrivomatic to capture or log the latex>pdf process so it is more opaque (although logging is getting better in Pandoc last few releases).
If the PDF and DOCX both build OK I would just ignore the error. I will check with one of my templates and a direct-to-PDF build later to see if I can reproduce the error...
OK, I can reproduce the error message too, and it is due to the cleanup
section of pandocomatic.yaml, it contains the 'latexmk -c'
command which is supposed to cleanup but for some reason pandocomatic
can't find it (even though it is available in the path sent to pandocomatic as you can see in the top part of the log). Just remove this entry from your pandocomatic.yaml
file and the error will go away, e.g.:
#-----------------------------------------------------------------------------
pdf-refs:
extends: [latex-refs]
pandoc:
to: pdf
pdf-engine: 'xelatex'
cleanup: []
Oh fantastic! Thank you so much - glad to know the error can be cleaned up, though I agree now the -B flag makes more sense :)
I changed my pandocomatic.yaml, suggest those who have forked from mine do the same, and I'll close this...
Thanks a lot, Ian! The -B flag is all it needs, really.
I would like to convert my Scrivener file to PDF via your pdf-refs template. Since I'm using the fixLaTeX postprocessor to replace missing glyphs, I also need to run latexmk, which produces the following error:
If I produce the PDF via the latex template it works fine. Do you have any idea what the problem is?
Thanks!