How to handle extra URLs in Zotero without mangling them?

In my publications, I like to capture as many links as possible: paper, presentation, video, Github repo, etc.

I use Bibtex and the BibBase tool to make my bibliography https://rawgit2.com/VladimirAlexiev/my/master/index.html.
In BibBase I can make up my own URLs eg like this:

@InProceedings{Alexiev-ENDORSE-2021,
author = {Vladimir Alexiev},
title = {{Diverse Uses of a Semantic Graph Database for Knowledge Organization and Research}},
booktitle = {{European Data Conference on Reference Data and Semantics (ENDORSE 2021)}},
year = 2021,
pages = 47,
month = mar,
organization = {European Commission: Directorate-General for Informatics, Publications Office of the European Union, ISA2 Programme},
url = {https://op.europa.eu/o/opportal-service/download-handler?identifier=41b06a9b-e388-11eb-895a-01aa75ed71a1&format=pdf&language=en&productionSystem=cellar},
url_Github = {https://github.com/VladimirAlexiev/ontotext-graphdb-applications},
url_PPT = {https://github.com/VladimirAlexiev/ontotext-graphdb-applications/raw/master/Diverse Uses of a Semantic Graph Database for Knowledge Organization and Research (ENDORSE%202021).pptx},
url_Slides = {https://op.europa.eu/documents/7525478/8087182/ALEXIEV_presentation_Diverse+Uses+of+a+Semantic+Graph+Database+for+Knowledge+Organization+and+Research.pdf/b27afc2c-3db7-749b-c50c-52b3ded79f3c},
url_Video = {https://www.youtube.com/watch?v=0q63x2P1V0o&list=PLT5rARDev_rmGr_LJkr7zcI-Qul7yOOHO&index=4&t=4780s},
url_Zotero = {https://www.zotero.org/groups/2744757/ontotext-graphdb},
keywords = {...},
doi = {10.2830/44569},
isbn = {978-92-78-42416-9},
annote = {Catalogue number: OA-03-21-303-EN-N},
date = {2021-07-12},
abstract = {...}
}


When this Bibtex is imported to Zotero, it captures the links in the Extra field like this:

Citation Key: Alexiev-ENDORSE-2021
tex.url_github: https://github.com/VladimirAlexiev/ontotext-graphdb-applications
tex.url_ppt: https://github.com/VladimirAlexiev/ontotext-graphdb-applications/raw/master/Diverse Uses of a Semantic Graph Database for Knowledge Organization and Research (ENDORSE%202021).pptx
tex.url_slides: https://op.europa.eu/documents/7525478/8087182/ALEXIEVₚresentationDiverse+Uses+of+a+Semantic+Graph+Database+for+Knowledge+Organization+and+Research.pdf/b27afc2c-3db7-749b-c50c-52b3ded79f3c
tex.url_video: https://www.youtube.com/watch?v=0q63x2P1V0o&list=PLT5rARDevrmGrLJkr7zcI-Qul7yOOHO&index=4&t=4780s
tex.url_zotero: https://www.zotero.org/groups/2744757/ontotext-graphdb

There are 2 problems:

- The URLs are badly mangled: underscore is interpreted as “start of subscript”
- Field names have prefix "tex" that I don’t like (bibtex is not the same as tex, and in any case bibtex is just one of many bib formats: I care about the meaning of the field, not where it came from).

So I corrected them like so:

url_Github: https://github.com/VladimirAlexiev/ontotext-graphdb-applications
url_PPT: https://github.com/VladimirAlexiev/ontotext-graphdb-applications/raw/master/Diverse Uses of a Semantic Graph Database for Knowledge Organization and Research (ENDORSE%202021).pptx
url_Slides: https://op.europa.eu/documents/7525478/8087182/ALEXIEV_presentation_Diverse+Uses+of+a+Semantic+Graph+Database+for+Knowledge+Organization+and+Research.pdf/b27afc2c-3db7-749b-c50c-52b3ded79f3c
url_Video: https://www.youtube.com/watch?v=0q63x2P1V0o&list=PLT5rARDev_rmGr_LJkr7zcI-Qul7yOOHO&index=4&t=4780s
url_Zotero: https://www.zotero.org/groups/2744757/ontotext-graphdb

I guess the better way is to create attachment sub-items with names like "Github", "PPT" etc and the given links. But can Zotero make such sub-items from any import format?

In lieu of making sub-items, may I ask for this improvement:

- Leave extra field names as is, don't prepend "tex."
- Leave extra fields starting with "url_" as is, do not mangle them by interpreting underscore as "subscript"

  • FWIW, what you are seeing is the behavior of the BetterBibTeX add-on. Zotero by itself would just ignore these fields (as it does for unknown/non-standard fields from any metadata format).
    BBT proritizes roundtripping to/from BibTeX, hence the current behavior there.

    You can create attached links in import, yes, but that does require modifying the (JavaScript) import translator
  • edited October 7, 2023
    They're not being "mangled"; the url field is a verbatim field, and these unknown fields are (by default) not. In verbatim mode characters like _ have different meaning from non-verbatim, and that's the "mangling" you see: those fields are being imported as non-verbatim. Leaving them as they are in the bibtex could very well break compilation of documents BTW, unless you have made special accommodations in your preamble for this.

    Anyhow, you can go into Zotero's hidden preferences in the Advanced pane, search for verbatimFields and add these field names to the list (or a regex that covers them), and BBT will import these in verbatim mode, like it does for url (you will find that url is already in the list).

    wrt the tex. fields, if you would rather that they are lost during import, go into the hidden prefs again, and set importExtra to false. As adamsmith pointed out, you are misinterpreting what that tex. means; these just mark these lines for BBT, and the tex. is just the default; you can change them to bibtex. or biblatex. and those lines will then only be re-exported for bibtex/biblatex exports, respectively.
  • edited October 7, 2023
    Leave extra field names as is, don't prepend "tex."
    BBT already does this for fields that have a Zotero equivalent; try importing

    @book{gocl1613,
    address = {Hildesheim},
    author = {Goclenius, Rudolph},
    category = {Primary},
    date = {1964},
    origdate = {1613},
    publisher = {G. Olms},
    title = {Lexicon philosophicum, quo tanquam clave philosophicae fores aperiuntur}}


    The fields you named don't have Zotero equivalents, and they are marked this way so they can be exported again. So no, this is not going to change.
    Leave extra fields starting with "url_" as is, do not mangle them by interpreting underscore as "subscript"
    You can do that yourself by adding /^url_/ to verbatimFields. I'm not going to bake this in as a default.
    bibtex is not the same as tex
    be that as it may, BBT is the only plugin that will understand these fields. The ones that have Zotero equivalents (and that will be understood by eg the citeproc processor) are already imported without that prefix.

    New version is out that optionally imports URLs as attachments. You will still have to mark these fields as verbatim though.
Sign In or Register to comment.