Skip to content
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

Add "Copy as Better BibTeX" in the right-click menu of items #2898

Closed
mjthoraval opened this issue Jun 8, 2024 · 27 comments
Closed

Add "Copy as Better BibTeX" in the right-click menu of items #2898

mjthoraval opened this issue Jun 8, 2024 · 27 comments

Comments

@mjthoraval
Copy link

Debug log ID

BBUNRVFU-refs-euc/6.7.203.2887.6397-7

What happened?

It would be nice if BBT could add a "Copy as Better BibTeX" option in the right-click menu on an item.
There are already other plugins doing that, as discussed here, with the relevant code here. But they are quite technical. And this is a common request in the forums for BBT users. So a default integration in BBT would probably be useful for new Zotero users.

As the other plugins are not focused on this aspect, they do not propose a nice interface to select an export format.
I would find it easier to have a simple dropdown menu in the BBT settings.

@deardeer7
Copy link

Zotero本身已经有快速复制:Ctrl + Shift + C

@retorquere
Copy link
Owner

You can also double-click the key in the item pane section and Cmd-C. But a build that adds the menu entry will drop here shortly.

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.218.2898.6710 ("key to clipboard")

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.218.2898.6710, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@retorquere
Copy link
Owner

That build has the change. If you can confirm it does what you need, I can merge it into a new release.

@mjthoraval
Copy link
Author

Sorry for the late reply.
I am getting this error when trying to add the test build:
image

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.225.6833 ("upgrades")

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.225.6833, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

Thank you. I understand that this build adds the menu option "Copy key to clipboard".
This is nice, but I was more referring to the Quick Copy format "Better BibTeX":
image

It is possible to change the Quick Copy settings to switch to that format and then use the normal Quick Copy shortcut. But I usually prefer using the Quick Copy functionality for other purposes, to simply get the formatted citation of an item. And switching between the formats in the settings every time is quite painful.

Would it be possible to get this format directly from a right-click and add the ability to assign a shortcut to it?
Thank you very much!

@retorquere
Copy link
Owner

Build incoming for the change to quick-copy, but I don't deal with shortcut keys, Zutilo does that for Zotero 6, and Zotero Tags and Actions does it for Zotero 7 IIRC.

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.225.6835 ("quick-copy to clipboard")

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.225.6835, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

The "Quick copy to clipboard" is not working for me.
It triggers the following error:
[JavaScript Error: "TypeError: this.ZoteroPane is undefined" {file: "jar:file:///C:/Users/mjthoraval/AppData/Roaming/Zotero/Zotero/Profiles/4o6yeo4t.default/extensions/[email protected]!/content/better-bibtex.js" line: 117639}]

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.225.6836 ("alias ZoteroPane")

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.225.6836, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

This version still copies the citation key instead of the bibtex of the item.
Should I change something somewhere?

@retorquere
Copy link
Owner

I can't tell for sure without a debug log, but if I'd have to guess I would say your BBT quickcopy format is set to Cite Keys.

@mjthoraval
Copy link
Author

The Quick-Copy section in the settings of BBT look like this:
image

But my understanding is that this only applies when I am using the "Better BibTeX Citation Key Quick Copy" option in the Quick Copy settings of Zotero:

Used for drag-and-drop/quick copy using Better BibTeX citation keys.

https://retorque.re/zotero-better-bibtex/installation/preferences/export/index.html

I do not want to use the "Better BibTeX Citation Key Quick Copy" option, but just the "Better BibTeX" option in the Quick Copy settings of Zotero. So just to obtain the BibTeX of the item. This should have nothing to do with the "Quick Copy" section of the Better BibTeX settings as I understand?

image

Maybe some rewording would be necessary to clarify the differences?

@retorquere
Copy link
Owner

Ah. That doesn't seem like a good idea to me, really; I don't see a good reason to prefer Better BibTeX over Better BibLaTeX here. Maybe the Tags & Actions plugin can provide a shortcut? I'd be happy to provide an action to call.

@mjthoraval
Copy link
Author

mjthoraval commented Aug 28, 2024

It is already possible to do this with the Actions & Tags plugin, as detailed in the (very long) post I have linked at the top of this discussion.
My point here was just to say that setting this up requires 2 plugins, some script and extracting information from the advanced settings of Zotero, as well as understanding the concepts of Quick Copy, Translators, ... I have tried a few times explaining this to new Zotero users using LaTeX. But the final reply is always that they are not going to spend so much time for such a basic functionality.

A basic LaTeX user simply needs to have access to the BibTeX of the entries to write articles, but also the formatted citations to put in emails or quick reports. Both functionalities are provided by the Quick Copy functionality of Zotero, but it can only do one at a time. And it is very painful to switch between formats.
Most new users trying to use Zotero for the first time are just trying to get the formatted information from a right-click on the item. This is why I thought that integrating this in the right-click menu directly from the BBT plugin would make it easier for new users to discover this simple operation.

I am open to suggestions if you think that there are easier ways to achieve this for new users...

I don't see a good reason to prefer Better BibTeX over Better BibLaTeX here.

This could be decided from the settings of BBT.

@retorquere
Copy link
Owner

A basic LaTeX user simply needs to have access to the BibTeX of the entries to write articles

But wouldn't a basic TeX user use biblatex these days?

A new build will drop in a bit that adds both. I don't think adding more preferences to BBT for this is the right approach. It's hard to find the right preference in the BBT prefs already.

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.225.6837 ("clip both")

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.225.6837, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

mjthoraval commented Aug 28, 2024

Thank you. It is working nicely.
Just a small issue to solve on the text in the menu:

image

I would put an emoji in front of the text in the menus to identify them easily, but that is probably just personal taste.

But wouldn't a basic TeX user use biblatex these days?

In my field (Fluid Mechanics), the main journals all provide a LaTeX template using BibTeX (REVTeX for APS and AIP, Journal of Fluid Mechanics, ...). I haven't seen any BibLaTeX alternatives. So a PhD student in my field would write in LaTeX with BibTeX.

@retorquere
Copy link
Owner

I would put an emoji in front of the text in the menus to identify them easily

The full list of emojis is here, feel free to make suggestions.

@mjthoraval
Copy link
Author

I would put the B button (blood type) (n° 1568, 🅱) or other B letters (🅑, Ⓑ, 🄱, 🇧, ⓑ, ...).
But a few others could also work:

  • card index: 1316, 📇
  • clipboard: 1320, 📋
  • page facing up: 1272, 📄

@retorquere
Copy link
Owner

retorquere commented Aug 29, 2024

I have no preference between these. If you pick one I can see how it turns out in the UI. I'm not much of an UI person.

@mjthoraval
Copy link
Author

Then the B button (blood type) (n° 1568, 🅱) is good. Thank you.

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.226.6866 ("b")

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.226.6866, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

mjthoraval commented Aug 29, 2024

I am still seeing the same as in the previous version. The functionality is working, but the text displayed in the menu is not correct:
image

Debug log ID: ME7J28F3-euc/6.7.226.6866-7

Copy link

🤖 this is your friendly neighborhood build bot announcing test build 6.7.226.6876 ("l10n")

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.226.6876, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

@mjthoraval
Copy link
Author

Thank you. It is working fine now:
image

retorquere added a commit that referenced this issue Aug 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants