jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Add the option to select a BST style for Preview

Open Siedlerchr opened this issue 2 years ago • 12 comments

JabRef offers preview based on so called BST styles. However, currently there is no option to select them in the UI.

Things needed.

  • Add the BST styles to the preview layout list
  • Add an option to configure/add styles. Add a single style or configure a directory to load them from
  • Test if they can be selected and rendered

Additional context Bst files can be found in https://www.ctan.org/topic/bibtex-sty

Codewise: PreviewTabViewModel#setValues needs to check for BstPreviewLayout

Siedlerchr avatar Mar 25 '24 19:03 Siedlerchr

After this is implemented, a next step is following:

In case a LaTeX directory is set, check that directory for .bst file. If exists: use. If not exists: check for \bibliographystyle and then use kpeswitch to find the path. Maybe, one even needs to check the \documentclass.

(This can be hard but very user-friendly)

koppor avatar Mar 25 '24 21:03 koppor

Shall I modify the setValues() method in the PreviewTabViewModel.java file to fetch and add BST styles from https://www.ctan.org/topic/bibtex-sty to the availableListProperty also what files need to be changed or dependencies need to be used . Is an arraylist of bststyles needed which will then be used to create previewlayout for availableListProperty . How do i develop a better understanding for the given issue

sahilsekr42 avatar Mar 26 '24 12:03 sahilsekr42

  1. Add a button to the UI so that the user can select BST files on their computer
  2. Add the selected bst files to the available styles
  3. Adjust the check in the setValues for BstPreviewLayout
  4. Test

Siedlerchr avatar Mar 26 '24 13:03 Siedlerchr

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.

github-actions[bot] avatar Mar 26 '24 14:03 github-actions[bot]

Code hint: https://github.com/JabRef/jabref/blob/main/src/test/java/org/jabref/logic/bst/BstVMTest.java shows the usage of JabRefs functionality to transform a BibEntrty to text using a bst file

koppor avatar Mar 26 '24 14:03 koppor

I've tried to create the button and also checked the rendering in preview. Also I'm planning to implement the feature to configure bst styles from directory . please check if this is the way implementation needs to be done else provide feedback on changes to be made

https://github.com/JabRef/jabref/assets/100865986/7e95c9b3-4c98-487c-a731-5889cf73426b

sahilsekr42 avatar Mar 30 '24 17:03 sahilsekr42

@Siedlerchr @koppor please give feedback

sahilsekr42 avatar Mar 30 '24 17:03 sahilsekr42

That video looks already good. Please go ahead with the PR that makes it easier to check the code

sahilsekr42 @.***> schrieb am Sa., 30. März 2024, 18:02:

I've tried to create the button and also checked the rendering in preview. Also I'm planning to implement the feature to configure bst styles from directory . please check if this is the way implementation needs to be done else provide feedback on changes to be made

https://github.com/JabRef/jabref/assets/100865986/7e95c9b3-4c98-487c-a731-5889cf73426b

— Reply to this email directly, view it on GitHub https://github.com/JabRef/jabref/issues/11102#issuecomment-2028290837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOFZCCAWLV7AX4J76QFJDY23VY3AVCNFSM6AAAAABFHTJ4L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGI4TAOBTG4 . You are receiving this because you authored the thread.Message ID: @.***>

Siedlerchr avatar Mar 30 '24 17:03 Siedlerchr

@Siedlerchr @koppor please give feedback

We see the selection possibility of .bst files. What is missing

  1. Usage of .bst in the preview in the entry editor
  2. Mixing .bst and CSL preview styles

Regarding 2., maybe two tabs "CSL" and "BST" would make sense. When "CSL" is selected, the list as currently existing is used, when "BST" is selected, the known .bst files (as the video shows) are used. The right list is a mix of .csl and .bst

koppor avatar Mar 30 '24 20:03 koppor

@sahilsekr42 hey, how's it going? Do you plan to put up a PR (for however-much has been done)? It'll be really helpful for other people if they want to take it from there (if you are busy). Otherwise, people will review it and help you finish it.

subhramit avatar Apr 17 '24 20:04 subhramit

I will raise a pr by tomorrow for review ( sorry for the delay)

sahilsekr42 avatar Apr 19 '24 13:04 sahilsekr42

please look into #11229. Also test checks for one of the commits in one of the files is failing and i don't know why

sahilsekr42 avatar Apr 21 '24 05:04 sahilsekr42