Integration with plain text editors > Multimarkdown Composer

Dear fellows,

I've been using Zotero since 2008, and I've been using Multimarkdown Composer for seven months --and therefore Multimarkdown syntax.

The "standard" way I found to deal with Zotero citations is simple: I cite using drag-and-drop and a Chicago Style adapted to MMD. I manually create a collection of the sources used in the text, and I export it as a Bibliography in the end, using another Chicago Style also adapted to MMD.

I know I could always use RTF Scan. However, I think that it keep TXT file dependent to further editing. I think that one of the advantages of using Markdown syntax is the ability to keep a single always-readable TXT file, that can be stored for years without future problems of incompatible software.

However, I wonder if a better integration between Zotero and MMD composer would be available. Perhaps a more "automatic" way to call the Zotero collections for citing other than dragging and dropping. Perhaps, also, a sort of "built-in" TXT scan, that automatically generates the bibliography when required.

I asked the developer of Multimarkdown Composer, Fletcher Penney, if the program would support a plugin. He answered:

> Composer does not support plugins.
> Composer uses standard NSTextViews, so it should be compatible with general approaches to this. For example, TextExpander can interface with almost any app on Mac OS X, including Composer.
> It's been a long time since I have looked at Zotero, but it would seem that should be the approach they use in order to allow one plugin to work with just about any application on the Mac.
> Papers 2 also has a general plugin that is compatible with Composer (just requires adding Composer to the list of known application IDs). I have used this for testing purposes, but haven't written anything real with it. It seems to work fine though.

From the answer, I deduced that a solution for MMD composer in that direction would be able to be used in any text editor for Mac, and that could be a great improvement! It would be useful not only for markdown and multimarkdown users, but also to BibTeX/LaTeX users --with the proper style-setting. It is a big group of users!

What do you think? Is it possible? Can you do it?
  • In the first instance, you might take a look at pandoc, which is supported by Andrea Rossato's citeproc-hs citation processor. It can accept citation source exported from Zotero, and runs against Markdown documents. It might be the solution you're looking for.

    Some ruminations about writing citations into documents with plain text markup ...

    If that's what you are suggesting, I would be a little doubtful about the prospects of getting it to work. You would need a mechanism for identifying the reference in the plain text source that does not interfere with formatting, but allows the rewriting of citation text on subsequent edits (since in many styles, adding a single citation can trigger changes to other cites across the entire document). It seems unlikely that a spartan language like Markdown with its emphasis on readability would be extended in that direction.

    I have some experience with tying the Zotero citation processor (citeproc-js) into another plain-text document compiler (David Goodger's reStructuredText from Python docutils). One problem there is that nested inline markup breaks the compiler. Nested markup is perfectly valid in many output formats, and the citation processor will certainly generate it on occasion, so the simple procedure of inserting native markup into the source document just will not work.

    To get around the limitation, I adopted Erik Hetzner's solution from zot4rst, which reads a key written into the document, calls Zotero or some other external engine with the key, accepts HTML output in return, converts the HTML to XML nodes (i.e. the internal representation of the reStructureText compiler), and then splices them into the document tree at runtime. It works quite well (it's fantastic, in fact) but setting it up was not a procedure for the faint-hearted.

    pandoc + citeproc-hs works roughly in this way. It should be worth a look.
  • FWIW - Papers2 uses citekeys and something somewhere between RTF Scan and fbennet and my ODF Scan (it's like RTF Scan in that the formatted document has no link to papers, it's like ODF Scan in that it relies on citekeys) for it's "magic citations"
    https://github.com/cparnot/universal-citekey-js
    http://support.mekentosj.com/kb/tutorials/magic-citations

    The thing that Papers does really nicely is the way it allows you to insert citekeys in any document without opening papers. I'm pretty sure that requires entirely separate code for each operating system, though, so it may even be something better suited for a 3rd party application.

    I haven't written full documents with pandoc's citation feature, but I've played around with it a bit and can warmly recommend it. Not sure it reads MMD though.
  • Dear fellows,

    Thank you for your prompt and kind answers. They raise many interesting issues --some of them I'm not sure I do fully understand.

    Of course: simplicity and readability is a quality of MMD, and we do not want to turn it into LaTeX.

    However, the focus of my suggestion was not on the conversion --or compilation-- of the plain-text file, but on an universal tool for real-time text edition --the first paragraph of Fletcher's answer:

    > Composer uses standard NSTextViews, so it should be compatible with general approaches to this. For example, TextExpander can interface with almost any app on Mac OS X, including Composer.

    A Zotero tool, similar to TextExpander, with its "snippets", and working in the background of MacOS would bring direct access to the collections in Zotero to any text editor: the inserted citations, for example, could be both a citekey --if the author prefers to deal with fields later on Libre Office-- or a citation formated in a specific chosen style. Also, it could be the case of using citekeys and sort of "in-plain-text" parsing in a selected text in a given moment --or a "TXT Scan", so to say. That could both update the citations and automatically building a bibliography in plain text. The result would be a second modified plain text file -- one that can be safelly stored in long-term.
  • I was too verbose, sorry. I'm (obviously) not very familiar with the OS X environment, but if Zotero support could be tied into the Composer tool, that would be a very good thing.
  • It wouldn't be tied into Composer in danilo's example. It'd be a background app, similar to Qnotero, that would just pop up a HUD and then generate text input. That's not really on our roadmap, but we'd be happy to provide advice on communicating with Zotero to someone developing it.

    (I don't think the NSTextView part is relevant, though. As far as I can tell TextExpander works at the text input level, not the text view itself, since it works in all apps (e.g., Firefox), not just ones that use NSTextView.)
Sign In or Register to comment.