Case protection in BibTeX export format

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: Case protection in BibTeX export format

Post by Dellu »

iandol wrote: Tue May 10, 2022 4:52 am Anyway, having this as an option is fine, although if you don't want case protection you can just NOT put capitalised words into the preferences list so then a prefs toggle becomes unnecessary...
That is true. Since it is implemented in the preferences, I am totally happy about it.
lyndondrake
Posts: 51
Joined: Sat Jul 04, 2015 3:36 am

Re: Case protection in BibTeX export format

Post by lyndondrake »

Jon wrote: Tue May 10, 2022 7:40 am Sorry about that. The setting was actually saved but the preferences UI wasn't being set properly. Please download 14.0.8 again, this has been fixed in a silent update.
Thanks, that has fixed it for me. Really appreciate this as it make the BibTeX support much better.
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Re: Case protection in BibTeX export format

Post by larilela »

I have a diferent issue with case protection: I write primarily in German where all nouns are capitalized and thus want my bibliography to preserve the original capitalization from my BE library. I've checked the box "Bracket 'don't change case' words" in the preferences (using the update BE version), but that's not doing anything. I'm guessing this is because this option only brackets specific words, as Ian suggested. Is that correct and if yes, which words / how can they be specified? On another note I am wondering whether is this really the best way to go about preserving capitalization globally. I agree with Dellu that bibliography styles should handle such global capitalization e.g. when typesetting via LaTeX. But I also use pandoc, e.g. Chris grieser's Alfred Bibtex Citation Picker. When I paste fully formated bibliographic entries via the picker, nouns are never capitalized (hence Chris suggested I use curly brackets for all my titles / nouns). Any advice would be much appreciated
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

The words are listed in the Scan & Bib tab. But you can't enter all the nouns you use.

Try editing the BibTeX format to output braces around your titles. I think that will work for you (can't test now, I'm out of town).

Jon
Sonny Software
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

I'm sorry for being late to the party.

