retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.41k stars 289 forks source link

Three dashes in extra field for generating markdown files from bibtex #2849

Closed juancarloscastillo closed 7 months ago

juancarloscastillo commented 7 months ago

Debug log ID


What happened?

I have a problem with the newest version of BBT regarding including three dahes (---). in the extra field. Before (at least with version 6.7.132) when generating the bibtex file it reflected there the line breaks before and after them, but in the new version it eliminates the line breaks. The need for the line breaks it relates with a script I use that generates markdown files from the bibtex entries (https://jc-castillo.com/post/zotero-academic/) , therefore I need the --- in a different line in the bibtex, as it is specified in the extra field. I installed the previous BBT version and it works fine, but I hope this could also work in the current and future versions.

This is how it is rendered with the previous version, reflecting the extra field (annotation in bibtex) correctly:

@inproceedings{castillo_authoritarianism_2011a,
  title = {Authoritarianism, social dominance, and trust in public institutions.},
  booktitle = {Annual Scientific Meeting of the International Society of Political Psychology – ISPP},
  author = {Castillo, J. and Miranda, D. and Torres, P.},
  year = {2011},
  month = jul,
  address = {Bilgi University, Istambul},
  keywords = {legitimacy ideology Chile},
  annotation = {url\_slides: "lisa-coes.github.io/"
---
This is a presentation funded by ANID 
}
}

And here with the newest one, eliminating the line breaks before and after:

@inproceedings{castillo_authoritarianism_2011a,
  title = {Authoritarianism, social dominance, and trust in public institutions.},
  booktitle = {Annual Scientific Meeting of the International Society of Political Psychology – ISPP},
  author = {Castillo, J. and Miranda, D. and Torres, P.},
  year = {2011},
  month = jul,
  address = {Bilgi University, Istambul},
  keywords = {legitimacy ideology Chile},
  annotation = {url\_slides: "lisa-coes.github.io"---This is a presentation funded by ANID 
}
}

Thanks in advance, wonderful work with this Zotero add-on!

github-actions[bot] commented 7 months ago

Hello there @juancarloscastillo,

Hope you're doing well! @retorquere is here to help you get the most out of your experience with Better BibTeX. To make sure he can assist you effectively, he kindly asks for your cooperation in providing a debug log – it's like giving him the key to understanding and solving the puzzle!

Getting your debug log is a breeze and will save us both time in getting your problem resolved or the new feature you'd like implemented. Trust me, it's way quicker than discussing why it's important. :smiley:

How to Share Your Debug Log:

  1. If the issue involves specific references, citekey generation, or exports, just right-click on the relevant item(s) and choose "Better BibTeX -> Submit Better BibTeX debug log" from the menu.

  2. For other issues, follow these simple steps:

    • Restart Zotero with debugging enabled (Help -> Debug Output Logging -> Restart with logging enabled).
    • Reproduce the problem.
    • Select "Send Better BibTeX debug report..." from the help menu.

Once you hit that submit button, you'll get a special red debug ID. Just share that with @retorquere in this issue thread. If the question is regarding an export, don't forget to include what you see exported and what you expected.

By sharing your debug log, you're giving @retorquere a clearer picture of your setup and the items causing the issue. It's like a superhero cape for him – he can swoop in and tackle the problem much faster.

We totally get that your time is valuable, and we appreciate your effort in helping @retorquere help you. You might be surprised at how much this simple step speeds up the whole process.

Thanks a bunch!

PS: If the Debug Log menu does not appear, or it does not send the debug log

A fallback option is available under "Help" > "Send debug log to file.io".

retorquere commented 7 months ago

You're asking my time but can't be bothered to make a few mouse clicks to make that time spent efficiently, or even write out why you think (wrongly) that I don't need a debug log.

The issue will automatically reopen when you post a debug log.

juancarloscastillo commented 7 months ago

Actually, I took the time for the few mouse clicks but the program freezed and I could not move forward in generating the log, therefore I tried to detail the issue as clear as possible. After your message, I thought that maybe this was because I had to install a previous version in order to solve my issue; so, I installed again the new version and the debug log worked well.

The debug log ID is 2KZZJD5R-refs-euc/6.7.177-6

I uploaded the produced files:

items.json debug.txt

Thanks in advance for your time.

retorquere commented 7 months ago

Actually, I took the time for the few mouse clicks but the program freezed and I could not move forward in generating the log

Which is a more useful explanation than ---. If the debug log doesn't work, I want to fix that.

I uploaded the produced files:

no need, that's what the debug log is for. I have a toolchain that (among other things) makes ready-to-run testcases from debug log IDs so that I don't have to copy-paste, download, put in the right place etc. All sources of errors.

I agree that what is put in annotation isn't really right for what's in your extra field. I'm sort of torn on what the right output would be, or even whether annotation is the right field for it; I started out with the idea that extra was for lightweight notes, but really notes are for notes, and extra is more for custom fields. In any case, the following gives output that renders what is in your extra field:

@inproceedings{castillo_authoritarianism_2011,
  title = {Authoritarianism, social dominance, and trust in public institutions.},
  author = {Castillo, J. and Miranda, D. and Torres, P.},
  date = {2011-07},
  location = {Bilgi University, Istambul},
  eventtitle = {Annual Scientific Meeting of the International Society of Political Psychology  ISPP},
  keywords = {legitimacy ideology Chile},
  annotation = {url\_slides: "lisa-coes.github.io/"\\
---\\
This is a presentation funded by ANID}
}

but from your description, you want single linebreaks to show up as-is, which as far as LaTeX is concerned is the same as a space, which is equivalent to the current output.

github-actions[bot] commented 7 months ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.177.2849.6095 ("compromises all around")

This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.177.2849.6095, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 7 months ago

I'd appreciate feedback on the change.

retorquere commented 7 months ago

Did it previously have back-ticks around the triple-dash? I'm not sure how that ever came about.

juancarloscastillo commented 7 months ago

Previously there were no back-ticks around the triple dash, but now I am adding the backslashes in the extra field and I can see them in the bibtex, then you very much.

retorquere commented 7 months ago

Previously there were no back-ticks around the triple dash,

The reason I asked is that in your original message, you said you were previously getting

  annotation = {url\_slides: "lisa-coes.github.io/"
`---`
This is a presentation funded by ANID 
}

and I can't explain how those back-ticks around the --- got there.

but now I am adding the backslashes in the extra field and I can see them in the bibtex

That also shouldn't be the case, if you just take the item you sent in 2KZZJD5R-refs-euc/6.7.177-6, you should be getting

  annotation = {url\_slides: "lisa-coes.github.io/"\\
---\\
This is a presentation funded by ANID}

without you adding backslahses in the extra field. If you are adding backslashes in the extra field, you should see those show up as \textbackslash.

juancarloscastillo commented 7 months ago

I added the backticks to the --- because otherwise they were transformed into a line in the preview of the message, but I get the three dashed without backticks. I checked again and actually if I add the backslashes I get \textbackslash. If I understand well: the line breaks in the extra field should appear as \ in the annotation field in the bibtex, right? I tried again (with the last version of BBT) and they do not appear, what I get is:

  annotation = {url\_slides: "lisa-coes.github.io/" --- This is a presentation funded by ANID}
}
retorquere commented 7 months ago

I added the backticks to the --- because otherwise they were transformed into a line in the preview of the message, but I get the three dashed without backticks.

Ah OK I see.

If I understand well: the line breaks in the extra field should appear as \ in the annotation field in the bibtex, right?

single linebreaks should show up as \\, multiple linebreaks as two linebreaks.

I tried again (with the last version of BBT) and they do not appear, what I get is:

Latest as in latest release? Or the latest version dropped here? If latest release -- please try latest version dropped here. If latest version dropped here -- please send a debug log.

juancarloscastillo commented 7 months ago

Now I tried with the latest-latest and it works perfectly. Thank you very much.