[Feature Request] Better Support for Pandoc Citations

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

[Feature Request] Better Support for Pandoc Citations

Post by iandol »

Pandoc[1] is an excellent text processing engine which integrates into many different workflows. For Scrivener users it offers more powerful features than MMD alone. We can use a custom format (Pandoc = `@`u1) and settings in BE preferences (use [] for temporary citations) to generate temporary citations that pandoc understands: [@cite]. Bookends is flexible enough to make these temporary citations, so the first step is accomplished.

What I'd love is for Bookends however to recognise Pandoc's temporary citations when it formats a bibliography so we could use EITHER Pandoc or Bookends depending on our needs. At the moment, we don't have this flexibility. Temporary citations are a one-way street for Bookends, it can make them but not understand them. Papers 3 uses a set of "known" temporary citation formats so you can use whatever format you want, so it can both create and understand these formats (including Pandoc and MMD).

Reference: http://pandoc.org/MANUAL.html#citations

----
[1] As an aside it is developed/maintained by a Professor of Philosophy! http://johnmacfarlane.net
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Better Support for Pandoc Citations

Post by Jon »

Having Bookends recognize [@key] isn't a problem. But the rest of the temp citation is -- for example, in this example for the Pancoc docs,

Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].

Bookends would NOT parse it the way Pandoc would. The equivalent citation in Bookends would look like this

Blah blah [\see \@doe99@33-35; \also \@smith04\, chap. 1\].

So you would not actually be able to use the programs interchangeably, really limiting the usefulness of adding Pandoc temp citation scanning to Bookends.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Better Support for Pandoc Citations

Post by iandol »

Yes OK agreed, this would be very non-trivial to implement the full feature set. I wonder how/if Papers 3 deal with this (they support the temporary citation, but no idea about the scanning)?
joao
Posts: 58
Joined: Fri Jun 17, 2016 4:23 am

Re: [Feature Request] Better Support for Pandoc Citations

Post by joao »

On the surface this seems to be a simple feature to add to Bookends (or Pandoc).
I would like to better explain the use case though:
1. Use Scrivener with Bookends (adding citations using Bookends' temp citation formatted for Pandoc - as above).
Then, depending on the requirements and situation, either:
2a. Compile to MMD via scrivener and then have Pandoc produce a PDF, Tex, docx, or what-have-you. Pandoc would parse the citations and produce the bibliography via citeproc (csl) or via bibtex.
or
2b. Compile individual chapters or the whole manuscript via scrivener to rtf or docs, and have Bookends parse the citations and produce the bibliography.

At the moment it seems we have to choose between 2a or 2b. If the temp citation syntax is so similar, it seems that it would be simple to solve the issue and have interoperability between the two via changes to either pandoc or bookends. Otherwise, an extra step with regex would be needed (which seems simple to remove the '\' to keep pandoc happy, but not so simple to re-add them for bookends).

Use case 2b is great for papers, smaller works, and collaboration. But use case 2a (pandoc) is great for larger works such as theses. Having both at the same time would make life easier.

Joao
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Better Support for Pandoc Citations

Post by Jon »

The OP wanted to be able to go back and forth between scanning a document with Pandoc or with Bookends. As stated, Bookends can insert temp citations that are compatible with either (but not both). Adding the ability of Bookends to recognize and scan Pandoc-style citations is feasible, but hardly very useful. As you point out, you should know early on which is more appropriate for any particular project. Given the differences in the way citations work (not just the @u1 used for Pandoc, which is easy to deal with, the way literal text, cited pages, and citation metadata modifiers (such as omit author), making them interoperable would be clumsy indeed.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Better Support for Pandoc Citations

Post by iandol »

I think it is unfeasible for Jon to support the two formats, and although it would be great to be able to transform between the two, it will probably require a third-party text processing script/tool. I think Bookends supports the applescript necessary to find the references and get back the information necessary for the transformation, so this third-party tool should be do-able. If only I had more time...
Post Reply