Open jlegewie opened 9 years ago
Sorry for not adding the issue directly on Github (I wasn't aware it was a request), and for forgetting to ask the following on the Zotero Forum, but I was wondering if this was the same as/related to #95 ?
Yes, you are right. I closed the other one.
Just some notes if anyone wants to look into this.
Currently, the cite key is hard coded on line https://github.com/jlegewie/zotfile/blob/master/chrome/content/zotfile/zotfile.js#L3743
zz.replaceWildcard(item, "%a %y:").replace(/_(?!.*_)/," and ").replace(/_/g,", ")
is the relevant part. It first uses the replaceWildcard function and then formats the author string with and
and ,
.
Also add option to format the cite key as plain-text scannable citations "scannable citations".
For Zotfile 5.0.6 the following changes can be applied to line 223 in pdfAnnotations.js
The line cited by Joscha (above) is slightly different in Zotfile 5: cite = this.getPref("pdfExtraction.NoteFullCite") ? this.Wildcards.replaceWildcard(item, "%a %y:").replace(/(?!.*)/," and ").replace(/_/g,", ") : "p. ",
To get extracted annotations with a more specific citation style, replace that line as follows:
// APA:
cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " APA FullCite ", this.Wildcards.replaceWildcard(item, "%a, %y").replace(/_(?!.*_)/," & ").replace(/_/g,", ") + ", p. ") : (str_title += " APA PageCite ","p. "),
// or Harvard:
cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " Harvard FullCite ", this.Wildcards.replaceWildcard(item, "%a, %y").replace(/_(?!.*_)/," and ").replace(/_/g,", ") + ", p. ") : (str_title += " Harvard PageCite ","p. "),
// or MLA:
cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " MLA FullCite ", this.Wildcards.replaceWildcard(item, "%a").replace(/_(?!.*_)/," and ").replace(/_/g,", ") + " ") : (str_title += " MLA PageCite ",""),
// etc.
Modify yourself or use xpi files in attached zip file based on Zotfile version 5.0.6 - a customised "Scannable Cite" version is also included in the zip file. zotfile-5.0.6-fx-customised.zip
Customised APA version of Zotfile 5.0.16 attached.
Hey @notehound thanks for your replies! Could you please exaggerate how to change the line to have a scannable cite?
Thanks in advance
For Zotfile 5.0.6 the following changes can be applied to line 223 in pdfAnnotations.js
The line cited by Joscha (above) is slightly different in Zotfile 5: cite = this.getPref("pdfExtraction.NoteFullCite") ? this.Wildcards.replaceWildcard(item, "%a %y:").replace(/(?!.*)/," and ").replace(/_/g,", ") : "p. ",
To get extracted annotations with a more specific citation style, replace that line as follows:
// APA:
cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " APA FullCite ", this.Wildcards.replaceWildcard(item, "%a, %y").replace(/_(?!.*_)/," & ").replace(/_/g,", ") + ", p. ") : (str_title += " APA PageCite ","p. "),
// or Harvard:cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " Harvard FullCite ", this.Wildcards.replaceWildcard(item, "%a, %y").replace(/_(?!.*_)/," and ").replace(/_/g,", ") + ", p. ") : (str_title += " Harvard PageCite ","p. "),
// or MLA:cite = this.getPref("pdfExtraction.NoteFullCite") ? (str_title += " MLA FullCite ", this.Wildcards.replaceWildcard(item, "%a").replace(/_(?!.*_)/," and ").replace(/_/g,", ") + " ") : (str_title += " MLA PageCite ",""),
// etc.Modify yourself or use xpi files in attached zip file based on Zotfile version 5.0.6 - a customised "Scannable Cite" version is also included in the zip file. zotfile-5.0.6-fx-customised.zip
Hello How can i rename file extension from zip to xpi? Thanks.
Hello scannable cite version does not work. Can you help me about that?
Apologies for my late responses to posts last month. @Schmedu To extract to scannable cite format using zotfile-5.0.16 change pdfAnnotations.js lines as follows:
replace line 217 (optional for clarity):
str_title = this.ZFgetString('extraction.noteTitle'),
with:
str_title = this.ZFgetString('extraction.noteTitle') + " Scannable Cite ",
replace line 226:
cite = this.getPref("pdfExtraction.NoteFullCite") ? this.Wildcards.replaceWildcard(item, "%a %y:").replace(/_(?!.*_)/," and ").replace(/_/g,", ") : "p. ",
with:
cite = " | " + this.Wildcards.replaceWildcard(item, "%a, %y").replace(/_(?!.*_)/," & ").replace(/_/g,", ") + " |p. ",
insert above line 257:
// link
with:
page = page + "| |zu:" + lib + ":" + item.key;
I have already done this in the attached zip file.
@Mugurlu28 - To rename the file from .zip tp .xpi you need to make the file extensions visible in File Explorer (Windows) or Finder (Mac). The file attached here is customised from the latest version of Zotfile which means it will now work with the current version of Zotero.
Hello notehound Thank you very much. But it does not work in word document. Can you please give me your email address?
Hi @Mugurlu28
Scannable Cite does not work with Word.
See: https://zotero-odf-scan.github.io/zotero-odf-scan/
"RTF/ODF-Scan requires Zotero, LibreOffice and Zotero's LibreOffice plugin."
Is there a way to make it work with Word?
@Schmedu @Mugurlu28
Apologies - one last tweak to get annotations in Scannable Cite format:
<p>"%(content)" (%(cite))</p>
to
<p>"%(content)" {%(cite)}</p>
Is there a way to make it work with Word?
You can add scannable citations in word but you must save your Word doc as odt then open the file in Libre Office. You then use the RTF/ODF-Scan for Zotero add-on in Libre Office to generate in-text citations and bibliography in your chosen format.
Is there a way to change the cite-format, when using the 'Extract Annotations' feature?
I have found the option to do some adjustments in extensions.zotfile.pdfExtraction.formatAnnotationNote, but the %(cite) variable does not seem to be configurable?
Right now it comes out as "%(author) %(year):%(page)" and I would like it to be "%(author), %(year), p. %(page)" instead (APA-style) (exampled with fictitious variables, but I hope it makes sense).
I.e. "Clegg et al, 2005, p. 150" instead of "Clegg et al 2005:150".
But I seem to have hit a wall, so any pointers or hints, would be greatly appreciated.