Zotfile features
Hi,
here are two questions or suggestions to customize the way Zotfile extract annotations from pdf files.
*) For the quotations (highlighted text, etc.) : how about to use the blockquote element so that, let's say Writer, automatically paste the content as quoted?
*) For the refences key: could we choose to use the Better Bibtex keys instead of the citelink name year?
here are two questions or suggestions to customize the way Zotfile extract annotations from pdf files.
*) For the quotations (highlighted text, etc.) : how about to use the blockquote element so that, let's say Writer, automatically paste the content as quoted?
*) For the refences key: could we choose to use the Better Bibtex keys instead of the citelink name year?
%b
should work according to https://github.com/jlegewie/zotfile/issues/386Maybe using the "wildcards"?
Replacing '%a %y' in line 226 with '%b' didn't change anything.
Edit 2: Okay I figured out why it had no effect, I had to reinstall the altered .xpi via the add ons menu instead of just editing the xpi. It seems to work now, although the code is not pretty:
On line 226 I have:
cite = this.getPref("pdfExtraction.NoteFullCite") ? this.Wildcards.replaceWildcard(item, "%b").replace(/_(?!.*_)/," and ").replace(/_/g,", ") : "p. ",
An on line 258:
var link = '[@' + cite + ', ' + page + ']',
Which produces annotation output in the form of "[@blume2020, 3]".
See also this discussion: https://forums.zotero.org/discussion/83077/extract-annotations-gives-just-one-way-in-text-citation-style
To use the blockquote :
go the the advanced config panel and change the html element for:
extensions.zotfile.pdfExtraction.formatAnnotationHighlight
extensions.zotfile.pdfExtraction.formatAnnotationUnderline
Then change :
"p" and "/p" to "blockquote" and "/blockquote"
(tip found there : https://forum.zettlr.com/discussion/94/zotero-as-zettelkasten)
If I understand, it requires to:
*) change "in the code" the line 258: var link = '[@' + cite + ', ' + page + ']',
*) change "in the code" the line 226 : cite = """what we get from the configuration file or editor"""?
*) add in the configuration editor en entry about "cite" (your "cite = this.getPref("pdfExtraction.NoteFullCite") ? this.Wildcards.replaceWildcard(item, "%b").replace(/_(?!.*_)/," and ").replace(/_/g,", ") : "p. ","
Is that correct?
I'm not quite sure what you are asking for. The code I posted above is pretty messy and changes two variables ('cite' and 'link') in a way that kills their original purpose in order to function as citekey-outputs for easier use in markdown/pandora-citeproc integrations.
I think your original reply was spot on: the main problem lies not so much with 'cite' but that we can't use the wildcards (e.g. %b for citekey) when changing the extraction format in the config editor (extensions.zotfile.pdfExtraction.formatAnnotationHighlight, etc.). Going through 'cite' and the xpi file is just a workaround because %b as a wildcard doesn't work in the config editor for some reason.
So I see three options:
a) either allow 'cite' to be defined through config editor (probably requires something like what you wrote above, except I'm unsure about line 258 because that currently erases the link to PDF page and instead adds an '@' plus square brackets ('[]') <- This would be the most complicated way, I guess.
b) or allow the %b wildcard (and respectively %a and %y and so on) to be used in config editor values for pdfExtraction.format... <- This would likely be easiest to use but I'm not sure if its doable because as I recall from trying last time, none of the single letter wildcards work in config variables?
c) for this specific problem: add a 'citekey' wildcard that works similar to 'cite' or 'page', i.e. is defined in the xpi but can be used in the config editor <- probably easiest to code/implement?