northword / zotero-format-metadata

Linter for Zotero. A plugin for Zotero to format item metadata. Shortcut to set title rich text; set journal abbreviations, university places, and item languages, etc; detect duplicate items.
GNU Affero General Public License v3.0
375 stars 5 forks source link

[Feature Request] Sentence-case 连字符或冒号后单词首字母大写 #85

Closed panmengguan closed 2 months ago

panmengguan commented 10 months ago

Describe the feature

目前 Sentence-case 连字符或冒号后单词的首字母会变成小写,是否应该是大写呢?

Additional context

No response

northword commented 10 months ago

这是一个颇有争议的问题,有人认为需要大写,也有人认为不需要。z7版本内置的逻辑是 better bibtex 插件作者写的,他和 zotero 的开发者 dan 都认可了小写。我回头再查一查有没有规范,实在不行加个选项也行。

panmengguan commented 10 months ago

我是 EE 专业的,IEEE 规范是连字符或冒号后单词的首字母大写。

fredericky123 commented 9 months ago

https://onlinelibrary.wiley.com/doi/10.1002/smj.3553 我们领域都是小写,目前这个连字符前后的单词全被改成了大写 image

northword commented 9 months ago

https://onlinelibrary.wiley.com/doi/10.1002/smj.3553[ ](https://sci-hub.se/10.1002/smj.3553) 我们领域都是小写,目前这个连字符前后的单词全被改成了大写 image

未能复现,你安装的是哪个版本的插件?

fredericky123 commented 9 months ago

[https://onlinelibrary.wiley.com/doi/10.1002/smj.3553 ](https://onlinelibrary.wiley.com/doi/10.1002/smj.3553[ ](https://sci-hub.se/10.1002/smj.3553)) 我们领域都是小写,目前这个连字符前后的单词全被改成了大写 image

未能复现,你安装的是哪个版本的插件?

批量standard format时导致的,不过我现在也不能复现了,下次遇到再说

zepinglee commented 7 months ago

这里的冒号通常是分隔主标题和副标题,按照美国英语的主流习惯是冒号后要大写。

APA https://apastyle.apa.org/style-grammar-guidelines/capitalization/sentence-case

In sentence case, lowercase most words in a title or heading. Capitalize only the following words: ... the first word after a colon, em dash, or end punctuation in a heading

Chicago:

Screenshot 2024-01-01 at 21 38 22

IEEE http://journals.ieeeauthorcenter.ieee.org/wp-content/uploads/sites/7/IEEE_Reference_Guide.pdf p. 7

Screenshot 2024-01-01 at 21 36 32
northword commented 7 months ago

我有点拿不准这个,因为部分样式,即便是 Zotero 里存储的是 冒号后为小写的 Sentence style,CSL 仍可以显示为正确的 冒号后为大写的 Sentence style,例如 APA:

image

那么会不会出现部分样式本就要求 冒号后是小写的 Sentence style ,然而 Zotero 里存了大写,导致输出错误的?

zepinglee commented 7 months ago

我有点拿不准这个,因为部分样式,即便是 Zotero 里存储的是 冒号后为小写的 Sentence style,CSL 仍可以显示为正确的 冒号后为大写的 Sentence style,例如 APA:

那么会不会出现部分样式本就要求 冒号后是小写的 Sentence style ,然而 Zotero 里存了大写,导致输出错误的?

奇怪,我能在 Zotero(7.0.0-beta.54)中复现你的结果,但是用 citeproc-test-runner 在 citeproc-js 中不会产生大写的“Design”。

      + expected - actual
<div class="csl-bib-body">
-  <div class="csl-entry">Yuan, C., Wu, H. B., Xie, Y., &#38; Lou, X. W. (David). (2014). Mixed transition-metal oxides: design, synthesis, and energy-related applications. <i>Angewandte Chemie International Edition</i>, <i>53</i>(6), 1488–1504. https://doi.org/10.1002/anie.201303971</div>
+  <div class="csl-entry">Yuan, C., Wu, H. B., Xie, Y., &#38; Lou, X. W. (David). (2014). Mixed transition-metal oxides: Design, synthesis, and energy-related applications. <i>Angewandte Chemie International Edition</i>, <i>53</i>(6), 1488–1504. https://doi.org/10.1002/anie.201303971</div>
</div>

我怀疑是 Zotero 的这个 style editor 对字段信息作了某些处理。

northword commented 5 months ago

根据 Zotero 官方的意见,存储于 Zotero 标题字段中的句子式大写不需要在冒号或连字符(副标题)后给大写,Zotero 可以自动完成副标题的大写,对于有多个冒号或连字符的,应把主标题填写在“短标题”字段^Zotero文档

Some styles that require sentence case, such as APA, also require that the first letter of the subtitle following a colon also be uppercase (“Age and environmental sustainability: A meta-analysis”). Zotero will automatically capitalize the subtitle for styles that require it. If the title contains multiple colons or dashes, store the main title (before the colon) in the Short Title field to indicate where the subtitle begins.

retorquere: In

“If you don’t actually care for somebody, how can you help them?”: Exploring Young People’s Core Needs in Mental Healthcare—Directions for Improving Service Provision

do you want Exploring capitalized, or not?

dstillman: No. Zotero does that automatically for styles that require it (which implies that some don't): https://www.zotero.org/support/kb/sentence_casing#sentence_case_and_subtitles


@zepinglee 我们在 CSL 的测试上可能需要考虑到类似的问题,我不确定 Zotero 是否还会处理其他字段(目前还没有发现)。


如果没有问题,此 issue 将在跟进 https://github.com/zotero/utilities/pull/31https://github.com/zotero/zotero/issues/3787 后关闭。

zepinglee commented 5 months ago

嗯,那我没问题了。

Zotero 判断的代码应该在这一块。

https://github.com/zotero/zotero/blob/f144f3a72521c6510615cb618321db9b64e9fe88/chrome/content/zotero/xpcom/style.js#L702-L705