Displaying URL and Accessed Date Information of a Website in Bibliography using Bibtex

Dear Form Members,

I am using Zotero to export my .bib file. It so happens that I would like to cite websites. I would like the URL and the access date of the website to be displayed in my bibliography. I do reference the Zotero item as "website". The URL is displayed. The access date ist not.

This forum discussion [1] has led me to this webpage [2]. This webpage suggests to use the javascript below.

[1] https://forums.zotero.org/discussion/70710/displaying-url-and-accessed-date-information-of-web-page-bibliography-type

[2] https://retorque.re/zotero-better-bibtex/exporting/scripting/

if (Translator.BetterBibTeX && item.itemType === 'webpage') {
if (item.accessDate) {
reference.add({ name: 'note', value: "(accessed " + item.accessDate + ")" });
}
if (item.url) {
reference.add({ name: 'howpublished', bibtex: "{\\url{" + reference.enc_verbatim({value: item.url}) + "}}" });
}
}

This does work as far as it does display the access date in some form. To be exact as: "accessed 2020-03-12T13:11:07Z".

Surprisingly the .bib file still does not contain the information of the access date. How can this be?

Moreover I would like to change accessed to "Zuletzt geprüft". This is difficult because it has a German character ü in it, which the javascript code does not accept. Does anybody know how to work around this?

Last but not least I would like to get rid of the "T13:11:07Z" in "accessed 2020-03-12T13:11:07Z". I cannot figure out where this comes form. Ideally I would also like to change 2020-03-12 into 12.03.2020.

I hope someone can help at least with some of those issues.

Thanks in advance!

Timon
  • Surprisingly the .bib file still does not contain the information of the access date. How can this be?
    Do you mean the .bib file here or do you mean the actually bibliography generated by LaTeX. Because the latter depends on the .bst file, i.e. the bibtex style you're using in addition to the .bib file.
  • I do mean the .bib file not the bibliography generated by LaTeX. You're absolutely right: The latter is being influenced by the style being used... this I could understand.
  • Then I'm confused. On the one hand you say:
    This does work as far as it does display the access date in some form. To be exact as: "accessed 2020-03-12T13:11:07Z".
    but also:
    Surprisingly the .bib file still does not contain the information of the access date. How can this be?
    If it's not in the .bib file, where is the line in the first quote displayed?
  • This may be a silly question, but are you exporting with "BibTeX" or "Better BibTeX" selected in the export dropdown? The postscripts do not turn up for "BibTeX".
  • In what sense does the javascript not accept the "ü"? There should be no problem with that. I don't see "Zuletzt geprüft" in the postscript.
  • @adamsmith

    So within the .bib file I get an entry such as:
    @misc{zotero-128,
    title = {Boltzmann-{{Statistik}} \textendash{} {{Wikipedia}}},
    howpublished = {https://de.wikipedia.org/wiki/Boltzmann-Statistik}
    }

    In my bibliography in my .pdf file, which is being created by LaTeX I get:
    Boltzmann-Statistik - Wikipedia. Https://de.wikipedia.org//wiki/Boltzmannn-Statistik, . - (Zuletzt geprueft 2020-03-12T12:27:30Z)

    I am wondering how LaTeX can give me this output in the .pdf file, if the information about the date accessed (german: Zuletzt geprueft) is nowhere to be seen in the .bib file. Where does it take the information form if not from the .bib file.

    Your Question: If it's not in the .bib file, where is the line in the first quote displayed?
    Answer: The line in the first quote is displayed in the .pdf file created by LaTeX
  • @emilianoeheyns

    Not a silly Question at all! I am exporting as "Better BibTeX" though.
  • @emilianoeheyns

    You are right. I let it run a couple of more times as this time it accepted the ü. So this issue is resolved.
    Do you happen to know how I can get rid of the "T13:11:07Z" Part in "accessed 2020-03-12T13:11:07Z"?
  • @adamsmith @emilianoeheyns

    Sorry guys! With a couple of more reloads/exports my .bib file now displays

    @misc{zotero-128,
    title = {Boltzmann-{{Statistik}} \textendash{} {{Wikipedia}}},
    note = {(Zuletzt gepr{\"u}ft 2020-03-12T12:27:30Z)},
    howpublished = {\url{https://de.wikipedia.org/wiki/Boltzmann-Statistik}}
    }

    Maybe I got confused with my reload/export order.

    These issues remain:
    - How to get rid of the "T13:11:07Z" Part in "accessed 2020-03-12T13:11:07Z"
    - How to get rid of the comma and the period in in between the URL and the parenthesis of the (Zuletzt geprüft)*

    *Boltzmann-Statistik - Wikipedia. https://de.wikipedia.org//wiki/Boltzmannn-Statistik, . - (Zuletzt geprüft 2020-03-12T12:27:30Z)
    *better
    *Boltzmann-Statistik - Wikipedia. https://de.wikipedia.org//wiki/Boltzmannn-Statistik - (Zuletzt geprüft 2020-03-12T12:27:30Z)
  • Can we continue this on github? It's really a BBT question, and on the GH issue tracker I can use markdown, which saves me a ton of typing.
  • Oh you've already opened an issue. Super.
  • @emilianoeheyns

    Yes I did :D
    Sorry for being away for a while. Busy times... let's continue this on GitHub :D
  • @emilianoeheyns are you label-gun on GitHub?
  • edited 6 days ago
    I'm retorquere on github; label-gun is a github bot that acts on my behalf.

    It initially just managed the "user feedback required" label based on who spoke last, hence its name.

    For non-question issues it will also re-open an issue when it's closed by anyone that's not a repo owner; I want to keep issues open until I've merged the results to master as a reminder to myself.

    It also parses the opening message on non-questions to see if there's a debug log ID, and puts out a standard message if it's not found. People would fairly routinely omit it thinking it not relevant to the case, while I really need it, not just for diagnosis, but also because it gives me a testcase to prevent regression.
  • Thank you for the information.

    Is there any way we can reopen the case on GitHub. I am a bit slow in responding, I know, but I am still interested in solving my issue.
  • If you comment on the issue, label-gun will automatically re-open it, unless it's labeled as a question, but then I'll just reopen it manually.
Sign In or Register to comment.