My Zotero > Logseq > Zettlr > Word Workflow

This is all a bit abstract, so I illustrated what the process should look like if everything worked perfectly - as well as some notes about were it doesn’t.

3 Likes

Hi @Luhmann !

Thanks for your greats articles !

Can you share your page completed page template (and maybe inline) please ?

I haven’t tried it myself yet but a lua filter for Pandoc to achieve this has been around for a while now:

This might be a helpful resource: Help: From Markdown to Zotero live citations - Zotero Forums

1 Like

Sure:

alias:: {author lastname} ({date}) {title}
source:: [[{type}]]
citekey:: {citekey}
tags:: [[publication]], [[Logseq citation manager]], 
status:: 
icon:: 📚

- {author++}. {date}. *{title}*. {publisher}.
  {author++}. {date}. "{title}." *{journaltitle}* {volume} ({number}): {pages}.
	- DOI: {doi}
	- URL: {url}
	- File(s): {file++}
	- Local library: [{citekey}](zotero://select/items/@{citekey})
- Abstract:
	- {abstract}
- Notes

Note that I have two rows for the full book citation. One is for books and one is for articles. I delete whichever is wrong. Hopefully eventually the template will be able to be context-sensitive and produce the right template for each type of source.

1 Like

Thanks. Zettlr supports lua filters for Pandoc, so it should be much simpler than the workflow descried in the Zotero forums link. I’ll have to test this out later…

2 Likes

Thanks a lot @Luhmann !

Thanks for sharing! I’m still in the initial stages of my dissertation and was wondering how others organised their literature to get some inspiration and discuss about it.

I’ve a question regarding the fundamental purpose of Zettlr. It’s clear you use it to export it to Word with formatted in text citations and a bibliography, but do you do all of your (draft) writing in Logseq, so you can export a finished product to Zettlr and respectively Word?

Thanks for the great writeup!

Do you have an idea how to deal with images?

I think a better way than to use Zettlr to mangle the citations to Chicago style “((Makhulu and Smith 2022, p, 178)” would be to just leave the BibTeX keys in the document with something easily recognizable (start all of them with an “@”? Then open the document in Word, and manually replace all keys with proper Fields using the Zotero plugin (I just tried, search also works for keys). Maybe someone could write a VB plugin that searches for such strings and then calls the Zotero plugin to replace them by fields

The advantage is that otherwise one could mix up citations in case there similar citations by the same authors. (Makhulu and Smith 2022a), (Makhulu and Smith 2022b) which don’t uniquely resolve back to an item.

Alt+F9 in Word toggles the Field codes, they contain information that is currently not available on the Logseq side (citation ID), but in principle it should be eventually possible to directly export from Logseq and turn all links that link to a citation page into a Field.

2 Likes

Wouldn’t you need to put that in quotes? Any comma in the title will result in two separate aliases, won’t it? Or do you add them manually if needed?

Zettlr does keep the citation key, it just displays it without so that you can edit your paper without seeing all the code. If you click each citation you get the citekey. As I say, and you can see in my example, the additions to the citekey are also hidden until export (or clicking) - such as the page number.

Moreover, it is supposedly possible to use a lua script in Zettlr to export to a Word document with live zotero keys if that is what you want. I haven’t tested this yet.

2 Likes

I don’t currently draft papers in Logseq, see my forum post on longform writing. I previously used Ulysses, but because of this workflow I will now try to use Zettlr instead to see if that works. I mostly use Logseq for initial note taking and outlining.

I generally clean it up manually. Hopefully later on there can be an option for a cleaned up {title} field that doesn’t have any non-letter characters, precisely for this reason…

That’s interesting. Why would you prefer to clean up the title, which might deteriorate the title’s recognizability, over setting the whole alias in quotes? In my experience, that prevents the alias from being interpreted as multiple aliases.

In my field, some titles can be quite long… I often only us the part before the semicolon as an alias, and ignore the rest.

2 Likes

Baroque titles? :wink:
But in that case, that makes sense.

Great Article. I replicated most of the workflow mentioned.
One problem I face is that I can’t open logseq notes from Zotero. Does anyone else on linux face the same issue?
Here are my MarkDB settings.


HI. I could not get the Citation Manager Plugin to work and I wanted live Zotero citations in a Word document without manual replacement of every citation instance. This is to allow easier collaboration outside of Logseq and easy style adjustments once closer to submission ready. After scanning many blogs and trying and failing a few things (most of this is new), I ended up with this sequence:

Please let me know if there is an easier way!

ASSUMING: Zotero and BetterBibTex, Pandoc and zotero.lua, and Word Zotero Plugin are installed and configured - see Help: From Markdown to Zotero live citations - Zotero Forums. And that you have Typora or some MD editor with find and replace.

Best to place everything you need in one folder, the library, zotero.lua and MD file for conversion. I have a special conversion folder. Remove any spaces in file names.

  1. Create journal article in Logseq using double brackets around [[@citekeys]] (no parentheses) where your want your inline references to go. This is for items imported from Zotero (I use the native Logseq Zotero plugin that creates a page with metadata and imports annotations, if you have extracted them using Zotfile in Zotero).

  2. Add page links with double brackets if this is useful for writing and the [[language]] appears natural - brackets will be sorted by the end of the process.

  3. Use Markdown headers, italics, bold, embedded links, etc., as you please to format the article. EXCEPT - using single or double brackets will complicate this, as they will be removed. Sorry about that!

Article ready for export?

  1. Ensure brackets are displayed in Logseq (ctrl+c ctrl+b). Go to Document View (a plugin). This removes bullet points from view while retaining brackets and rich text.

  2. Select all and copy. Paste into Typora (or another MD editor with find and replace).

  3. Replace double brackets [[@citekey]] with single brackets [@citekey]. This is what Pandoc looks for to convert all citekeys that correspond to a Zotero item. Save.

  4. Open PowerShell, go the folder with your files, and input: pandoc --lua-filter=zotero.lua “MD_to_convert.md” -s -o “Preffered_output_title”.docx

Check for any errors you may need to deal with in PowerShell

  1. If successful, open Word document, which should be in the same folder as the files, and click “refresh” on Zotero Word plugin, selecting your citation style. You should now have Zotero live citations. If your citation style uses brackets, DO NOT create the bibliography yet.

  2. Find and Replace remaining [single] brackets - left over from any non citekey page links - with nothing. This is why you should only use page links that sound natural in the text.

  3. Create bibliography with Zotero. Finish formatting to taste/necessity

Save as PDF in Word if you like

TADA! You can work in Logseq with operational @citekey links to their pages and all their connections, notes, the PDF in Zotero, etc., all the way up to a document for submission or collaboration outside Logseq.

Many people use Pandoc. It would be great to auto export from Logseq to Word via Zotero, but in the meantime, I imagine it would be simple to create a Logseq export that rendered @citekeys readable to Pandoc with single brackets, removed double brackets from page links, and retained all the other MD formatting.

My thanks for any feedback and tips.

1 Like

I’m having the same issue under Ubuntu Linux 20.04.
Does anyone have a workaround?

hi @war3241 and @Flan – i’m the maker of the Zotero plugin MarkDB-Connect. Someone just pointed me to this post. If you’re still having problems configuring the plugin, please post an issue in the github repo and I’d be happy to take a look.

2 Likes

Can confirm this fixes the issue! Thanks, @daeh !

1 Like