Citation managers

I am still here and still trying to make it work, it’s just that using Scrivener beyond the binder is a bit of a learning curve.

Yesterday, I had some time to try and setup the workflow you mentioned above. Whilst I’m not a huge fan of the the way temporary citations view (I like to be able to check how the footnote will format) I think it’s worth trying.

I downloaded the sample you provided and looked at the steps, I got a bit overwhelmed by all of the things I needed to install, so went to the Zotero forum to see if anyone had discussed the steps etc. It was there that I found this discussion with a workflow that doesn’t require any coding or use of the command line (it uses DocDown).

I ran into an issue with the Applet, but have since realised it’s because I missed a step. I’ll try to fix it today (but can’t spend too much time away from writing). Fingers crossed I can get it working!

On formatting, I find on export I end up with extra line and paragraph spaces, styles applied incorrectly etc. In Scrivener itself, the styles don’t always behave. For example, if I highlight text and apply a style, if some of that text already has the style applied it will change the font to something else (but it says its the intended style), I need to apply it a couple of times to work.

DocDown says it uses ‘Pandoc flavoured markdown’, so I should probably learn that and write in plain text (I can use standard markdown, so don’t have any concerns about picking up the Pandoc variant). I just need to review the manual to familiarise myself with how to set up the editor for this etc.

I’m getting closer, but not there.

I have the applet setup, it will allow me to search and input a citation key but I don’t think what it’s returning will work as it’s missing the @ symbol. Plus, it’s returning extra elements that I don’t want and not everything I do.

