forums.tropy.org

Best practice for creating citations?

Hi everyone,

I’m using Tropy to organize the sources for my dissertation. I use Zotero for citations of secondary literature, and I would love to be able to cite the sources I have on Tropy without having to manually type each one into Zotero.

What is the workflow you all recommend? I read that exporting data as JSON files could work, but I’m not managing to import these files into Zotero.

Thank you!
Mariana

Hi,

there is a first version of a plugin that lets you export your Tropy items as CSL/JSON for Zotero: GitHub - tropy/tropy-plugin-csl. The plugin is in an early stage but it might serve you well:

– Download the code from GitHub as ZIP file. Do not unpack the ZIP and verify that your browser did not unpack it.

– Install the plugin in Tropy by selecting the ZIP file in Preferences > Plugins.

– Duplicate the template you are using for your items in the template editor and for each field you want to export to Zotero set a corresponding CSL/JSON id in the field’s label.

– Then select this ‘export’ template in the plugin.

– You can export multiple Tropy items as a single JSON file (so you don’t have to import the items file by file into Zotero). To do so, select multiple items, right click, and select Export Selected Items > Your Zotero Plugin Name from the context menu. Make sure each item has a valid type field.

Alternatively, if you happen to end up with multiple CSL JSON files, you can install e.g. jq to concatenate your files: after installing jq, run in the command line

cat file-1.json file-2.json | jq .[] | jq -s > output.json (bash) or
cat file-1.json file-2.json | jq '.[]' | jq -s > output.json (zsh).

In case you have a folder with lots of JSON files you want to concatenate, you can use * instead of the file names (file-1.json file-2.json).

Hope it helps!

Hi!
Thank you very much! I’m trying to set this up. I’m a little lost with this step: Duplicate the template you are using for your items in the template editor and for each field you want to export to Zotero set a corresponding CSL/JSON id in the field’s label.
What is a CSL/JSON id?

Thank you!

Hi,
the CSL/JSON ids are in the long list here in the readme: GitHub - tropy/tropy-plugin-csl.

They represent the Zotero metadata fields. So for example if you want to map Tropy’s dc:title to Zotero’s title field, you enter title into the label of the dc:title property. To map dc:creator to Zotero’s author field, you’d enter author into the label of the dc:creator property and so on:

Be aware that you can only use ids that are available in that list and make sure to map a field (typically your dc:type field) to Zotero’s type field. Then, in your project, use valid type values for your items (e.g. manuscript) from this list : CSL 1.0.1 Specification — Citation Style Language 1.0.1-dev documentation

Hi!

Thank you so much for the clarification. I was able to complete this step thanks to your explanation.

I have one more question – sorry for the lack of tech savviness!

Where do I do this? I can’t seem to find an option to alter the plugin settings.

Thank you again

Hi,

simply click anywhere on the plugin to expand its settings:

As you struggled to find the plugin settings I think we should improve the UI – thanks for the feedback!

Hi,

Thank you for the help, I’m making a lot of progress!

So sorry for requesting help once again, but I’m still struggling a bit. I managed to export the items, but only the title, author, and date fields appear in Zotero. Other fields that I have set up, such as archive, archive_location, call-number, and abstract do not appear.

Here’s what I see in Tropy

And here’s that same document in Zotero:

Here’s what the template looks like:

What do you think might be going on?

Thank you again!!

And this is the CSL JSON file if I open it in a text editor

[
{
“type”: “manuscript”,
“title”: “Relación de los capataces y peones que quedan existentes en la estancia de Surubiy y sus puestos”,
“issued”: {
“raw”: “1848-09-18”
},
“author”: [
{
“literal”: “Campurano, Juan de la Cruz”
}
]
}
]

Hi,
you are doing everything right on your side. We realized that there is an issue with the current plugin (sorry for that) and will release an update within the next days.
I’ll let you know once the new plugin version is available so you can reinstall it, that should fix the issue. Stay tuned!