The feature is great as it is, but I would like to suggest one change. At the moment, words like "mRNA" or "iPhone" are not protected with curly braces, even if they are in the "Don't change case" -list (because they don't start with an uppercase letter). As a result (at least in my latex setup) they become "mrna" and" iphone". A possible solution would be to protect not only all words from that list which begin with an uppercase letter, but all words that contain an uppercase letter.

For my current setup that would be enough and I would be grateful for this change. However, if somebody is using a .bib-file with CSL (via pandoc-citeproc), words that should remain lowercase should be protected. The pandoc documentation gives the following example [1]:

Code: Select all

title = {Spin Wave Dispersion on the {nm} Scale} 
Hence, one could even suggest to protect all words in the "Don't change case"-list with braces, regardless whether they contain an uppercase letter or not. I see the little annoyance that a few lowercase words from that list are protected that don't need to be protected, but as far as I can see that's not doing any harm in the output: They stay lower case in any case. As I'm not using CSL at the moment, I'm undecided on this part.

[1]: https://pandoc.org/MANUAL.html#capitalization-in-titles
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

My tests show that mRNA is protected by curly brackets if it's entered in the "don't change case" field in preferences. Did you check the "Bracket "don't change case" words in title" option in BibTeX preferences?

Jon
Sonny Software
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

Yes, I did. I also have Bibtex markup selected.

This is an example title:
"The structure of the mRNA and its role in Paris"

With title case this becomes:
title = {The Structure of the mRNA and Its Role in {Paris}},

With sentence case:
title = {The structure of the mRNA and its role in {Paris}},

With "as entered":
title = {The Structure of the mRNA and its role in Paris},

(I've also added "Paris" to the list.)
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

Hm, I don't know why I saw it before, but you're right. I've fixed this for the next update. Now you'll get

"The Structure {of} the {mRNA} {and} Its Role {in} {Paris}}"

BTW, I was already considering the option to protect any word that has 2 caps (not 1) automatically. That would protect words like EU and H|2|O (| = subscript).

Jon
Sonny Software
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

I have to admit, the longer I look at this, the more I dislike the unnecessary protection of {of}, {and}, and {in}. It just looks wrong to a Latex user, I guess. What do you think of my first suggestion to protect all words from the "do not change case" list that contain at least one capital letter?

That would result in

"The Structure of the {mRNA} and Its Role in {Paris}}"

I'm sorry for the little back and forth.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

I think it's ugly, too, but that's how the rules work now. I'd consider changing the feature to only bracket reserved words that have at least one capital letter. Does any other BibTeX user reading this have an opinion? If so, please post.

What do you think of adding adding another option to the "don't change" behavior, to leave any word with 2 caps or more as is. This would not be BibTeX-specific, but would apply to normal use as well (normal meaning what non-BibTeX users do). It would be a separate checkbox in preferences. If checked, Bookends would first examine a word to see if it's the don't change list, and if it's not check to see if there are 2 or more caps. The advantage is that if you're in a speciality with lots of acronyms you don't have to add each one individually to the don't change list.

Jon
Sonny Software
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

P.S. I'm rolling back the change for now, and see what to after the upcoming update.

Jon
Sonny Software
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

Jon wrote: Fri Feb 03, 2023 10:22 am I think it's ugly, too, but that's how the rules work now.
Just to make sure there is no misunderstanding because of my first post. When using bib(la)tex (or pandoc with the --biblatex option), there is no rule or need to enclose words containing only lowercase letters in curly brackets (exception: a word with only lowercase letters, which is the first word of a title and should remain lowercase...). Rather the opposite is true: it would be considered weird (or ugly :wink: ). Only if you use the .bib file with pandoc and the --citeproc option, this becomes necessary. And even then, protecting standard words like "and" or "in" would be considered bad style, I think (I personally don't use it, I use pandoc --biblatex when I use pandoc).
I'd consider changing the feature to only bracket reserved words that have at least one capital letter. Does any other BibTeX user reading this have an opinion? If so, please post.

What do you think of adding adding another option to the "don't change" behavior, to leave any word with 2 caps or more as is. This would not be BibTeX-specific, but would apply to normal use as well (normal meaning what non-BibTeX users do). It would be a separate checkbox in preferences. If checked, Bookends would first examine a word to see if it's the don't change list, and if it's not check to see if there are 2 or more caps. The advantage is that if you're in a speciality with lots of acronyms you don't have to add each one individually to the don't change list.
To me, this sounds like a great improvement to the current "bracket acronyms" option.
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

One addition: the use of {and}, {in} , {if}, {of} etc. has the disadvantage that it prevents Bibtex from converting the title to all caps when required by the bibliography style.
Euler1
Posts: 8
Joined: Wed Jan 18, 2023 6:06 pm

Re: Case protection in BibTeX export format

Post by Euler1 »

What do you think of adding adding another option to the "don't change" behavior, to leave any word with 2 caps or more as is. This would not be BibTeX-specific, but would apply to normal use as well (normal meaning what non-BibTeX users do). It would be a separate checkbox in preferences. If checked, Bookends would first examine a word to see if it's the don't change list, and if it's not check to see if there are 2 or more caps. The advantage is that if you're in a speciality with lots of acronyms you don't have to add each one individually to the don't change list.
I’ve been thinking about this and would be interested in your opinions about this variation: How about applying this procedure to all words that contain at least 1 capital letter after removing their first character? This would include all words with 2 or more caps (“mRNA”, “macOS”) but also words like “iPhone”. It would still not apply to “Paris”, because there is no capital letter left after removing the P.

In addition to this possible new option, bracketing all words from the Don”t change case list” which contain at least one capital letter, no matter where, still sounds to me like a good extension of the current behavior. But again I would be interested in other opinions.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Case protection in BibTeX export format

Post by Jon »

This is what has been implemented for the next release. I think these changes cover the bases. If you want to revisit this please wait until the next release is out and you've had time to use it.

For the exempted word list:

The preferences BibTeX option "Bracket "don't change case" will bracket words entered in the Scan & Bib -> Sentence & Title Case list containing at least one capital letter, regardless of where it appears. For example, {mRNA}, {iPhone}, and {Paris}.

A new option:

Option to exempt Title words with multiple capital letters when applying Title Case or Sentence case. In the preferences Scan & Bib tab there is the option to leave words with 2 or more capital letters as is. If checked, acronyms like UK and chemical symbols like H2O will retain their case when the Title is changed to Title Case or Sentence case. This is in addition to the list of words that should always appear in the specified case. The new option allows you to exclude an entire class of words (those with multiple capital letters) without having to enter them individually in the "don't change" list.

Jon
Sonny Software
Post Reply