please add better integration with Scrivener

13
  • @lynnhuang: I've never worked with Scrivener, and I have a question. If a document is exported from Scrivener in RTF format, and you then run it through (a properly working) RTF Scan to convert the citations, what would be your next step in production -- what will you then use to read the RTF document? Word?
  • edited September 27, 2012
    @fbennett: Yes, I would open the RTF with converted citations using Word. So far, my tests result in in-line citations even for properly styled Chicago notes. Scrivener has the option to export as Multimarkdown RTF, but I don't know what that means and have not tried it.
  • It seems like the widely useful solution will be program or plugin that works on an ODF text file. You could convert your content to that form by exporting from Scrivener in RTF, reading the export with LibreOffice, and then saving in ODF format. It should be possible to replace the keys with Zotero field codes throughout the document. Opening the document with the LibreOffice plugin, you could then refresh to get a fully functional Zotero-linked document.

    I haven't tried this, but it should certainly be possible for someone to build it as a Firefox plugin.
  • edited September 27, 2012
    Thanks so much for your help. I've downloaded LibreOffice and the LibreOffice plugin for Firefox. Here are the steps I took:

    1. Exported the file from Scrivener in RTF
    2. Opened it in LibreOffice
    3. Saved it in ODF

    What do I do now? Opening the file again in LibreOffice shows no changes.

    For step 2, I also tried using the RTF file that has been scanned by Zotero, and it looks exactly the same as the one opened in Word (that is, with in-line citations).
  • I haven't tried this, but it should certainly be possible for someone to build it as a Firefox plugin.
    Some software needs to be written to make it happen. It doesn't exist yet, but it could be done. If you know any eager young programmers, you could give them a suggestion. :)
  • Having used computers commercially/productively since 1980 but NOT being a programmer, much of the above is 'greek' to me. My policy from the beginning, and I employed people working computerised equipment was: 'if the computer can be made to do it, make it!' Always providing that the need was going to be repetitive. Nor did I care how long it took to achieve, generally much, much longer than it would have taken to do manually once off.
    Today, in a different lifetime, learning to use 'new' programs, Zotero being one of them, I look to make the computer (or program) do the donkey work.
    I need something that makes the googlechrome add on integrate fully with WordPerfect. Adam has explained that the market is too small. I take the point, while despairing the fact that more people do not move across to the best word processing program out there.

    To qualify that just a little, I have written the specifications for financial trading software and done the initial testing. Prior to that we evaluated desktop publishing programs, and word processing programs.

    Changing to a lessor word processing program to get integration with Zotero does not stack up as a reasonable option to me.

    Put another way I have a two year project and can do with all the help I can get!
  • For all those looking for better Scrivener and Zotero integration - good news. Frank Bennet's suggested setup above has been implemented and works well. I have been using it extensively. It is as follows:

    MLZ Zotero allows a click and drag of your Zotero citation to Scrivener (or any other program). (This link also works as a hyperlink and takes you back to your item in Zotero). It looks like an RTF scan reference, but with a unique identifier.

    To convert these references to *real* Zotero references, you export as ODF format and then run his Zodfscan script. As this uses a unique identifier, it is reliable (unlike RTF scan).

    I would strongly recommend it.
  • I'm keen on trying this out, but when I try to install the script (Mac OS 10.8) I get the following error: python: can't open file './setup.py': [Errno 2] No such file or directory

    I'm clueless in Terminal, so if anyone can provide further instructions, please let me know!
  • @samuelas, I'm equally clueless in Terminal, but let me try to help.

    I've just run through setting it up again. I'm also using OS 10.8

    I think the key is to ensure that you have navigated using cd to the correct directory where you saved Zodfscan. If you saved it in documents/zodfscan, you may need to use cd documents/zodfscan etc. Type pwd if you're unsure which directory you are currently in.

    Have a look here: http://guides.macrumors.com/Terminal
  • (If anyone with packaging experience has suggestions on how to make installation and use of the script less fiddlesome, I'll be happy to make adjustments.)
  • @paultroop
    Many thanks! It seems to compile and install now.

    Seems... because despite going through the compilation process and--I really don't know the terminology for this--the terminal window finishes and doesn't complain, when I run the comment zodfscan in the terminal on an odt document from Scrivener, the terminal says it doesn't recognize the command. I'll look at the link you've posted here, but I also wonder, @fbennett, if maybe I just don't understand the documentation.

    "zodfscan mydoc.odt mynewdoc.odt"

    Is this all I have to type? I assume mydoc.odt is the name of the thing I want to scan and mynewdoc.odt is the name of the file I will compile.
  • We do need to make the packaging easier, but there is an error in the documentation -- the name of the command has changed to "zodfscan.py".
  • Thanks fbennett! I feel like it's about to work, but now it tells me that ERROR: input file does not exist.

    But it does exist! Should I save it somewhere else? Does the script create the output file itself and I simply name it?

    And yes: easier packaging would be, well, easier. Several thousand fairly not too savvy humanists are about to download this since they want to be able to use scrivener with zotero.
  • So if you are in a terminal, and in the directory with the documents, when you type "ls" (or "dir", I think, in DOS), do you see your file listed?
  • Thanks! You made me see what I was doing wrong!

    This is a great function and I'm very happy that more and more our citations can become platform/application independent.

    Two questions now (which might well deserve their own forum): Can a document reverse this trip (that is, go back to the scan codes)? Is there syntax yet for author suppression and the like?
  • It should be possible to reverse the conversion, but there isn't a mechanism for doing that yet. The simplest thing would probably be to use a hacked CSL style that outputs the wrapped citation strings.

    I overlooked author suppression. What sort of syntax would be convenient?
  • Great.

    I think author suppression is normally a "-" or a "%" before the author's name. In LaTeX it's something like "\autocite*".

    Yet since your script creates real zotero citations, I think this is not as much of a dealbreaker as theoretically people will be drafting then exporting to odf for their final revisions. Indeed, it supports the kind of workflow that separates writing/drafting and final revisions, which I think is highly valuable. Let us know where the donations go.
  • @fbennett - for suppress author I'd suggest using the same syntax already used in Pandoc/citerproc-hs, i.e. a minus before the author:
    http://johnmacfarlane.net/pandoc/README.html#automatic-citations
  • It should be possible to wrap this in an Automator script for use on Macs-- they can be packaged more or less as applications, so that people can just drag-and-drop the input ODT.
  • @fbennett Is there a way to make MLZ work with the standalone zotero? I'm writing using the solution outlined by @paultoop above. But I don't use Firefox and I'd love to leave it aside instead of opening it every time I write.
  • edited January 15, 2013
    @JoshuaP23: The code for MLZ could be bundled as Standalone, but someone will need to come forward to build the clients. Unfortunately I don't have access to a Windows or a Mac development environment (and lack the time for the extra work in any case).

    (Edit: I believe that official Zotero Standalone can read the MLZ database currently, but that is about to change. With the next major MLZ release, MLZ will become database incompatible with official Zotero, although sync to official Zotero from MLZ-driven libraries [and vice-versa] will still work.)
  • @samuelas, it sounds as if you've figured out how to do this, but you may not be doing it the best way. It sounds to me as if the problem was that the document files and the zodfscan.py files were in different directories.

    Mac OS 10.8 is built on Unix, and in the Unix world the usual way to deal with such things is to store the program as an executable in a shared directory (e.g., /usr/local/bin/) and keep the documents in different directories organized into projects etc. Then in the documents' directory one just types, as a single line command, the name of the program file followed by the names of the input and output files.

    The trick is to change your search path to include the path to where the program. Doing this is pretty easy, but it depends on what kind of shell is running. The default shell for OS X 10.8 is Bash. This page (http://www.xinapse.com/Manual/path.html) has a good introduction, and here are more extensive instructions: http://www.decf.berkeley.edu/help/unix/searchpath.html.
  • @fbennett and @paultroop, I'm a bit confused about MLZ. The documentation seems to say it's a Zotero client, but I'm not sure what this means. Is it a program that sits alone, much as the current standalone version does? Or is it a Firefox plugin?

    Can regular Zotero and MLZ coexist on the same machine, or does one have to be uninstalled in order to get the thing to work?
  • MLZ is a (friendly) fork of Zotero. It only comes as a firefox plugin currently.
    It doesn't easily coexist with Zotero, though you can obviously run the two on separate Firefox profiles.
  • @fbennett the MLZ client worked perfectly yesterday with every citation looking like you outlined above. Today, is no longer works, even though I have the tick-box in Preferences checked. The citations simply look like normal bibliographic citations. Any idea why this isn't working? I uninstalled Zotero and Firefox and tried new iterations of those clients, but to no avail. I haven't uninstalled the Standalone app yet, which may work, I guess. Thoughts?
  • @JoshuaP23: Have you tried both drag and shift-drag? One of the tick-boxes swaps the behaviour of those two, so try both. Alternatively, with wrapped citations enabled, Ctrl-Alt-A should always copy a wrapped citation to the clipboard.
  • I've just been trying Scrivener for a few days, like it for organizing. I gave a quick look at this discussion and just tried something so simple that you more experienced Zotero users must see a problem. I kept a blank Word document open in one window and when I wanted to insert a note in Scrivener I created the note in Word with the Zotero plug-in and then pasted it to the note space in Scrivener. When I compiled the document in pdf the notes were fine. A little cumbersome but I could get used to it.
  • you won't be able to create a bibliography in the end, nor will notes reflect any changes you make e.g. to the item in Zotero. If that's not a problem for you, I don't see much of a problem with your method(note that if you just want notes, you can also create them in Zotero without anything using Export bibliography (and then selecting note and clipboard) or using quick copy
    http://www.zotero.org/support/creating_bibliographies#quick_copy
  • @John Lyons your idea is simple, indeed, but what if I want to update my citation style and if I modify files in Zotero and I want to have them updated in Scrivener?
    I would really like a plugin like the one that is available for word and for open Office to be included in Scrivener. Scrivener is a complete publishing workflow, in my opinion, combining it with Zotero would spread it to the world of those who have to write scientific article but like to use a creative approach
  • look at the paultroops/fbennett solution outlined here. While not a Scrivener plugin, it does give you "live" citations akin to the ones produced by the plugin. There's a very good chance we'll get this into "regular" Zotero with the next major update (3.1/3.5) and I think there's also a good chance that odf-scan will move from the command-line to something more regular user-friendly.

    Zotero will not develop a Scrivener plugin, Scrivener has stated (quite understandably) that they won't write a Zotero plugin. I'm not sure if Scrivener even allows for third party plugins if someone else wanted to write one.
Sign In or Register to comment.