RTF/ODF Scan for Zotero

  • I've reinstalled Scrivener, Zotero, and ODF scan. I think they're all up to date. I've just tried to use ODF scan. The original ODF document opens fine, but after I scan it, I get the following error: 'Read Error.
    Format error discovered in the file in sub-document content.xml at 3,0(row,col).'
    Would anybody have any clue what the problem might be?
  • We've never seen this, but the ODF scan modifies that part of the .odt file, to it's likely a problem in the add-on. Could you send the document, both unscanned and scanned, to my email (see https://www.sebastiankarcher.com/curriculum-vitae/ ).

    Obviously I'll treat this confidentially.
  • Thanks Sebastian. I'm trying to work out what caused it. I'm using:
    - LO (I'm updating this to 6.0.7 to see if it makes a difference)
    - OX10.11.6
    - Z 5.0.58 with LO add-ins.
  • edited November 28, 2018
    I've tried to downgrade to the 2.0.37 version of the add-on, but still get the same error report. Likewise 2.0.35.

    I've also tried to convert an old file that I previously converted fine with the old setup, and this has failed for the same reason, so I suspect it's not due to Scrivener.

    UPDATE - Sebastian pointed out that the hyperlink style that I use has been converted to a real hyperlink in the citations. For some reason this was not converting properly. I stripped these out by converting to txt and back, and this seems to have solved the problem. Thanks Sebastian!
  • edited January 30, 2019
    Thanks for this feature - it solves a vital workflow issue for me to use Scrivener and Zotero together. Only now it has broken, or I have broken it! Or user error is getting in the way of proper functioning... I installed everything according to instructions a couple of months ago and it worked perfectly first time. Coming back to it now though, perhaps due to version updates of one of the components (?), I get the following error message when trying to open the final scanned rtf file in Libreoffice:

    "The file [name] is corrupt and therefore cannot be opened. LibreOffice can try to repair the file.

    The corruption could be the result of document manipulation or of structural document damage due to data transmission.

    We recommend that you do not trust the content of the repaired document.
    Execution of macros is disabled for this document."

    Repairing the file then doesn't work and it fails. Have you seen this error before and know what I might be doing wrong?

    [I'm running OSX 10.14, Zotero Standalone 5.0.60, and Libreoffice]

    Thanks! Ed
  • Scanned RTF file or Scanned ODF (i.e. .odt) file? Our tool works with ODF and ODF only.

    If this is ODF, the first thing to check is if it also occurs with a minimal testing document.
  • Ahah, OK thank you @adamsmith - this is the problem - Zotero initially had the option of "Tools > RTF/ODT scan" but was only giving me "Tools > RTF scan" all of a sudden so it appears that (perhaps a Zotero update?) uninstalled or overwrote the "RTF/ODF Scan" add-on! I have reinstalled that xpi file and it works again - thank you! I wasn't otherwise sure which of the series of things to try to reinstall
  • Hello, I have a quick question about ordering shortcodes.

    If I have several citations placed together, like this:
    {see for example: | Mouffe, 1999 | | |zu:2335679:LUZZ3TDM}{ | DiSalvo, 2010 | | |zu:2335679:LUZZ3TDM}

    The output after ODF scan will always order citations alphabetically:
    (DiSalvo, 2010; see for example: Mouffe, 1999).

    Is there a way to force a certain order in the shortcodes?

    Many thanks,
  • The order would be controlled by the CSL style. If you apply only styles that do not sort citations (or disable sorting on those citations immediately after the ODF Scan conversion), the order will not be affected.
  • Thanks @fbennett that makes sense.

    Normally, sorting makes things more convenient, and it's only for a few examples that I want to sort them manually. I'll just re-sort those ones after export for now I think.
  • Yeah, the Zotero Word/LibreOffice add-on has a "Keep Sources sorted" option. There isn't a good way to include this in ODF scan markers without overcomplicating things.
  • I am using the plugin to go between scrivener and word and am having issues with footnote/endnote citations. I inserted my citation markers directly into the text in scrivener, exported as .odt, scanned through zotero, reopenned in libreoffice and converted to endnotes with the zotero plugin. All looks as expected. Then when I open the document in word v. 16.28 (both this .odt and the document produced for use in other word processors by the libreoffice zotero plugin) many of the superscript numbers signaling endnotes are now regular size. This remains the same if I convert to footnotes. It seems that if I have added a comment before the first pipe in the citation marker, the footnote will be signaled properly in the body of the text as a superscript. If there is no comment added, the number is the same size as the rest of my text. Is there anything I can do to fix this (beyond manual correction)? Are there any steps I've messed up on? Thanks for your help, and for this great tool!
  • Have you tried selecting an author-date style in Zotero, then reselecting a note style?
  • Good suggestion. Let me know if this is what you meant. I recompiled the scrivener file and started again. Once I had scanned the .odt file through the software, I opened the .odt (citations) in Libreoffice and selected the "author date" style. First thing to note is that only with author-date can I select the "bookmarks" style under settings. Using full note (the style I eventually need) doesn't seem to allow this (and so I was selecting "reference marks" before). I set the .odt in LibreOffice to author-date with bookmarks and save as .docx as specified in the settings instructions. In LibreOffice and in Word, the author-date style has moved my citations to the body of the text, but the citations have not been placed in parentheses at all. I open this .docx in word and see that I cannot edit the citation style there. Despite using bookmarks, it seems that the citations transferred as plain text. I went back and opened this .docx with author-date with LibreOffice again and converted to fullnote. Then the document (in Libre Office still) has full note style citations inserted in the body of the text, rather than moved back down to endnotes or to footnotes. So in my first attempt LibreOffice rendered the citations fine, and the switch to word was the issue. Now the .docx in LibreOffice is also having issues. Is this happening because I inserted citation markers into the body of my text rather than in footnotes/endnotes? I figured putting them in the body would give me more flexibility if I need to change the location of my full-note citations, and it seemed to allow me to switch back and forth in a test document I did a while ago.
  • There is a misunderstanding here, let me back up and explain.

    ODF Scan accepts a document in ODF format, and writes out a copy of the file with LibreOffice citation markers. Refreshing the new document in LibreOffice should yield fully working citations.

    In your original report, I missed an important point that seems to be causing additional confusion for you. You waid that the footnote markers were formatted incorrectly (loss of superscript) when you opened the ODT document in Word ... and that will definitely cause problems.

    A LibreOffice ODT document containing Zotero citations must be edited using LibreOffice. If you open the ODT document in Word, the Zotero citations will be flattened to ordinary text. There may also be other anomalies, such as the footnote superscripting issue that you mentioned; but in any case, the document will be broken.

    To move a document from LibreOffice to Word, converting to bookmarks should no longer be necessary. Use this method instead:


    Begin by running your exported ODT file through ODF Scan. Then open the document in LibreOffice and refresh the citations. Then use the steps explained in the linked document above to move the document to Word.
  • Thank you so much! I think I've got it now. I'm surprised I was able to generate a bibliography in Word after this conversion process, as I didn't know if the citation fields would still be "active." One last question- I saw one tutorial for ODF scan and Scrivener which put the citation marker in footnotes/endnotes, rather than in the text. Is this an acceptable practice, or does this placement mess things up after running through ODF scan?
  • It should work either way - I don't think we've ever had complaints about placement in notes vs text. There can be problems with figure captions and tables, though, so it's best to insert citations as text in those locations, and tidy them up before finalizing the document.
  • Thanks for raising this again and for the answers. I need to bookmark this thread. I am nearing the end of my PhD thesis writing and so far I have just sent drafts to my supervisors with the ftnts still in scannable cite code. I have been worried re whether the conversion will even work, as it did not work for me for my MA thesis and I had to convert all the ftnts manually (600 ftnts). There are about 3000 ftnts this time.
  • A document with 3,000 notes should process okay, but it will take time, and might need a machine with plenty of memory. In isolation, I have run the data for a document of that size in isolation (i.e. transacting directly with the processor, outside of word processor context), and citations and bibliography generated in about 15 minutes. With the overhead of word processor interaction, though, you should probably block out a day for the job - and remember that multiple refreshes are required to get from citation markers to finished citations.
  • Hello all,

    I’m running into issues with the bookmarklet documented here: https://zotero-odf-scan.github.io/zotero-odf-scan/ It seems to do nothing when I click on it — I have tried Chrome and Safari on desktop, as well as installing it on Chrome and Safari on my iPad.

    My larger goal here is to develop a workflow where I can get the Scannable Cite key for an item on my iPad to integrate into my Ulysses writing. I am happy to later use a Mac for post-writing processing of citations and bibliography. (I’ve looked into these iOS shortcuts, but don’t see one for the Scannable Cite key: https://appademic.tech/zotero-ios-shortcuts-better-bibtex-citation-keys/)

    Could you suggest how to fix the bookmarklet or any other way to get the item key on my iPad?

    Thank you!
  • I'm afraid there's no easy way to fix the bookmarklet (it loads a remote script and this is no longer permitted on most sites, including Zotero, for security reasons). Have you tried contacting the maintainer of the shortcuts? I don't think it'd be hard to construct the Scannable Cite key from a shortcut.
  • Ah, I see - that explains it. Thank you for your response!

    Yes, I contacted the maintainer of the shortcuts. While I'm waiting for a response, I'll try to teach myself a little about the Zotero web API and see if I can figure out how to modify existing shortcuts to construct a Scannable Cite key.
  • Hi,

    I'm scanning a .odt file output from Scrivener using RTF/ODF-Scan. Everything works brilliantly apart from a glitch when the citation includes a locator label with the abbreviation 'art.'. For some reason it adds a 'p.' to this. For example,

    { | Second Vatican Council, Lumen Gentium, 1964 |art. 11 | |zu:4079792:7UF3NMWP}

    gets rendered as

    Second Vatican Council, ‘Lumen Gentium', 1964, p. art. 11.

    Any ideas/thoughts welcome!

    Many thanks
  • As of today, after the Zotero update (5.0.79) when I try to scan a file (.odt), it only allows to export as .rtf and the resulting file is corrupted (before it exported as .odt as well). If I convert to rtf before and scan the file, it basically returns the file unchanged (i.e. text codes are not converted to Zotero field codes).

    Given that the Better Bibtext Expansion also stopped working after the update, I assume it is related to some code update in Zotero and rtf scan needs adjustment?

    I have posted already on the rtf scan Github pages, but thought that I post here as well because this may be more visible to others who have the same issue or a fix.
  • I'm trying to install this add-on for the first time, and despite the fact that I have the most recent version of the add-on and Zotero standalone, I still only see "RTF scan" as an option (i.e., the command does not change to "RTF/ODF scan".) Furthermore, I can only export as .rtf, and the file is that results is corrupted (as indicated in the above comment). I am in the process of dissertation writing, and would like to be able to work in Scrivener, so if anyone has a possible solution to this, I would be extremely grateful.
  • Better BibTeX stopped working because I made a dumb mistake. Zotero could not have anticipated or prevented this.
  • edited December 3, 2019
    But while the BBT issue was unrelated to the Zotero upgrade, the RTF/ODF-Scan plugin almost certainly does need to be updated for Zotero 5.0.78 and up. @fbennett, let me know if you'd like help with that.
  • edited December 7, 2019
    @dayway and others who are looking for a temporary fix for the brfoken RTF/ODF-Scan plugin on Zotero 5.0.78 and up

    A temporary workaround is to downgrade to 5.0.77: https://www.zotero.org/download/client/dl?channel=release&platform=mac&version=5.0.77

    This will require you to also use a backup Zotero database since 5.0.78 automatically updates the database format and it is not backwards compatible with older versions. This guide explains how to restore a backup database: https://www.zotero.org/support/kb/newer_db_version

    I just tried it and ODF scan was working, though this is not an ideal long term solution since I my backup Zotero database is missing a lot of my latest entries.

    Edit: As pointed out below, the sync will actually add back in later entries, so this is an OK workaround. Looks like a patch was already added to Github though, so that would probably be a better solution.
  • edited December 5, 2019
    @jamesl Thanks for this solution!
    In my case, it is not urgent, I could wait a few weeks until it is fixed. I just wonder whether it will be fixed at all, i.e. if this extension is still maintained (given that the incompatibility was spotted a month ago)? The last commit was a year ago.

    Does anybody know if there is actually anything similar, i.e. where you can put in citations as text codes and they are formatted in the end in a .odt (of course in Latex and (R)Markdown that would be easy when using BBT - but I still use LibreOffice for some documents).
  • edited December 5, 2019
    @jamesl Mate this is awesome! Saved my life!
    For others who are experiencing the same issue, basically if you have you zotero database synced to the server, after downgrading, zotero should sync the up-to-date database back to your computer, so 'my backup Zotero database is missing a lot of my latest entries' is totally not a problem in this case.
Sign In or Register to comment.