-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pandoc: error reading bibliography file, unexpected J #2826
Comments
The entry as pasted above is incomplete (missing ending brace), so that could explain the problem, there's also a space in your citation key, which isn't valid. Other than that I would guess that maybe Pandoc doesn't understand extended name format, because this renders without issue:
but you can turn off extended name format for biblatex in the preferences. |
FWIW, pandoc does support the biblatex extended name format. (Not documented in the pandoc manual, apparently, but see the source.) |
If I put this into
and run
pandoc converts the entry to CSL-JSON successfully. Ah, I get it; if I enter the input you originally posted (with the missing end brace and the space in the citation key), pandoc reports:
so it's the space in the key. pandoc is quite precise in this case where the error is. BBT doesn't generate keys with spaces, but it will blindly accept whatever key you put into the |
Thanks for your response. I will make the change and try to run pandoc again today.
Sam
…________________________________
From: Emiliano Heyns ***@***.***>
Sent: 06 April 2024 9:08 PM
To: retorquere/zotero-better-bibtex ***@***.***>
Cc: Sam Provost ***@***.***>; Author ***@***.***>
Subject: Re: [retorquere/zotero-better-bibtex] Pandoc: error reading bibliography file, unexpected J (Issue #2826)
You don't often get email from ***@***.*** Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
If I put this into bib.bib:
@Article{deJong2012,
title = {Perceived Green Qualities Were Associated with Neighborhood Satisfaction, Physical Activity, and General Health: Results from a Cross-Sectional Study in Suburban and Rural {{Scania}}, Southern {{Sweden}}},
author = {family=Jong, given=K., prefix=de, useprefix=true and Albin, M. and Skärbäck, E. and Grahn, P. and Björk, J.},
date = {2012},
journaltitle = {Health Place},
volume = {18},
doi = {10.1016/j.healthplace.2012.07.001}
}
and run
pandoc bib.bib -t csljson -o bib.json
pandoc converts the entry to CSL-JSON successfully.
Ah, I get it; if I enter the input you originally posted (with the missing end brace and the space in the citation key), pandoc reports:
Error at "bib.bib" (line 1, column 13):
unexpected 'J'
@Article{de Jong2012,
so it's the space in the key. pandoc is quite precise in this case where the error is. BBT doesn't generate keys with spaces, but it will blindly accept whatever key you put into the extra field. BBT can put keys in the extra field on your behalf, but when doing that, it cannot generate keys with spaces, so this key was put there manually, or it was put there by BBT and then edited.
—
Reply to this email directly, view it on GitHub<#2826 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJE4ZERVVAI7CYYG4KOXYJDY4BI23AVCNFSM6AAAAABFZUNG2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGE4DEMJWGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Is the issue resolved? |
Hello, The issue is resolved. It looks like BBT added spaces to the citekey of some of the documents in my Zotero library with extended names. I didn't edit any of them or add spaces in the extra field so I'm not sure how they ended up there if, as you say, BBT can't add keys. Anyway I just had to run the pandoc script a few times to find the entries with spaces and remove them in Zotero. Thanks for your help Sam |
BBT always removes spaces in the last step of key generation. The name (title?) cannot affect that. If you can replicate bbt generating spaces I'd like to know. |
Thanks Emiliano,
I don’t think I can replicate it because I don't know at which point the citation keys were created or altered.
Maybe it was an interaction with another app that added the spaces into the three citations. The issue was across three citations with lead authors with extended names such as de Jong or van Dillen. Not sure if that helps at all.
Thanks for your assistance and guidance,
Sam
On 10 Apr 2024, at 2:36 PM, Emiliano Heyns ***@***.***> wrote:
You don't often get email from ***@***.*** Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Hello,
The issue is resolved. It looks like BBT added spaces to the citekey of some of the documents in my Zotero library with extended names.
BBT always removes spaces in the last step of key generation. The name (title?) cannot affect that. If you can replicate bbt generating spaces I'd like to know.
—
Reply to this email directly, view it on GitHub<#2826 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJE4ZETCUA7IO6EWM5HQPELY4WBCBAVCNFSM6AAAAABFZUNG2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGIYDOMRRHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
The key generation has no relation to the extended name formats - both take the zotero author name (first/last or single part) and generate content (keys or extended names respectively). I don't first generate the extended name and then generate a key from it. But even if I would have, spaces are unconditionally removed from the key at the end of the key generation process. |
Debug log ID
I3J5I8HT-refs-euc/6.7.173-6
What happened?
When using pandoc to create a docx file from a note in Obsidian I get the following error:
Error reading bibliography file /Users/samprovost/Documents/Obsidian Vaults/Obsidian Vault/My Library.bib:
(line 2849, column 13):
unexpected 'J'
The bibliography entry that pandoc is having trouble with is:
It appears the issue is with the author name "de Jong". The J in Jong is (line 2849, column 13).
I am using pandoc version -3.1.12.3-arm64-macOS on an Apple Silicon M1 Max.
Thanks
Sam
The text was updated successfully, but these errors were encountered: