SUMMARY When a @string definition starts with whitespace, the whitespace is removed when (or after) the file is loaded. This may be a feature in the general setting but destroys my author lists because I use something like the following to have consistent repeated author names: @string{and = " and "} @string{author1 = "First Author"} @string{author2 = "Second Author"} @article{foo, author = author1 # and # author2, ... } STEPS TO REPRODUCE 1. Make a bib file containing the contents similar to the ones mentioned above. 2. Load the file into kbibtex. 3. Inside kbibtex, watch the BibTeX source of the first macro "and" 4. optionally: Save the file OBSERVED RESULT In step 3: "@string{and = {and }}" In step 4: All your author information is now screwed because of the wrong "and" macro. EXPECTED RESULT In step 3: "@string{and = { and }}" In step 4: Do not screw up author information. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.13.5 KDE Frameworks Version: 5.49.0 Qt Version: 5.11.1 ADDITIONAL INFORMATION -
Please see the latest commit from branch 'bugs/kde401470' in my personal repository clone: https://cgit.kde.org/clones/kbibtex/thomasfischer/kbibtex.git/log/?h=bugs/kde401470 This should fix the problem. To test the code, please see here: https://userbase.kde.org/KBibTeX/Development#Quick_Start_to_Run_KBibTeX_from_Git but invoke the script as follows: bash run-kbibtex.sh https://cgit.kde.org/clones/kbibtex/thomasfischer/kbibtex.git bugs/kde401470
Have you been able to check branch 'bugs/kde401470' and can confirm if the bug has been fixed?
Git commit c43b00e066f255ff9c12a0d930e4be8d8d60f41d by Thomas Fischer. Committed on 06/12/2018 at 19:50. Pushed by thomasfischer into branch 'kbibtex/0.8'. Don't remove leading whitespace in macro If a macro's text starts with one or more leading whitespaces, replace all whitespaces with a single space. M +4 -1 src/io/fileimporterbibtex.cpp https://commits.kde.org/kbibtex/c43b00e066f255ff9c12a0d930e4be8d8d60f41d
Git commit 46aaf2aa0166e2e2d42ccb069ef334b39512fca1 by Thomas Fischer. Committed on 24/12/2018 at 20:38. Pushed by thomasfischer into branch 'master'. Don't remove leading whitespace in macro If a macro's text starts with one or more leading whitespaces, replace all whitespaces with a single space. This commit is a manual forward-port of commit c43b00e066f255f from branch 'kbibtex/0.8'. M +4 -1 src/io/fileimporterbibtex.cpp https://commits.kde.org/kbibtex/46aaf2aa0166e2e2d42ccb069ef334b39512fca1