My citation key format is set to auth.lower + shorttitle(3,3) + year. Instead of returning @authorshorttitleYYYY it returns { | author, YYYY | | | zu:#######:ABCDEFGH }

Sound promising. There are several zotpick applets and you are using the wrong one (you are getting scannable cites, not pandoc ones). The zotpicker I use is just plain applescript directly: zotpick-applescript/zotpick-pandoc for Scrivener.applescript at master · davepwsmith/zotpick-applescript · GitHub (using BetterTouchTool to run it); but the precompiled applet is zotpick-applescript/zotpick-pandoc for Scrivener.app.zip at master · davepwsmith/zotpick-applescript · GitHub

What the pickers do is really quite simple. BetterBibTex allows Zotero to run a small web server, and the picker goes to the URL: http://127.0.0.1:23119/better-bibtex/cayw?format=pandoc

If you open this in your browser with Zotero running now when you paste it should be @citekey

As for problems with spaces and paragraphs, you can share a Scrivener project with most text removed on the forum and we can have a look. Do not write Docdown or Pandoc formatting directly, use Scrivener Styles for things like emphasis, strong, superscript etc. and then add rules in the compiler to convert the styles into markdown. I have several example projects for this workflow, and Section 21.4 of the Scrivener manual (I use what is called the hybrid apporach there).

2 Likes

Thank you so much for the information! That makes a lot of sense regarding the formatting, and will save me time. I also use BTT, so that’s a happy turn of events

Regarding the applet, that is the one I’m using. I downloaded the prebuilt version (and also tried the other versions), but I’ll try setting up the script and get BTT to run it.

Screenshot 2025-01-17 at 7.34.45 pm

One step closer!

Ok, I tried setting up the script with BTT triggering it, and I’m still getting the ODF layout (I think that’s what’s happening). I tried this two different ways, here’s is what I did:

Run Script via BTT

  1. Followed the zotpick-applescript/zotpick-pandoc for Scrivener.applescript at master · davepwsmith/zotpick-applescript · GitHub link
  2. Downloaded the Zip folder and unzipped. This gave me a copy of the ‘zotpick-scannable-cite for Scrivener’ application.
  3. Right clicked on application and selected ‘show package contents’.
  4. Navigated to Contents/Resources/Scripts and opened the only file main.scpt
  5. Copied contents of main.scpt
  6. Created a keyboard shortcut trigger in BTT
  7. Setup 'Run Apple Script (blocking) action
  8. Pasted script into Action.
  9. Saved.

Outcome: inserts citation as { | author, YYYY | | | zu:#######:ABCDEFGH }

Automator Script with BTT Trigger

  1. Opened Automator and created a new workflow.
  2. Dragged ‘Run Apple Script’ into workflow.
  3. Pasted contents of main.scpt into this action.
  4. Saved.
  5. Setup BTT shortcut to trigger picker.

Outcome: inserts citation as { | author, YYYY | | | zu:#######:ABCDEFGH }

I am clearly doing something wrong… but just don’t know what that is!

Don’t download the zip of the applet, just copy the applescript directly from that link (Github allows you to copy RAW, or download RAW).

Anyway here is my BTT preset (unzip it and you can import it to BTT):

named_trigger.bttpreset.zip (5.4 KB)

It is a named trigger which means you can run it with any mechanism in BTT:

…import the preset then create a keyboard or mouse binding to use it like so:

I hope that works, you are incredibly close…

1 Like

I honestly cannot thank you enough! I really appreciate you taking the time to send through the present, take screenshots etc. I can now confirm that I have a citation appearing as it should.

Hopefully this is the last question, but: I use Chicago 17th (Note), will there be any issue with me inserting the citations directly into a footnote in Scrivener?

I don’t really know what Chicago 17th is supposed to look like, but here is the SimpleCitations project compiled with footnotes with citations and using chicago-17-note.csl (this style puts in-text citations into footnotes automatically, and also Scrivener footnotes with citations are processed; in the screenshot footnote 1 comes from an in-text, and footnote 2 uses a Scrivener footnote with @barrett2015 in the footnote text):

SimpleCitations.docx.zip (65.2 KB)

SimpleCitations-mod.scriv.zip (322.0 KB)

1 Like

The learning curve on this thing is incredible… I went through and painstakingly inserted each citation using the above processes, which worked in Zotero. However, the citations rendered as plain text when exported to Word with no way to get Zotero to recognise them.

Turns out, I needed to enclose them in square brackets. So now, I need to go back to every. single. citation. and make this update.

Screenshot 2025-01-19 at 8.57.03 pm

Plus none of the formatting was correct (heading styles, text alignment, font, text size - including a fun little trick where block quotes rendered as paragraph text… fun times). It also inserted random image bars to seperate sections. I’ve used a reference file to fix most of it… but it still can’t recognise bock quotes.

Thank you for your help, I wouldn’t have gotten this far without you… the learning curve is bloody incredible and the system requires a lot of time and effort to work. Due to the block quote issue, it also requires some painstaking updates.

Again, thank you for all of your effort to help me, truely, I wouldn’t have gotten this far without it.

The rules for citations are here:

https://pandoc.org/MANUAL.html#citation-syntax

Standard citations are [@key], you can add prefix, locators and suffixes like [see @doe99, pp. 33-35 and *passim*; @smith04, chap. 1], you can omit authors with [-@smith04] and include author names in the text by removing the [] brakets, so @smith04 – it also suggests:

When you are using a note style, it is usually better to let citeproc create the footnotes from citations rather than writing an explicit note. If you do write an explicit note that contains a citation, note that normal citations will be put in parentheses, while author-in-text citations will not. For this reason, it is sometimes preferable to use the author-in-text style inside notes when using a note style.


Regarding the formatting — compiling via markdown or text means the formatting is performed not via the compiler formatting, but by the downstream tools (Pandoc, Typst, LaTeX etc.). So in this case the important features are the structure, headings, lists, figures, block quotes etc. How these things look are set by templates. So for example in the SimpleCitations.docx if you notice the fonts, the headers and footers, and all styles all are customised. In the binder there is a custom.docx file. With Pandoc you edit the inline, paragraph and page styles to modify how your work looks. Pandoc applies this reference when it converts markdown to DOCX.

> pandoc --citeproc --reference-doc=custom.docx --output final.docx mymarkdown.md

So you could have different custom.docx for different journals or reviews etc. You setup your templates then assign them when needed. This is the principle for separation of concerns for styling, the content should be separate from how the content can be presented. HTML + CSS is a great example of this. But this can take some time to adapt to when you come from a WYSIWYG content+presentation monolith like Word…

If you make a simple example docx of how you want your work to look I can quickly mock up a custom docx for you…

2 Likes

It was late at night after a long day for me when I encountered the issue, so I was tired and grumpy (on top of the general ‘end of phd’ stress). Thank you for your patience.

I have a temporary system in place, the citations are working now so long as I place them in brackets and the output file isn’t perfect, but workable.

In case someone stumbles across this thread looking for information on DownDoc, I will note: it sounds like a great solution for those that want a simple markdown → Word workflow, but the documentation is extremely limited (and assumes a lot of knowledge). I’m also encountering issues that based on @nontroppo’s help, seem to be linked to DownDoc (as I’m using the same script for the picker).

If I don’t place the citation in square brackets, it is not recognised as a citation (no matter where I place the citation). If I have a couple of mins to spare I’ll create a BTT action/shortcut that inserts ‘[ ]’ as plain text > places the cursor in-between them > triggers the Zotpick shortcut. At least for now I know to insert the citation into square brackets.

In order to let the system make its own note from the citation, I’m guessing I would need to have the citation in the body of the text. I find this disjoints the flow of the paragraph when I’m writing, (see below example with dummy text because I’m not ready to put my writing online :see_no_evil:, same paragraph footnotes vs in-text). The citations in footnotes don’t seem to be an issue anyway, thank goodness!

For now, I have a custom doc that is attached to DownDoc and it uses that for the formatting. It gets the paragraph and footnote fonts correct. Not the title or block quote text and only the headings sometimes. I need to manually change those, but for now I’m making do. Thanks so much for the offer, though. I’ve already taken enough of your time :slight_smile:

I have a make or break deadline looming, so I’ll just use the system as is for now and then spend the time to get everything else setup correctly (using your recommended workflow, not DownDoc) before shifting to the next (tight) deadline. I need to learn additional things before proceeding. Ordinarily that’s fine, I taught myself html, basic markdown, basic js etc using a ‘learn by doing’ process, I just can’t risk going down a rabbit hole right noe (which I’m pretty susceptible to, for example: this response :sweat_smile:).

Here’s hoping my next update is ‘I figured it all out:smiling_face:

I’ve never seen this tool before, and suspect most of your issues are indeed to do with this. Anyway, as long as things are roughly working, you can tweak when stress levels go down… Good luck!


PHD Comics

Good luck!

3 Likes

Thanks, I’ll take all the luck I can get :slight_smile:

19 posts were merged into an existing topic: Workflow no longer works after Mac update, help needed to export Scrivener to Word with live citations