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

Wrapping of fields when saving a BibTeX library is not working #42

Open
2 tasks done
magsilva opened this issue Jan 9, 2025 · 0 comments
Open
2 tasks done

Wrapping of fields when saving a BibTeX library is not working #42

magsilva opened this issue Jan 9, 2025 · 0 comments

Comments

@magsilva
Copy link
Owner

magsilva commented Jan 9, 2025

JabRef version

5.15 (latest release)

Operating system

GNU / Linux

Details on version and operating system

Fedora 41

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Open a BibTeX library.
  2. Create a BibTeX entry.
  3. Add a long text to a field which would not be wrapped (review, quotation, note).
  4. Save the BibTeX library to a file.
  5. Open the file with a text editor and check the width the lines. There is no wrapped line!

Appendix

This probably was observed when adding an option to disable wrapping for fields in BibTeX. Unfortunately, there is confusion in JabRef regarding wrapping and multiline, considering it synonymous. However, there are situations where you want to enable wrapping for multiline fields (for instance, when the field allows "formatted" text), and there are situations where you do not want to wrap long lines (for instance, for fields such as url). Actually, it is up to the user whether wrapping should be enabled.

However, although there is a method for wrapping a string (StringUtil.wrap), since commit dcf9047 (import citavi knowledge items (JabRef#9033)) the method is no more used. Before that, it was called from just one method: FieldWriter.writeStringLabel (commit 14e9790, when the method FieldWriter.putIn was inlined into FileWriter.writeStringLabel): String wrappedLine = StringUtil.wrap(line, preferences.getLineLength(), OS.NEWLINE);. For some reason, the call to StringUtil.wrap was removed when fixing bug 9025 with pull request 9033.

Just for reference, originally FileWriter was named LatexFieldFormatter. The refactoring (change of class name) was in commit fdfad7c, for pull request 5838.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant