Closed TaymAlsalti closed 9 months ago
You're running Zotero, I thought you were running Juris-M. Can you try with this version and report back what it prints before the error?
Yes, I'm running zotero. Here is the new output before the error:
zotero-live-citations a522fcd new version "caf41cc" available at https://retorque.re/zotero-better-bibtex/exporting better bibtex: command line override "scannable_cite" better bibtex: command line override "client"
RStudio is calling pandoc with --metadata=zotero_scannable_cite:true --metadata=zotero_client:jurism
. If you remove those it should work.
Yes, that worked! However using both the old and new lua filters only three references are being recognised and properly encoded when I referesh Zotero in the newly output document (although only a subset of the in text citations are being converted to live citations for these three references, too). The rest are "not found" even though they are in the group library and saved under the correct citation keys. E.g., the first one
zotero-live-citations a522fcd new version "caf41cc" available at https://retorque.re/zotero-better-bibtex/exporting @ahnReviewMetaAnalysesEducation2012: not found
I can't tell what's special about the three references which were found but here are their citation keys, if that helps: buchEffectsTDCSMotor2017 kangTranscranialDirectCurrent2018 luedtkeTranscranialDirectCurrent2012
You can use the standard filter again, the one I posted here just reported the command line parameters.
Can you run that conversion again, and after the conversion, send a debug log?
Okay I don't know whether I changed something and what exactly it was, but upon rerunning the conversion with the standard filter all references could be found and all citations but a few were correctly converted. The remaining ones are non standard in-text citations where the author's name should be rendered outside the parentheses, e.g.,
as done by @reisNoninvasiveCorticalStimulation2009
or where other stuff is written in the brackets so that this extra stuff can appear in the rendered parentheses, e.g.,
[at least among the ~50% of meta-analyses which conduct such analyses pageEvaluationsUptakeImpact2017; @veveaPublicationBias2019; @borensteinPublicationBias2009; @harrerDoingMetaAnalysisHandsOn2021].
Should I send a debug log for this?
Edit: these are few enough that I'd be fine with modifying them manually in the output document and closing this issue if you prefer. :)
The remaining ones are non standard in-text citations where the author's name should be rendered outside the parentheses, e.g.,
You can still convert those by using author-in-text: true
, but Zotero doesn't really support this, so the result will just be plain content for Zotero. If you update the reference in Zotero, the author part thus converted won't change.
or where other stuff is written in the brackets so that this extra stuff can appear in the rendered parentheses, e.g.,
These should just work, so yes, if you have a minimal markdown document + items (in the debug log) that reproduce this, I can take a look.
Edit: these are few enough that I'd be fine with modifying them manually in the output document and closing this issue if you prefer. :)
Nope, I'd prefer it if these would just work; if you've found a bug, I'd like to fix it.
You can still convert those by using author-in-text: true, but Zotero doesn't really support this, so the result will just be plain content for Zotero. If you update the reference in Zotero, the author part thus converted won't change.
With author-in-text: true
I actually now get the correct live citation but without the author's name but perhaps that's what you meant? So "by @reisNoninvasiveCorticalStimulation2009" was rendered as "by (2009)" + the live citation.
These should just work, so yes, if you have a minimal markdown document + items (in the debug log) that reproduce this, I can take a look.
Ok I noticed the "@" was missing from the first citation key in the brackets so now this
[at least among the ~50% of meta-analyses which conduct such analyses @pageEvaluationsUptakeImpact2017; @veveaPublicationBias2019; @borensteinPublicationBias2009; @harrerDoingMetaAnalysisHandsOn2021].
is rendered as
(Borenstein et al., 2009b; Harrer et al., 2021; at least among the ~50% of meta-analyses which conduct such analyses Page & Moher, 2017; Vevea et al., 2019)
So I guess the "at least..." part is being grouped with the Page & Moher citation when sorting alphabetically? I tried adding a comma before the first citation but that didn't change this.
Here's the entire content of a reproducible RMD, the pandoc code pandoc -s --lua-filter=zotero.lua -o MRE.docx -f markdown -t docx MRE.rmd
and the debug ID (BFXJMKI4-refs-euc/6.7.140-6):
--- zotero: library: "tDCS-Motor Learning" # zotero group name client: zotero author-in-text: false csl-style: apa author-in-text: true ---
Small-study effect methods have been available for more than two decades and are very widely used [at least among the ~50% of meta-analyses which conduct such analyses @pageEvaluationsUptakeImpact2017; @veveaPublicationBias2019; @borensteinPublicationBias2009; @harrerDoingMetaAnalysisHandsOn2021].
You can't have author-in-text
be both true and false. The behavior is undefined when you do that.
Interesting -- we may have stumbled upon a Zotero bug? If you edit the generated citation in Word, the
at least among the ~50% of meta-analyses which conduct such analyses
is part of the prefix of the first item. I'll check with the Zotero devs.
Do you have a sample where author in text fails?
Ha, I have found it -- Zotero sorts citations by default but can be told to not do so. Fix incoming.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.140.2736.5515 ("too much recursion?")
Install in Zotero by downloading test build 6.7.140.2736.5515, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
Can you send a new debug log from 5515? This version together with https://raw.githubusercontent.com/retorquere/zotero-better-bibtex/gh-2736/site/content/exporting/zotero.lua will solve the prefix problem. I'd still like to fix the author-in-text problem if you have an MWE for that.
Can you send a new debug log from 5515? This version together with https://raw.githubusercontent.com/retorquere/zotero-better-bibtex/gh-2736/site/content/exporting/zotero.lua will solve the prefix problem.
Done but I idiotically copied something over the debug ID and lost it. The problem was not fixed, I had the same output as before using the MRE above.
MRE for the author-in-text issue (same pandoc code as above and with two of the references included in the last two debug requests I sent):
--- zotero: library: "tDCS-Motor Learning" # zotero group name client: zotero author-in-text: false csl-style: apa author-in-text: true ---
This was done by @pageEvaluationsUptakeImpact2017 and @veveaPublicationBias2019.
Was rendered as "This was done by (2017) and (2019).".
Done but I idiotically copied something over the debug ID and lost it. The problem was not fixed, I had the same output as before using the MRE above.
Can you send a new one, and attach the docx file that didn't come out right?
There's a new version on https://raw.githubusercontent.com/retorquere/zotero-better-bibtex/gh-2736/site/content/exporting/zotero.lua (should say "zotero-live-citations 48ec0f9" at the top) that will fix the author-in-text version.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.140.2736.5516 ("author-in-text needs xml wrapper")
Install in Zotero by downloading test build 6.7.140.2736.5516, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
There's a new version on https://raw.githubusercontent.com/retorquere/zotero-better-bibtex/gh-2736/site/content/exporting/zotero.lua (should say "zotero-live-citations https://github.com/retorquere/zotero-better-bibtex/commit/48ec0f984a2ec290eed5ef88a6260d0affe7442e" at the top) that will fix the author-in-text version.
Sorry I have to do this to you on new year's eve but using this new filter, the same pandoc code, and this MRE:
---
zotero:
library: "tDCS-Motor Learning" # zotero group name
client: zotero
author-in-text: false
csl-style: apa
author-in-text: true
---
This was done by @pageEvaluationsUptakeImpact2017 and @veveaPublicationBias2019 and @fregniRegulatoryConsiderationsClinical2015a.
I get
This was done by Page and Moher (2017) and Vevea, Coburn and Sutton (2019) and Fregni, Nitsche, Loo, Brunoni, Marangolo, Leite, Carvalho, Bolognini, Caumo, Paik, Simis, Ueda, Ekhitari, Luu, Tucker, Tyler, Brunelin, Datta, Juan, Venkatasubramanian, Boggio and Bikson (2015).
Both the second and third citations should be "et al."ed according to the APA of course. Here's a debug ID: BGYEB56A-refs-euc/6.7.140.2736.5515-6
Re: the prefix issue here's the debug ID ARIDAE96-refs-euc/6.7.140.2736.5515-6 and here's the output MRE.docx file.
That still has conflicting author-in-text directives. Can you remove the false directive? And can you double check the version of the zotero.lua filter you're using?
Oh wait it does work it's just not APA compliant... oof that will be harder, I'll see what I can do about that.
That still has conflicting author-in-text directives. Can you remove the false directive? And can you double check the version of the zotero.lua filter you're using?
Aaah sorry I misunderstood you the first time you told me about the conflicting directives and hadn't noticed it the whole time. Removing the first (: false
) one didn't do anything because I presume the second one overrode it anyway. So yes, the new filter (zotero-live-citations 48ec0f9
) works, it just doesn't output APA compliant in-text citations. :)
:robot: this is your friendly neighborhood build bot announcing test build 6.7.140.2736.5519 ("I am the king of the kludge")
Install in Zotero by downloading test build 6.7.140.2736.5519, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
Build 5519 + zotero-live-citations e9fb621 from https://raw.githubusercontent.com/retorquere/zotero-better-bibtex/gh-2736/site/content/exporting/zotero.lua will get style-compliant author-in-text. It's a bit of a kludge so I don't know if it will always work -- the citation processor that Zotero uses doesn't really support author-only cites, so I have it generate a citation and attempt to extract the author from it.
:robot: this is your friendly neighborhood build bot announcing test build 6.7.140.2736.5520 ("better error message for invalid styles")
Install in Zotero by downloading test build 6.7.140.2736.5520, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".
Can you verify that this does what you need?
I just checked and it does! Sorry for the delay!
It now renders:
This was done by Page & Moher (2017) and Vevea et al. (2019) and Fregni et al. (2015).
Awesome. I'm pretty proud of this kludge 😁. One more thing that BBT does that's not supposed to be possible in Zotero 😄.
I'll put out a new release for this today.
Haha I'm afraid the inner workings of your software are too far over my head for me to be genuinely impressed but you have my commendation and gratitude all the same!
Debug log ID
Q5TCJ3AI-refs-euc/6.7.140-6
What happened?
Hi,
I'm encountering problems trying to convert my .rmd file to a docx. with live Zotero citations: When I run this in the Terminal within Rstudio and RProject (working dir)
pandoc -s --lua-filter=zotero.lua --metadata=zotero_scannable_cite:true --metadata=zotero_client:jurism -o Thesis.docx -f markdown -t docx Thesis.rmd
I get the error below, which seems to contain all my citation keys. I had my Zotero (v. 6.0.30) open. Other potentially relevant information:Would appreciate any hints!
Many thanks, Taym
P.S. I submitted a debug log using all references in my group library because I don't know which specific references, if any, are causing the problem.