iandol / scrivomatic Goto Github PK
View Code? Open in Web Editor NEWA writing workflow using Scrivener's style system + Pandoc for output…
Home Page: https://iandol.github.io/scrivomatic/
License: GNU General Public License v3.0
A writing workflow using Scrivener's style system + Pandoc for output…
Home Page: https://iandol.github.io/scrivomatic/
License: GNU General Public License v3.0
Hi,
I used you crossref examplae, because I'm switching from pure Markdown with Typora as my editor back to Scrivener. Your setup works fine, but I have issue with figures and tables:
Any help is appreciated and thanks very much for your work during the last years
Hi, I hope someone might be able to help me.
I installed Scrivomatic this morning and so far I've had a consistent issue getting past the creation of .md files during the compile sequence – it appears pandoc thinks I'm using the wrong encoding somewhere. This is the despite the fact I've confirmed (to the best of my ability) that my .bib file is using UTF-8.
Googling seems to imply this is a common issue with pandoc conversions, but I can't figure out how any of the solutions apply to the Scrivomatic implementation of pandoc.
Is this something that's come up before as an issue? And is there a fix? Many thanks in advance.
Here's the debug log:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.29 Report @ 2020-07-06 12:48:46 +0100 ===
=== ------------------------------------------------------ ===
Working directory: /Users/charliesmith/Desktop/CHS Draft Transfer.md
Initiating with Ruby 2.6.3
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="CHS\ Draft\ Transfer.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/charliesmith/bin:/Library/TeX/texbin:/usr/local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/charliesmith/bin:/Library/TeX/texbin:/usr/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.7.1
---ruby: /usr/bin/ruby | V: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
---rbenv versions:
---gem: /usr/bin/gem
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic --debug CHS\ Draft\ Transfer.md
::: (4) + converting /Users/charliesmith/Desktop/CHS Draft Transfer.md/CHS Draft Transfer.md 3 times:
::: (3) - convert CHS Draft Transfer.md -> CHS Draft Transfer.docx
::: pandoc --from=markdown
::: --to=docx
::: --reference-doc=/Users/charliesmith/.local/share/pandoc/templates/custom.docx
::: --standalone
::: --filter=/usr/local/bin/pandoc-citeproc
::: --bibliography=/Users/charliesmith/.local/share/pandoc/Zotero\ Bib\ Library.bib
::: --csl=/Users/charliesmith/.local/share/pandoc/csl/apa.csl
::: --output=/Users/charliesmith/Desktop/CHS\ Draft\ Transfer.md/CHS\ Draft\ Transfer.docx
::: pandoc-citeproc: Cannot decode byte '\x9f': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream
::: Error running filter /usr/local/bin/pandoc-citeproc:
::: Filter returned error status 1
::: Error running pandoc => error while running:
:::
::: pandoc --from=markdown
::: --to=docx
::: --reference-doc=/Users/charliesmith/.local/share/pandoc/templates/custom.docx
::: --standalone
::: --filter=/usr/local/bin/pandoc-citeproc
::: --bibliography=/Users/charliesmith/.local/share/pandoc/Zotero\ Bib\ Library.bib
::: --csl=/Users/charliesmith/.local/share/pandoc/csl/apa.csl
::: --output=/Users/charliesmith/Desktop/CHS\ Draft\ Transfer.md/CHS\ Draft\ Transfer.docx
:::
::: Pandoc responded with:
:::
::: pandoc-citeproc: Cannot decode byte '\x9f': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream
::: Error running filter /usr/local/bin/pandoc-citeproc:
::: Filter returned error status 1
:::
:: exit status: pid 79231 exit 243!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug CHS\ Draft\ Transfer.md !!!
I would like to contribute " unit test file" which is also a demo file.
it is a scrivener file, that once compiles , test the unit features . like bold, italics, links , etc
it is so far not exhaustive, not fully fixed, however this is stand by for 3 month now, as I have reached a point that is good enough for me, so I prefer to share it in the current status, rather than perfect and ever.
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.20 Report @ 2019-04-10 15:19:01 +0200 ===
=== ------------------------------------------------------ ===
Running under Ruby 2.3.7
Working directory: /Users/luctaesch/Dropbox/zkn/build_mmd
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="ScrivoTests.md", output=nil, to=nil, yaml="./pandocomatic.yaml", command="pandocomatic", envpath="/Users/luctaesch/bin:/usr/local/bin:/Library/TeX/texbin:/Users/luctaesch/.rbenv/shims", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true>
===------ Final ENV PATH: ------===
/Users/luctaesch/bin:/usr/local/bin:/Library/TeX/texbin:/Users/luctaesch/.rbenv/shims:/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.3.1
---pandocomatic: /Users/luctaesch/.rbenv/shims/pandocomatic | V: Pandocomatic version 0.2.3.0
---ruby: /Users/luctaesch/.rbenv/shims/ruby | V: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
---rbenv: /usr/local/bin/rbenv
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /Library/TeX/texbin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /Users/luctaesch/.rbenv/shims/pandocomatic -c ./pandocomatic.yaml --debug ScrivoTests.md
::: pandoc --from=markdown
::: --to=markdown_mmd
::: --bibliography=mybib.bib
::: --wrap=none
::: --filter=/usr/local/bin/pandoc-citeproc
::: --csl=/Users/luctaesch/.pandoc/csl/chicago-fullnote-bibliography-LTA2.csl.xml
::: Pandocomatic needed 0.6 seconds to convert 'ScrivoTests.md'.
:: exit status: pid 33316 exit 0
results in:
ScrivoTests.md.zip
I am trying to follow the directions for installing pandocomatic and scrivomatic in order to compile a scrivener manuscript containing equations to docx.
So far I can get the math to compile correctly and the figures are also inserted correctly, but I don't get the layout specified in the template (text justified, etc) or given in the scrivener file. There is also no scrivomatic.log file generated.
I suspect there is a problem with correct paths or folders, but I cannot find it. Any suggestions for where to look would be very much appreciated.
Thanks, Anja
when running by hand
/usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
in the workflow_mmd directory, it seems a custom.docx files seems missing.
havent found on workflow or github either.
01:02 $ /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
(4) + converting Workflow.md 3 times:
(3) - convert Workflow.md -> Workflow.docx
pandoc --from=markdown
--to=docx
--reference-doc=custom.docx
--filter=simplifyMetadata.rb
--filter=prependAll.rb
--standalone
--bibliography=workflow.bib
--csl=apa-workflow.csl
--output=/Users/luc_taesch/Desktop/workflow_mmd/Workflow.docx
pandoc: custom.docx: openBinaryFile: does not exist (No such file or directory)
Error running pandoc => error while running:
pandoc --from=markdown
--to=docx
--reference-doc=custom.docx
--filter=simplifyMetadata.rb
--filter=prependAll.rb
--standalone
--bibliography=workflow.bib
--csl=apa-workflow.csl
--output=/Users/luc_taesch/Desktop/workflow_mmd/Workflow.docx
Pandoc responded with:
pandoc: custom.docx: openBinaryFile: does not exist (No such file or directory)
✘-243 ~/Desktop/workflow_mmd
Hi,
I am sorry to bother you but I wondered if you could help me at all in setting up this workflow. I will try to explain where I am up to.
I have the up to date scrivener for mac. I have installed pandoc and pandocomatic. I downloaded and used the scrivomatic template and I have read through the scrivener document and successfully unpacked all of its contents to my desktop in a folder workflow_mmd. Generally it seems to work and I was able to compile and export the scrivener workflow document you made into new dox and html files etc like I think I was supposed to as a test.
Other info. I am using zotero pandoc inline citations in scrivener with the zotpick apple script. This all works and I use marked2 to see how it's looking as I go along.
I am trying to work collaboratively therefore I would like to produce a regular full output from scrivener into a perfectly formatted word document in an academic style.
When I try to compile my own project using your method and files it give me all outputs except from the docx. format which is the main one I need really.
Also would there be a way to make my pandoc citations produce a full bibliography using your method. Up until now I have been doing this by compiling from scrivener into plain text then putting a command through terminal which converts the plain text file into a docx. with a full bibliogrpahy. However, it didn't produce a document which looked nice and formatted well.
The formatting element to all of these methods is what I am struggling to get right you see.
Sorry if I am not being clear, I suppose that is because I am still trying to figure it all out in my head as it is.
Best wishes
Hello I download your example project and try to merge it with my workflow. Nevertheless, I do not find how you input math equations inside the scrivener project. Could you please give me some instructions?
i am running into a hook issue when trying the basic workflow file. any ideas what it could be ? ( just reinstall brew on mojave. note that I have rvm installed. see the path).
would you have a test file to make sure my prerequise are ok ? ( like a .spec for TDD)
===------ Final ENV PATH: ------===
/Users/luc_taesch/bin:/usr/local/bin:/Library/TeX/texbin:/Users/luc_taesch/.rbenv/shims:/Users/luc_taesch/.rvm/wrappers/default:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Scrivener 3.app/Contents/Resources/MultiMarkdown/bin
===------ TOOL PATHS: ------===
---pandoc: /usr/local/bin/pandoc | V: 2.1.3
---pandocomatic: /usr/local/bin/pandocomatic | V:
---ruby: /usr/local/bin/ruby | V: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
---rbenv: /usr/local/bin/rbenv
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
::: env: ruby_executable_hooks: No such file or directory
:: exit status: pid 2835 exit 127
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md !!!
Hi everyone. I have the following problem.
After upgrading to pandocomatic 0.2.5.0 my documents are not converted anymore. I followed all the general instructions here and the instructions to install ruby 2.6.2 via rbenv here. I migrated my pandoc data folder from ~/.pandoc
to ~/.local/share/pandoc
. Although all components seem to be in the right place my scrivener documents are not converted anymore. It seems that pandocomatic doesn't take the input.
Interestingly, the Workflow.scriv works without any problems.
Does anyone have an idea what I'm missing here? Thanks for any kind of help!
Hi,
thank you for your solution. It works for me. My question is:
Hi,
first of all, tnx for this workflow. It's impressive and I really hope to make this working to me, as it would be totally mindchanging :)
I'm using your compile preset to use Scrivomatic but when I compile a script it seems it won't find the tools.
Have a look to this log as an example:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.27 Report @ 2020-04-21 12:09:20 +0200 ===
=== ------------------------------------------------------ ===
Working directory: ###############/Tutorial.md
Initiating with Ruby 2.3.7
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="Tutorial.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="###############/bin:/Library/TeX/texbin:/usr/local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
###############/bin:/Library/TeX/texbin:/usr/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: | V:
---ruby: /usr/bin/ruby | V: ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
!--old ruby incompatible with newer pandocomatic, see https://github.com/iandol/scrivomatic/blob/master/Installing-Ruby.md
---rbenv: /usr/local/bin/rbenv
---python: /usr/local/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /Library/TeX/texbin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
Tool doesn't exist!!!
!!!---scrivomatic::runCommand() Couldn't find to run, please supply a proper path!
the ruby
interpreter used is the system one, but I'm using an updated one coming from homebrew and located at /usr/local/opt/ruby/bin/ruby
pandocomatic was installed as a gem in /usr/local/lib/ruby/gems/2.7.0/bin/pandocomatic
.
Both are in the path in .bash_profle
, but they don't seem to be in ENV PATH in Scrivomatic
Any idea?
I'm trying to follow the instructions in https://raw.githubusercontent.com/iandol/scrivomatic/master/Workflow.scriv.zip (downloaded from https://github.com/iandol/scrivomatic#tldr-simple-summary) and am having a problem that seems similar to #13 except I just installed all the software and everything should be up to date. Here's my scrivomatic log:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.29 Report @ 2020-08-17 06:42:42 -0400 ===
=== ------------------------------------------------------ ===
Working directory: /Volumes/workspace/sigfried/workflow-testing/workflow-mmd
Initiating with Ruby 2.6.3
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="Workflow.md", output=nil, to=nil, yaml="pandocomatic.yaml", command="pandocomatic", envpath="/Users/sigfried/bin:/Users/sigfried/.rbenv/shims:/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.7.0/bin:/Library/TeX/texbin:/usr/local/bin:/Users/sigfried/.local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/sigfried/bin:/Users/sigfried/.rbenv/shims:/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.7.0/bin:/Library/TeX/texbin:/usr/local/bin:/Users/sigfried/.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.7.2
---ruby: /Users/sigfried/.rbenv/shims/ruby | V: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
---rbenv versions:
---gem: /Users/sigfried/.rbenv/shims/gem
---python: /usr/local/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /Library/TeX/texbin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
::: The pandoc option 'base_header_level' (with value '1') is not recognized by paru. This option is skipped.
::: (5) + converting /Volumes/workspace/sigfried/workflow-testing/workflow-mmd/Workflow.md 4 times:
::: (4) - convert Workflow.md -> Workflow.tex
::: pandoc --from=markdown \
::: --to=latex \
::: --template=custom.latex \
::: --toc \
::: --toc-depth=4 \
::: --filter=assimilateMetadata.rb \
::: --standalone \
::: --bibliography=workflow.bib \
::: --csl=apa-workflow.csl
::: /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- paru/filter (LoadError)
::: from /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
::: from ./assimilateMetadata.rb:22:in `<main>'
::: Error running filter assimilateMetadata.rb:
::: Filter returned error status 1
::: Error running pandoc => error while running:
:::
::: pandoc --from=markdown \
::: --to=latex \
::: --template=custom.latex \
::: --toc \
::: --toc-depth=4 \
::: --filter=assimilateMetadata.rb \
::: --standalone \
::: --bibliography=workflow.bib \
::: --csl=apa-workflow.csl
:::
::: Pandoc responded with:
:::
::: /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- paru/filter (LoadError)
::: from /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
::: from ./assimilateMetadata.rb:22:in `<main>'
::: Error running filter assimilateMetadata.rb:
::: Filter returned error status 1
:::
:: exit status: pid 67553 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md !!!
Any ideas what I'm doing wrong?
Thanks!
This is a question about compiling directly to JATS XML (see Journal Publishing Tag Library). JATS XML includes various metadata for article publishing and can potentially be used for displaying an article in a dynamic format (giving access to references and supplementary material via tabs). PKP OJS can use this, for example: https://demo.publicknowledgeproject.org/ojs3/demo/index.php/immersion/article/view/918/463
It seems, pandoc could convert to JATS but I have not figured out how to do this. There was a lua converter but that has been archived (and uses an old JATS version): https://github.com/mfenner/pandoc-jats
Could the lua filter etc. be integrated into scrivomatic? I super appreciate scrivomatic but do not have the knowledge to update and integrate pandoc-jats for this. If it is too complicated or not possible, that is fine. If it is just a matter of copying and pasting the metadata block and lua files somewhere, I can try myself but would still appreciate guidance.
(If I can donate to scrivomatic somehow, I will sure do!)
When I run brew install pandoc-citeproc
, I receive the following error:
Error: pandoc-citeproc has been disabled because it is deprecated upstream!
Thanks.
Hi Ian,
I've noticed in my testing that Scrivomatic only works with an input markdown file with a .md
suffix. If I use a suffix such as .mdown
, or no suffix at all (which is the default when exporting out of Scrivener) then Scrivomatic fails to find the resulting LaTeX file.
I'm not sure what the simplest way to handle this would be, without having to maintain a large list of possible suffixes. If it is possible to have Scrivomatic work without a suffix, that would be ideal.
Thanks,
Jerome
Thank you! Solved it!
Hi. I am getting the following error:
=== ##################################################### ===
=== Scrivomatic V1.0.11 Report @ 2018-01-19 23:38:20 +1100 ===
Running under Ruby 2.3.3
Working directory: /Users/atanas/Desktop/workflow_mmd
====== Input Options: ======
#<struct Scrivomatic::OPT input="'workflow.md'", output=nil, to=nil, command="pandocomatic", envpath="/Library/TeX/texbin:/Users/atanas/bin:/usr/local/bin", build=false, verbose=true, dry_run=false>
====== Final ENV PATH: ======
/Library/TeX/texbin:/Users/atanas/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
====== TOOL PATHS: ======
---pandoc: /usr/local/bin/pandoc | V: 2.1
---pandocomatic: /usr/local/bin/pandocomatic | V: Pandocomatic version 0.2.2.1
---ruby: /usr/bin/ruby | V: ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
---rbenv: /usr/local/bin/rbenv
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
… running pandocomatic, please wait …
====== COMMAND OUTPUT: ======
:: Running: /usr/local/bin/pandocomatic --debug 'workflow.md'
::: No such template: 'paper-with-refs-docx'.
:: exit status: pid 1486 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug 'workflow.md' !!!
I am following the instruction in the Scrivener
template you provided. I've run this multiple times, removing the paper-with-refs-docx
and putting in line the paper-with-refs-odt
, or just leaving the paper-with-refs-html
in the template YAML metadata
... but no joy.
Not sure what I am doing wrong. Any help would be greatly appreciated. Thanks in advance.
My log output is stating that it's using system Ruby, though I installed latest version using rbenv. Hard to tell if scrivomatic is actually using the system Ruby, or just a reference to it in the log output, because it appears to complete just fine, which shouldn't be the case using 2.3.7, right?
Here's the output:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.25 Report @ 2019-04-02 19:06:24 -0700 ===
=== ------------------------------------------------------ ===
Running under Ruby 2.3.7
Working directory: /Users/XXXXXXXXX/Library/Mobile Documents/com~apple~CloudDocs/FOLDERNAME
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="DOCUMENT.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/XXXXXXXXX/bin:/Users/XXXXXXXXX/.rbenv/shims:/usr/local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/XXXXXXXXX/bin:/Users/XXXXXXXXX/.rbenv/shims:/usr/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.7.1
---pandocomatic: /Users/XXXXXXXXX/.rbenv/shims/pandocomatic | V: Pandocomatic version 0.2.4.0
---ruby: /Users/XXXXXXXXX/.rbenv/shims/ruby | V: ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin17]
---rbenv: /usr/local/bin/rbenv
---python: /usr/local/bin/python
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /Users/XXXXXXXXX/.rbenv/shims/pandocomatic --debug DOCUMENT.md
::: pandoc
::: Pandocomatic needed 0.1 seconds to convert 'DOCUMENT.md'.
:: exit status: pid 1107 exit 0
This is on 10.13.6. iTerm is my main terminal, and just to make it a little more difficult, I'm using Fish for my system shell.
Thanks for all the work on Scrivomatic, this is really great!
(once template files are copied into the compile dir) , see #19
1/ the command runs ok by hand , but
2/ not in the compile scripts
extract of logs :
:: Running: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
::: env: ruby_executable_hooks: No such file or directory
:: exit status: pid 73223 exit 127
when run by hand it works:
: -243 ~/Desktop/workflow_mmd
01:48 $ /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
(4) + converting Workflow.md 3 times:
(3) - convert Workflow.md -> Workflow.html
pandoc --standalone
--filter=/usr/local/bin/pandoc-citeproc
--bibliography=workflow.bib
--csl=apa-workflow.csl
(2) - convert Workflow.md -> Workflow.html
pandoc --from=markdown
--to=html5
--template=custom.html
--css=custom.css
--standalone
--section-divs
--self-contained
--toc
--toc-depth=4
--base-header-level=1
--filter=assimilateMetadata.rb
--bibliography=workflow.bib
--csl=apa-workflow.csl
(1) - convert Workflow.md -> Workflow.docx
pandoc --from=markdown
--to=docx
--reference-doc=custom.docx
--filter=simplifyMetadata.rb
--filter=prependAll.rb
--standalone
--bibliography=workflow.bib
--csl=apa-workflow.csl
--output=/Users/luc_taesch/Desktop/workflow_mmd/Workflow.docx
Pandocomatic needed 1.8 seconds to convert 'Workflow.md'.
Hi Ian! I've had scrivomatic set up and working for over a year now (thank you for all the time saved!) but have recently reinstalled MacOS and run into an issue that I can't seem to troubleshoot.
On compiling to .docx, a few of my headings render out as expected whilst others render out like this:
The same seems to happen with subscript. There doesn't seem to be much rhyme or reason to which ones are properly converted. H1, H2 and H3 all face this issue intermittently and I can't particularly discrern what could be causing the problems. In the same document, some will work and some won't. The log scrivomatic creates also doesn't seem to note anything related to this issue.
I should clarify that I don't use binder headings, preferring to instead have my titles appear in text. That said, they are styled properly, I believe, and look fine in the .md output. Yet in the .docx they often don't populate as styled headings.
Any ideas what might be going on here? Thank you in advance for any guidance you can offer!
Hi, I'm not sure if this is a scrivomatic or pandocomatic issue but wanted to check with you.
I get the following error Unable to load config file: '/Users/bryanwest/.local/share/pandoc/pandocomatic.yaml'. :: exit status: pid 94975 exit 243
whether I run scrivomatic from Scrivener, the command line, or call pandocomatic directly from the command line. The directory /Users/bryanwest/.local/share/pandoc/
exists and is the location of pandocomatic.yaml
, and I have set chmod 777 -R
for the directory, so there shouldn't be permission issues.
I am able to compile your Workflow.scriv example in a local directory.
Logfile and YAML metadata used:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.29 Report @ 2020-05-26 16:47:52 -0400 ===
=== ------------------------------------------------------ ===
Working directory: /Users/bryanwest/Desktop/compile-mmd
Initiating with Ruby 2.3.7
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="test.mmd", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/bryanwest/bin:/Users/bryanwest/.rbenv/shims:/usr/local/lib/ruby/gems/2.7.0/bin:/Library/TeX/texbin:/usr/local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/bryanwest/bin:/Users/bryanwest/.rbenv/shims:/usr/local/lib/ruby/gems/2.7.0/bin:/Library/TeX/texbin:/usr/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: /Users/bryanwest/.rbenv/shims/pandocomatic | V:
---ruby: /Users/bryanwest/.rbenv/shims/ruby | V: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
---rbenv versions:
system
* 2.7.1 (set by /Users/bryanwest/.rbenv/version)
---rbenv: /usr/local/bin/rbenv
---gem: /Users/bryanwest/.rbenv/shims/gem
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /usr/local/bin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /Users/bryanwest/.rbenv/shims/pandocomatic --debug test.mmd
::: Unable to load config file: '/Users/bryanwest/.local/share/pandoc/pandocomatic.yaml'.
:: exit status: pid 94975 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /Users/bryanwest/.rbenv/shims/pandocomatic --debug test.mmd !!!
File I'm attempting to compile is using this YAML metadata:
---
# YAML Header
title: "<$projecttitle>"
subtitle: “<$abbr_projecttitle>”
author:
- name: My Name
- affiliation: 1
correspondence: [email protected]
institute:
- ^1^ Affiliation
keywords:
- test1
- test2
- test3
abstract: Abstract text here.
wordcount: <$wc>
date: <$fulldate>
created: "<$createdDate>"
compiled: "<$shortdate>"
pandocomatic_:
use-template:
- latex-scholar
---
Hi,
Great scripting—this has really helped my workflow so much!
I am having trouble exporting a slideshow. I cannot seem to get the pandoc_title_block
to appear as would be expected when trying to go via the workflow.
I have used the template provided in the pandoc
use manual (see the 'Producing slide shows with pandoc' section for the example habits.txt
file).
Specifically, this appears at the top of the document:
% Habits
% John Doe
% March 22, 2005
The cli
code provided in the manual is:
pandoc habits.txt -o habits.pptx
This works as expected (see habitsOk.pptx). Now, I have added the following to the pandocomatic.yaml
file:
pptx:
extends: ['refs']
pandoc:
from: markdown
to: pptx
reference-doc: "_templates/uow_custom.pptx" #templates/custom.docx
All other attributes print as normal, however the title block does not (see habitsNotOk.pptx). I'm not sure whether it is because when going through the workflow it is converting form markdown
and not txt
as per the pandoc
provided example, or something else completely different.
Any ideas? Your help is greatly appreciated!
Cheers,
Atanas
Question: I noticed that Scrivener has an option to 'Convert Rich Text to Markdown' which basically attempts to do just that. Is there a benefit of using Styles, as you've indicated, over this option? Are there clear downsides to using this convert option? It seems both would export to the same markdown format.
I'm thinking about this because I plan to also use scrivener extensively on iOS, and while it seems that styles might sync across, it's not possible to bind keyboard shortcuts to styles, and might make writing on iOS more difficult.
Apologies if this is too far off the current repository.
I installed Scrivomatic, and it worked fine. I then installed the workflow, but here I am getting an error. It seems that the workflow is looking for Pandocomatic in /Library/TeX/texbin:$HOME/bin:/usr/local/bin
, as evidenced by its citing V: Pandocomatic version 0.1.4.13. I have updated to 0.1.4.17, which is found instead at $HOME/.rvm/rubies/ruby-2.4.0/bin/
.
I added that to the export Path in the script, but to no avail. Running Scrivomatic from the terminal continues to work. Am I missing something or is this a bug?
=== ##################################################### ===
=== Scrivomatic V1.0.8 Report @ 2017-09-15 10:48:00 +0100 ===
Running under Ruby 2.4.0
Working directory: $HOME/Desktop/scrivener-pandoc
====== Input Options: ======
#<struct Scrivomatic::OPT
input="scrivener-pandoc.md",
output=nil,
to=nil,
command="pandocomatic",
envpath="/Library/TeX/texbin:$HOME/bin:/usr/local/bin",
build=false,
verbose=true>
====== Final ENV PATH: ======
/Library/TeX/texbin:$HOME/bin:/usr/local/bin:$HOME/.rvm/rubies/ruby-2.4.0/bin/:/Library/TeX/texbin:/usr/local/bin:$HOME/bin:$HOME/.pandoc:/usr/bin:/bin:/usr/sbin:/sbin
====== TOOL PATHS: ======
---pandoc: /usr/local/bin/pandoc | V: 1.19.2.1
---pandocomatic: /usr/local/bin/pandocomatic | V: Pandocomatic version 0.1.4.13
---panzer:
---ruby: /usr/local/bin/ruby | V: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
---python: /usr/bin/python
---rbenv:
---xelatex: /Library/TeX/texbin/xelatex
running pandocomatic...
!!!---scrivomatic::runCommand() popen2e FAILED TO RUN /usr/local/bin/pandocomatic --debug scrivener-pandoc.md !!!
Could you describe this process?
I could not understand the relationship between styles in specific format ( Multimarkdown for example ) and styles in style pane.
When I add style to format ( I dup Multimarkdown and rename it to Enhanced Multimarkdown ) at Styles section, these styles doesn't appear in styles pane.
Maybe I should set an option somewhere? ( Option to use specific format for document / text / folder? )
Thanks!
nevermind.
Hallo!
A couple of days ago, I updated my system to macOS 12.0.1 (from Big Sur). I did not encounter any issues when compiling from Scrivener via scrivomatic. However, today I updated brew, pandocomatic etc. and since then, run into errors with the filters.
I downloaded the "working pandoc folder" again, updated the script in my Scrivener formats, tried to switch ruby versions with rbenv, and when that did not help, uninstalled brew and everything, re-installed following the instructions, but to no avail.
When I switch off the filters in the yaml-file, I receive another error, this time with pandocomatic itself.
Is there anything you can spot in the logs that would indicate what I can do to fix the issue?
Using the Workflow example results in the same errors.
Thank you for any hints!
1. With filters enabled:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.30 Report @ 2021-11-11 15:51:26 +0900 ===
=== ------------------------------------------------------ ===
Running shell: /bin/zsh
Working directory: /Users/username/Desktop/OutputFile.md
Initiating with Ruby 2.6.8
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="OutputFile.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/username/bin:/Library/TeX/texbin:/usr/local/bin", build=true, cleanup=false, verbose=true, dry_run=false, open_log=false, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/username/bin:/Library/TeX/texbin:/usr/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.16.1
---pandocomatic: /usr/local/bin/pandocomatic | V: 0.2.7.7
---ruby: /usr/bin/ruby | V: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
---rbenv versions:
---gem: /usr/bin/gem
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic --debug OutputFile.md
::: pandoc --from=markdown \
::: --to=html5 \
::: --standalone \
::: --section-divs \
::: --mathjax \
::: --lua-filter=/Users/username/.local/share/pandoc/filters/pagebreak.lua \
::: --filter=/Users/username/.local/share/pandoc/filters/assimilateMetadata.rb \
::: --template=/Users/username/.local/share/pandoc/templates/mytemplate.html \
::: --css=/Users/username/.local/share/pandoc/templates/mytemplate.css \
::: --toc \
::: --toc-depth=3 \
::: --verbose \
::: --citeproc \
::: --bibliography=/Users/username/.local/share/pandoc/bibs/mytemplate_2_Cthulhu.json \
::: --csl=/Users/username/.local/share/pandoc/csl/jrpg.csl \
::: --citation-abbreviations=/Users/username/.local/share/pandoc/cite-abbr.json \
::: --reference-links
::: [INFO] Loaded /Users/username/.local/share/pandoc/templates/mytemplate.html from /Users/username/.local/share/pandoc/templates/mytemplate.html
::: [INFO] Running filter /Users/username/.local/share/pandoc/filters/pagebreak.lua
::: [INFO] Completed filter /Users/username/.local/share/pandoc/filters/pagebreak.lua in 19 ms
::: [INFO] Running filter /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb
::: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/psych.rb:271:in `load': unknown keyword: permitted_classes (ArgumentError)
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter/metadata.rb:52:in `initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:279:in `new'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:279:in `filter'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:251:in `run'
::: from /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb:77:in `<main>'
::: Error running filter /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb:
::: Filter returned error status 1
::: Error running pandoc => error while running:
:::
::: pandoc --from=markdown \
::: --to=html5 \
::: --standalone \
::: --section-divs \
::: --mathjax \
::: --lua-filter=/Users/username/.local/share/pandoc/filters/pagebreak.lua \
::: --filter=/Users/username/.local/share/pandoc/filters/assimilateMetadata.rb \
::: --template=/Users/username/.local/share/pandoc/templates/mytemplate.html \
::: --css=/Users/username/.local/share/pandoc/templates/mytemplate.css \
::: --toc \
::: --toc-depth=3 \
::: --verbose \
::: --citeproc \
::: --bibliography=/Users/username/.local/share/pandoc/bibs/mybib.json \
::: --csl=/Users/username/.local/share/pandoc/csl/jrpg.csl \
::: --citation-abbreviations=/Users/username/.local/share/pandoc/cite-abbr.json \
::: --reference-links
:::
::: Pandoc responded with:
:::
::: [INFO] Loaded /Users/username/.local/share/pandoc/templates/mytemplate.html from /Users/username/.local/share/pandoc/templates/mytemplate.html
::: [INFO] Running filter /Users/username/.local/share/pandoc/filters/pagebreak.lua
::: [INFO] Completed filter /Users/username/.local/share/pandoc/filters/pagebreak.lua in 19 ms
::: [INFO] Running filter /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb
::: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/psych.rb:271:in `load': unknown keyword: permitted_classes (ArgumentError)
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter/metadata.rb:52:in `initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:279:in `new'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:279:in `filter'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2.4/lib/paru/filter.rb:251:in `run'
::: from /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb:77:in `<main>'
::: Error running filter /Users/username/.local/share/pandoc/filters/assimilateMetadata.rb:
::: Filter returned error status 1
:::
:: exit status: pid 4936 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug OutputFile.md !!!
===------ RUN LATEXMK on OutputFile.tex: ------===
!!!---Scrivomatic postBuild: could not find OutputFile.tex
2. Without filters:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.30 Report @ 2021-11-11 15:53:22 +0900 ===
=== ------------------------------------------------------ ===
Running shell: /bin/zsh
Working directory: /Users/username/Desktop/OutputFile.md
Initiating with Ruby 2.6.8
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="OutputFile.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/username/bin:/Library/TeX/texbin:/usr/local/bin", build=true, cleanup=false, verbose=true, dry_run=false, open_log=false, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/username/bin:/Library/TeX/texbin:/usr/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.16.1
---pandocomatic: /usr/local/bin/pandocomatic | V: 0.2.7.7
---ruby: /usr/bin/ruby | V: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
---rbenv versions:
---gem: /usr/bin/gem
---python: /usr/bin/python
---xelatex: /Library/TeX/texbin/xelatex
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic --debug OutputFile.md
::: An unexpected error has occurred. You can report this bug via https://github.com/htdebeer/pandocomatic/issues/new.
::: /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/configuration.rb:666:in `is_local_path?': undefined method `start_with?' for nil:NilClass (NoMethodError)
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/configuration.rb:554:in `update_path'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:192:in `block (2 levels) in pandoc'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:186:in `each'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:186:in `block in pandoc'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:184:in `chdir'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:184:in `pandoc'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:135:in `convert_file'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_command.rb:86:in `run'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/command.rb:129:in `execute'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_multiple_command.rb:99:in `block in execute'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_multiple_command.rb:98:in `each'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/command/convert_file_multiple_command.rb:98:in `execute'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/lib/pandocomatic/pandocomatic.rb:105:in `run'
::: from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-0.2.7.7/bin/pandocomatic:3:in `<top (required)>'
::: from /usr/local/bin/pandocomatic:23:in `load'
::: from /usr/local/bin/pandocomatic:23:in `<main>'
:: exit status: pid 5027 exit 1
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug OutputFile.md !!!
===------ RUN LATEXMK on OutputFile.tex: ------===
!!!---Scrivomatic postBuild: could not find OutputFile.tex
I just downloaded the files, unzipped them, put them in ~/bin, and then ran chmod 755 scrivomatic
.
Now, when I try to run scrivomatic, I get this error:
/Users/pk/bin/scrivomatic:130:in
parseInputs': undefined method
gsub' for nil:NilClass (NoMethodError)
I have no idea what it means.
I'm running macOS 10.13.4, and I just installed brew/pandoc/pandocomatic today, so they are the latest versions as of May 25.
Any help would be much appreciated.
Hi,
I'm playing around with your Workflow.md example and testet some options. If I want a listoffigures and listoftables I have to set these option in pandocomatic.yaml. So I extended your brief pandocomatic.yaml example with
" paper-with-refs-latex:
extends: ['refs'] #we can inherit from other templates
pandoc:
from: markdown
to: latex
template: ./custom.latex
toc: true
toc-depth: 4
lof: true
lot: true
base-header-level: 2
filter:
- './assimilateMetadata.rb' #regularise metadata fields so pandoc template can use it more easily
metadata:
CJKmainfont: 'PingFang SC'
lang: 'en-GB'
papersize: 'A4'
documentclass: 'article'
fontsize: '12pt'
linestretch: '1.75'
geometry: 'margin=2cm'
nonumberfigures: true
linkcolor: Mahogany
citecolor: Sepia
urlcolor: BrickRed
#########################################
pdf-refs:
extends: [paper-with-refs-latex]
pandoc:
to: pdf
pdf-engine: 'xelatex'
cleanup: ['latexmk -c']"
And in the scrivomatic.log I get this:
"::: The pandoc option 'lof' (with value 'true') is not recognized by paru. This option is skipped.
::: The pandoc option 'lot' (with value 'true') is not recognized by paru. This option is skipped."
Any hints how to fix it?
Thanks and best regards
Andreas
In trying to update paru and pandocomatic according to the instructions you provided here, I discovered that I have an outdated version of Ruby and that paru won't update because of that. Using some google-fu, I ended up finding your comment on a pandocomatic issue where you said that you would "change the advice [you] give to [users of your scrivener workflow], and suggest [we] upgrade via rbenv/homebrew..."
I haven't had any issues using Scrivomatic yet, but I'd like to find out how to update Ruby so I can update Paru, Pandocomatic, and Scrivomatic before I do run into issues.
Thanks for the work you have put into Scrivomatic!
I am posting this for future reference.
There is no need to indent paragraphs (after the first one) in footnotes.
If you do, the following error will apear:
::: Pandoc responded with:
:::
::: Error producing PDF.
::: ! Paragraph ended before \FV@BeginScanning was complete.
::: <to be read again>
::: \par
::: l.424 }
(Ian, thanks a lot for taking the time to put out Scrivomatic. It is really good and very well documented.)
Hi Ian,
I've noticed that Scrivomatic is not happy when passed an input file with a space in the name (e.g., My File.md
). It doesn't matter if I escape the space with \
, or enclose the name in double quotes. Either way, Scrivomatic fails with
!!!---Scrivomatic: could not find My\ File.tex
Is it possible to add support for file names with spaces?
As a new scrivener user I have your workflow up and running successfully. Thanks so much for sharing. I'm really excited about how this will help me with my study, less mucking around with formatting and references, more focus on my work!
My issue now revolves around customising and creating templates to suit my needs.
As an example. I'm attempting to create a format required for my essay submission that my institution requires. So far so good and have it as a docx with correct fonts and styling mostly in the correct format along with working integration for my referencing.
Where I'm really struggling is integrating of a Table of Contents on the correct page. How is this templated? From what I can see is Pandoc can generate a TOC with the --toc flag, however has can I define in scrivener, does it even need to be defined in scrivener?
I fear this is an absolute newb question but how do I compile in a way that linked footnotes are turned into endnotes automatically using docx?
I found nothing in the Scrivener Format or in how to set up the pandocomatic yaml or template docx-files.
The Scrivener user manual speaks of the possibility of using inline and linked footnotes as separate streams, turning one into footnotes, the other into endnotes (page 536). How/where do I enable that "[^cf1]:" linked footnotes will be turned into endnotes when compiled for docx?
Thank you!
The homebrew installation of pandoc
is in /opt/homebrew/bin
. If possible, could you please add that path to the list of paths in the environment which scrivomatic
builds?
Hi
Using your example Scrivener workflow, I'm having some problems. I've pasted the scrivener.log below. I'm afraid my knowledge of all this is very limited, so I'm not sure where to start.
From the scrivener.log, I see a couple of problems
::: The pandoc option 'reference_doc' (with value 'custom.docx') is not recognized by paru. This option is skipped.
and
::: pandoc: Error running filter authorSimplifyMetadata.rb
::: fd:3: hPutBuf: resource vanished (Broken pipe)
::: Error running pandoc => error while running:
On this second error: if I comment out the authorSimplifyMetadata.rb line in pandocomatic.yaml, I then get the same error in relation to prependall.rb. If I comment out them both, then the output files are generated with no apparent problems.
Any tips on what I'm doing wrong would be appreciated.
Kevin
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.16 Report @ 2018-04-21 21:01:28 +0100 ===
=== ------------------------------------------------------ ===
Running under Ruby 2.3.3
Working directory: /Users/kevin/Desktop/workflow_mmd
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="workflow", output=nil, to=nil, yaml="pandocomatic.yaml", command="pandocomatic", envpath="/Users/kevin/.rbenv/shims:/Users/kevin/anaconda3/bin:/Library/TeX/texbin:/Users/kevin/bin:/usr/local/bin", build=false, verbose=true, dry_run=false, open_log=false>
===------ Final ENV PATH: ------===
/Users/kevin/.rbenv/shims:/Users/kevin/anaconda3/bin:/Library/TeX/texbin:/Users/kevin/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
===------ TOOL PATHS: ------===
---pandoc: /Users/kevin/anaconda3/bin/pandoc | V: 1.19.2.1
---pandocomatic: /usr/local/bin/pandocomatic | V: Pandocomatic version 0.2.2.1
---ruby: /Users/kevin/.rbenv/shims/ruby | V: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin17]
---rbenv: /usr/local/bin/rbenv
---python: /Users/kevin/anaconda3/bin/python
---xelatex: /Library/TeX/texbin/xelatex
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug workflow
::: The pandoc option 'reference_doc' (with value 'custom.docx') is not recognized by paru. This option is skipped.
::: (4) + converting workflow 3 times:
::: (3) - convert workflow -> workflow.docx
::: pandoc --from=markdown
::: --to=docx
::: --filter=authorSimplifyMetadata.rb
::: --filter=prependAll.rb
::: --standalone
::: --bibliography=workflow.bib
::: --csl=apa-workflow.csl
::: --output=/Users/kevin/Desktop/workflow_mmd/workflow.docx
::: pandoc: Error running filter authorSimplifyMetadata.rb
::: fd:3: hPutBuf: resource vanished (Broken pipe)
::: Error running pandoc => error while running:
:::
::: pandoc --from=markdown
::: --to=docx
::: --filter=authorSimplifyMetadata.rb
::: --filter=prependAll.rb
::: --standalone
::: --bibliography=workflow.bib
::: --csl=apa-workflow.csl
::: --output=/Users/kevin/Desktop/workflow_mmd/workflow.docx
:::
::: Pandoc responded with:
:::
::: pandoc: Error running filter authorSimplifyMetadata.rb
::: fd:3: hPutBuf: resource vanished (Broken pipe)
:::
:: exit status: pid 25102 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug workflow !!!
Hi,
I play around with Scrivener 3 and scrivomatic, but I get bad results. As I'm total new to pandoc and so on, I can't configure pandocomatic.yaml properly, because I don't understand what I have to customize for my needs.
Example:
I get a "html" Output, but no "docx" output with your example front-matte entries and don't no why.
Do you have some additional advices or a Scrivener project with proper Settings to get a working solution?
I appreciate your help a lot.
Thank you and best regards
Andreas
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.29 Report @ 2020-10-26 16:55:28 -0400 ===
=== ------------------------------------------------------ ===
Working directory: /Users/tposen/Desktop/workflow-mmd
Initiating with Ruby 2.6.3
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="Workflow.md", output=nil, to=nil, yaml="pandocomatic.yaml", command="pandocomatic", envpath="/Users/tposen/bin:/usr/local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/tposen/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
===------ TOOL PATHS: ------===
---pandoc: /usr/local/bin/pandoc | V: 2.9.2.1
---pandocomatic: /usr/local/bin/pandocomatic | V: 0.2.7.3
---ruby: /usr/bin/ruby | V: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
---rbenv versions:
---gem: /usr/bin/gem
---python: /usr/bin/python
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md
::: (5) + converting /Users/tposen/Desktop/workflow-mmd/Workflow.md 4 times:
::: (4) - convert Workflow.md -> Workflow.tex
::: pandoc --from=markdown
::: --to=latex
::: --template=custom.latex
::: --toc
::: --toc-depth=4
::: --filter=assimilateMetadata.rb
::: --standalone
::: --bibliography=workflow.bib
::: --csl=apa-workflow.csl
::: /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/attr.rb:48:in []': odd number of arguments for Hash (ArgumentError) ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/attr.rb:48:in
initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/table.rb:56:in new' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/table.rb:56:in
initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:119:in new' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:119:in
block in initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:117:in each' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:117:in
initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:118:in initialize' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:85:in
new'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:85:in from_JSON' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:336:in
read_document'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:277:in filter' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:251:in
run'
::: from ./assimilateMetadata.rb:74:in <main>' ::: Error running filter assimilateMetadata.rb: ::: Filter returned error status 1 ::: Error running pandoc => error while running: ::: ::: pandoc --from=markdown \ ::: --to=latex \ ::: --template=custom.latex \ ::: --toc \ ::: --toc-depth=4 \ ::: --filter=assimilateMetadata.rb \ ::: --standalone \ ::: --bibliography=workflow.bib \ ::: --csl=apa-workflow.csl ::: ::: Pandoc responded with: ::: ::: /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/attr.rb:48:in
[]': odd number of arguments for Hash (ArgumentError)
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/attr.rb:48:in initialize' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/table.rb:56:in
new'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/table.rb:56:in initialize' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:119:in
new'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:119:in block in initialize' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:117:in
each'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/node.rb:117:in initialize' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:118:in
initialize'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:85:in new' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter/document.rb:85:in
from_JSON'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:336:in read_document' ::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:277:in
filter'
::: from /Library/Ruby/Gems/2.6.0/gems/paru-0.4.2/lib/paru/filter.rb:251:in run' ::: from ./assimilateMetadata.rb:74:in
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic -c pandocomatic.yaml --debug Workflow.md !!!
It seams that you have reorganized, so the link in
svn export https://github.com/iandol/dotfiles/trunk/pandoc $HOME/.pandoc
is no longer valid.
Hi,
Thanks a ton for creating scrivomatic. It's making my workflow so much easier. Love the customization options through pandocomatic.
As someone relatively new to programming, I'm having trouble creating a log of what has happened. Conversion works when it does, but when it doesn't it's up to me to figure out why. I've used the arguments in the screenshot you provide, but I don't get an accurate log. Sometimes console loads but often it displays an outdated log. Are there any resources that you know of that I can use to solve this problem?
I had a question about one part of your guide, though I don't know if this is pertinent specifically to Scrivomatic. I imported the compile/styles preset from your guide, and while it works well, for block quote-styled sections of my paper (e.g.), the prefixed >
character in each block quote-styled paragraph gets escaped as \>
. I currently have the 'escape characters' option set here:
And currently the prefix for the block quote style:
It seems like Scrivener escapes whatever is in the 'prefix' field, regardless if it's not supposed to be (I would think...). Any idea to turn off escaping for this, or will I just need to disable character escaping or any Markdown transformation for this style?
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:
=== ------------------------------------------------------ ===
=== Scrivomatic V1.0.25 Report @ 2019-12-02 14:17:34 +0100 ===
=== ------------------------------------------------------ ===
Running under Ruby 2.3.7
Working directory: /Users/htv/Desktop/BIO_285_notes.md
===------ Input Options: ------===
#<struct Scrivomatic::OPT input="BIO_285_notes.md", output=nil, to=nil, yaml=nil, command="pandocomatic", envpath="/Users/htv/bin:/Users/htv/.rbenv/shims:/Library/TeX/texbin:/usr/local/bin:/Users/htv/.local/bin", build=false, cleanup=false, verbose=true, dry_run=false, open_log=true, data_dir=nil>
===------ Final ENV PATH: ------===
/Users/htv/bin:/Users/htv/.rbenv/shims:/Library/TeX/texbin:/usr/local/bin:/Users/htv/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
===------ TOOL PATHS: ------===
---pandoc: /usr/local/bin/pandoc | V: 2.7.2
---pandocomatic: /Users/htv/.rbenv/shims/pandocomatic | V:
---ruby: /Users/htv/.rbenv/shims/ruby | V: ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin18]
---rbenv: /usr/local/bin/rbenv
---python: /usr/local/bin/python
---xelatex: /Library/TeX/texbin/xelatex
---latexmk: /Library/TeX/texbin/latexmk
… running pandocomatic, please wait …
===------ COMMAND OUTPUT: ------===
:: Running: /Users/htv/.rbenv/shims/pandocomatic --debug BIO_285_notes.md
::: (4) + converting /Users/htv/Desktop/BIO_285_notes.md/BIO_285_notes.md 3 times:
::: (3) - convert BIO_285_notes.md -> BIO_285_notes.docx
::: pandoc --from=markdown \
::: --to=docx \
::: --standalone \
::: --filter=/Users/htv/.local/share/pandoc/filters/removeHR \
::: --filter=/Users/htv/.local/share/pandoc/filters/simplifyMetadata \
::: --filter=/Users/htv/.local/share/pandoc/filters/prependAbstract \
::: --filter=/Users/htv/.local/share/pandoc/filters/prependAll \
::: --reference-doc=/Users/htv/.local/share/pandoc/templates/MyManuscriptReference.docx \
::: --output=/Users/htv/Desktop/BIO_285_notes.md/BIO_285_notes.docx
::: (2) - convert BIO_285_notes.md -> BIO_285_notes.pdf
::: pandoc --to=latex \
::: --pdf-engine=lualatex \
::: --standalone \
::: --filter=/usr/local/bin/pandoc-citeproc \
::: --filter=/Users/htv/.local/share/pandoc/filters/assimilateMetadata \
::: --bibliography=/Users/htv/switchdrive/COCB_Review/Literature/COCB_Review.json \
::: --csl=/Users/htv/.local/share/pandoc/csl/current-opinion.csl \
::: --from=markdown \
::: --template=/Users/htv/.local/share/pandoc/templates/custom.latex \
::: --base-header-level=2 \
::: --output=/Users/htv/Desktop/BIO_285_notes.md/BIO_285_notes.pdf
::: [WARNING] Missing character: There is no ⇒ (U+21D2) in font Palatino:mode=node;+tlig;!
::: [WARNING] Missing character: There is no ⇒ (U+21D2) in font Palatino:mode=node;+tlig;!
::: Script does not exist: ''.
:: exit status: pid 6348 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /Users/htv/.rbenv/shims/pandocomatic --debug BIO_285_notes.md !!!
If I produce the PDF via the latex template it works fine.
Do you have any idea what the problem is?
Thanks!
When I compile to pandoc markdown using scrivomatic, none of the text I've italicized in my document is prefixed/suffixed with *
. It seems like this comes down to a difference between character format (i.e. hitting cmd-i to italicize text), and character styles (i.e. selecting "emphasis" from the styles pane). Scrivomatic will only add prefixes/suffixes to the latter. But it is infinitely most intuitive while writing to hit cmd-i rather than stopping to highlight text, select the styles pane, and click "emphasis."
Another reason for the importance of converting character formats to pandoc markdown is that character styles cannot be selected when editing Scrivener footnotes. So, there is no way to italicize footnote text in scrivomatic's markdown output.
So, is there a way to pass character formats through any of these Scrivener compile filters?
Can you please share your Scrivener 3 style settings which can be used with your already linked compile settings?
In the workflow, pandoc citations [@citekey] are converted to something like this in LaTeX:
"Sint meis quo et, vis ad fæcete dolorem! Ad quøt moderatius elaboraret
eum(Crivellato \& Ribatti \protect\hyperlink{ref-crivellato2007}{2007}),
pro paulo ridens quaestio ut.
Is it possible to convert [@citekey] to latex \cite{citekey} instead?
Thank you!
Hi Ian,
coming from the user side, I am a bit lost since I dont understand many of the things going on. I simply need to get my scrivener project to be convert in such a way that I can convert citekeys of bibdesk (or zotero) into a certain citation style.
On the one hand, I ran your 2018-test workflow that you posted back then. I get this error message:
=== ##################################################### ===
=== Scrivomatic V1.0.11 Report @ 2020-02-04 16:54:54 +0100 ===
Running under Ruby 2.6.3
Working directory: /Users/administrator/CLOUDSHARE/Doktorarbeit/Writings/#Dissertationsschrift/PRODUCTION_mmd
====== Input Options: ======
#<struct Scrivomatic::OPT input="'workflow.md'", output=nil, to=nil, command="pandocomatic", envpath="/Users/administrator/bin:/usr/local/bin", build=false, verbose=true, dry_run=false>
====== Final ENV PATH: ======
/Users/administrator/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
====== TOOL PATHS: ======
---pandoc: /usr/local/bin/pandoc | V: 2.9.1.1
---pandocomatic: /usr/local/bin/pandocomatic | V:
---ruby: /usr/bin/ruby | V: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
---python: /usr/bin/python… running pandocomatic, please wait …
====== COMMAND OUTPUT: ======
:: Running: /usr/local/bin/pandocomatic --debug 'workflow.md'
::: No such template: 'paper-with-refs-docx'.
:: exit status: pid 3213 exit 243
!!!---scrivomatic::runCommand() RETURN non-zero value: /usr/local/bin/pandocomatic --debug 'workflow.md' !!!!
On the other hand:
I try to follow your general setup, but the Post-Processing-Script-Stepdoes not work either, e.g. I try to make the script usable from terminal like this
chmod 755 $HOME/bin/scrivomatic
scrivomatic -h
and getting this:
-bash: scrivomatic: command not found
I generally wonder if a certain (la)tex setup or anything else except scrivener, MMD, pandoc and pandocomatic is neccessary to run your script.
** update: for this second thing: the scrivomatic script was saved as a .txt - is that a problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.