making an extracted quotations manager within zotero+bbt #1798
-
Hi, as suggested there, I'm migrating a thread from the zotero forums over to the bbt github so we can use markdown. I'm trying to code an annotation scanner that will compile all the quotes and comments in a note that are flagged by a # and will produce a .tex file that contains the corresponding quotes, proper \cite commands, and comments, ordered by year of publication. eg, if I have, across a number of other unrelated children notes with extracted annotations and other comments:
in one note, for the parent item with the bibkey "Dewar2009," and, in another note for the parent item with the bibkey "Gell1998" :
I would like the desired code to output, when ran for
Now, as emilianoeheyns pointed out on the zotero forum, this is more complicated than I anticipated. I do understand that html to tex is not easy. Would it be easier to simply output something closer to this?
I don't anticipate running this script or translator often, so I can add the document setup and end matter by hand every time - but it would be the point to at least generate text like that in the second code snippet, with just the proper cite keys and the quotes + comments arranged by year. In other words, this barely has to output any .tex code, it can be mostly plaintext with just \cite[]{} commands where appropriate. Thanks for your help / thinking about this! all the best, Ezra |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm emilianoeheyns. The sections that you put in blockquote, those are the entirety of the note? There are no multiple of these annotations in a single Zotero note? Are these annotations always structured exactly the same? Always exactly
There isn't any difference in complexity between the two outputs shown above; the problem is not in the surrounding text, but in translating the Zotero note bodies, which can contain markup and html-entities. Unfortunately, pandoc does not convert citations in html to citations in tex. So that leaves either converting HTML markup to tex markup in your code, or stripping HTML markup and exporting plain-text tex without markup. |
Beta Was this translation helpful? Give feedback.
I'm emilianoeheyns.
The sections that you put in blockquote, those are the entirety of the note? There are no multiple of these annotations in a single Zotero note?
Are these annotations always structured exactly the same? Always exactly
There isn't any difference in complexity between the two outputs shown above; the problem is not in the surrounding text, but in translating the Zotero note bodies, which can contain markup and html-entities. Unfortunately, pandoc does not convert citations in html to citations in tex. So that leaves either converting HTML markup to tex markup in your code, or stripping HTML markup and expor…