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

Replacing String Constants During Copy-Paste #10872

Closed
ankitp94 opened this issue Feb 9, 2024 · 6 comments · Fixed by #11037
Closed

Replacing String Constants During Copy-Paste #10872

ankitp94 opened this issue Feb 9, 2024 · 6 comments · Fixed by #11037
Assignees

Comments

@ankitp94
Copy link

ankitp94 commented Feb 9, 2024

Is your suggestion for improvement related to a problem? Please describe.
While copying an entry from the library using Ctrl+C, the string constants are not exported, and there is no automatic option to replace string constants.

Describe the solution you'd like
An option to copy the bib entry that replaces the string constants.

Additional context
Suppose the .bib file is the following:

@String{grl = "Geophys. Res. Lett."}

@article{claudepierre:20a,
    author = {Claudepierre, S. G.},
    journal = grl
}

When I copy it by using ctrl+C and then paste it into my editor, the journal name continues to be grl, whereas the desired behavior would be Geophys. Res. Lett. Thus, I would really appreciate a feature, say by an option in the list below, that allows for copying bib entry while replacing string constants.
image

@andersblomqvist
Copy link
Contributor

Hi, we are a group of university students who want to work on this issue for a week if it's possible.

We are: @andersblomqvist, @real-darth, @JXNCTED, @hanstig, @BillGatesZero

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Feb 27, 2024
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Siedlerchr
Copy link
Member

To fix the issue you need to understand what BibTeX Strings are and how they work, this is explained here:
https://docs.jabref.org/advanced/strings

@koppor
Copy link
Member

koppor commented Feb 27, 2024

When copying a BibEntry in the clipboard, also referenced @string constants should be put into the clipboard. On paste in JabRef, it should be checked, if there are @string constants contained. If yes, add them to the library. If a string constant already exists, ignore it (and log). One could also implement a "merge dialog" which offers choosing which @string content to take. Similar to the merge entriesd dialog (e..g, triggered when pasting the same entry twice).

@Siedlerchr
Copy link
Member

@ankitp94 The feature is now available in the latest development version
https://builds.jabref.org/main/

@ankitp94
Copy link
Author

Thank you @Siedlerchr and everyone who contributed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment