jgm / pandoc-citeproc

Library and executable for using citeproc with pandoc
BSD 3-Clause "New" or "Revised" License
291 stars 61 forks source link

Camel case #273

Closed njbart closed 7 years ago

njbart commented 7 years ago

Following up from https://groups.google.com/d/msg/pandoc-discuss/EdhQCWYRVGU/zZS_yxlPEAAJ:

I think the conversion 'iKettle' to 'IKettle' is a bug.

http://docs.citationstyles.org/en/stable/specification.html#title-case-conversion says:

Title case conversion (with text-case set to “title”) for English-language items is performed by: … 2. For lower or mixed case strings, the first character of each lowercase word is capitalized. The case of words in mixed or uppercase stays the same. [my emph.]

jgm commented 7 years ago

OK, so we need to treat mixed case the same as upper case and protect.

jgm commented 7 years ago

Actually this rule is pretty hard to understand: 1 seems to say that in an all-uppercase word, only the first letter remains uppercase, while 2 seems to say that things stay the same. Do you know how citeproc-js actually behaves?

njbart commented 7 years ago

I found item 1 ("For uppercase strings, the first character of each word remains capitalized. All other letters are lowercased.") confusing, too. My best guess is that this is meant to refer to titles that are entered exclusively in uppercase. But citeproc-js leaves a title such as "BLAH BLAH BLAH" unchanged, too.

jgm commented 7 years ago

Hm, so is your impression that we should leave all-uppercase strings alone in the titlecase transformation? Contrary to what (1) seems to say explicitly?

+++ Nick Bart [Jan 13 17 09:12 ]:

I found item 1 ("For uppercase strings, the first character of each word remains capitalized. All other letters are lowercased.") confusing, too. My best guess is that this is meant to refer to titles that are entered exclusively in uppercase. But citeproc-js leaves a title such as "BLAH BLAH BLAH" unchanged, too.

— You are receiving this because you modified the open/close state. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

  1. https://github.com/jgm/pandoc-citeproc/issues/273#issuecomment-272492178
  2. https://github.com/notifications/unsubscribe-auth/AAAL5C2-0hGudenaLKuNUYCsXr2sJdiSks5rR7BpgaJpZM4Lh_R-
njbart commented 7 years ago

Frankly, I'm not too sure. There are indeed quite a few entries in crossref and other databases that contain titles in all-caps, and these, if used uncurated, would benefit if pandoc implemented the "item 1" rule. On the other hand, I would argue that for obtaining professional-quality output, curating your own database is necessary anyway, and while you're at it, transforming an all-caps title to sentence case is no big deal. Also, I couldn't exclude the possibility that occasionally a title is indeed meant to appear in all-caps. All in all, I guess for now I wouldn't start implementing the "item 1" rule in pandoc, unless users start complaining, that is, or citeproc-js introduces it.