hans / obsidian-citation-plugin

Obsidian plugin which integrates your academic reference manager with the Obsidian editor. Search your references from within Obsidian and automatically create and reference literature notes for papers and books.
MIT License
1.04k stars 76 forks source link

Plugin changes uppercase to lowercase in title #265

Open Chris-B73 opened 4 months ago

Chris-B73 commented 4 months ago

Describe the bug Using the plugin’s template changes uppercase words to lowercase.

To Reproduce Source is a BibTeX file created by JabRef. It contains:

title = {Politik für eine nachhaltigere Ernährung: Eine integrierte Ernährungspolitik entwickeln und faire Ernährungsumgebungen gestalten}

The literature note content template contains:

title: "{{title}}"

After pressing “ctrl + shift + o” the newly created literature note contains:

title: "Politik für eine nachhaltigere ernährung: Eine integrierte ernährungspolitik entwickeln und faire ernährungsumgebungen gestalten"

The words “Ernährung”, “Ernährungspolitik” und “Ernährungsumgebungen” changed to lowercase.

Platform

orionpilot commented 4 months ago

This is not a Citations bug but a BibTex feature, see here and #191. There is more information about this online, but you can force capitalization by {wrapping} the word or letter.

Chris-B73 commented 4 months ago

Thanks for your answer!

Since I’m not a programmer, I don't understand the code in main.js. How does Citations use/invoke BibTeX? And does it use a BibTeX style file or a BibLaTeX style? Because they handle capitalization.

I use LaTeX/BibTeX since the late 90s. With the BibTeX style files or BibLaTeX styles I use(d), I never saw this happen in any of my compiled bibliographies—and I did not wrap words or letters in {}.

It might be a less invasive solution for Citations users to just change the bst file Citations uses (instead of changing thousands of references).

orionpilot commented 4 months ago

I also don't understand the main.js code, so I've been trying to find workarounds with the features that already exist. You bring up a good point regarding the bst, as I don't know what bst the plugin uses to handle capitalization. I agree it would be best not to have to change thousands of references.

In my (much more limited) usage of LaTeX, I have seen cases where the capitalization in the compiled bibliographies does differ from the entry. Therefore I did have to force capitalizations with {} for some entries. I have also seen some entries which had {} automatically at the right words when I imported the reference, so it would depend how authors had written the initial entry. Maybe this has contributed to you not having to manually add some {}.

I know that exporting from Obsidian (using pandoc or other plugins), you can decide on the bibliography style, but it sounds like you are looking to set a style when you import to Obsidian. I am not sure that changing Citations itself will be easy and quick, so I've been thinking that a solution that takes the {{title}} from the plugin, and updates that string instead would be worth it to consider e.g., other plugins may help or writing a custom script. For example, accessing individual keywords as listed in the bibtex entry in #61.