capitalize-first

It seems that capitalize-first should just capitalize the first letter
and leave the rest of the string alone. What it does instead is
lowercases the rest of the string including any proper nouns or
initials.

For example, genre in Chicago bibliography should be capitalized, so I
get “memorandum” in a citation, but “Memorandum” in bibliography.
Unfortunately, in bibliography I also get “Ph.d. diss.” instead of
"Ph.D. diss."

Is this a bug? Or perhaps I could use another text-transform command
that would only capitalize the first letter?

Thanks,
Elena

Elena Razlogova wrote:

It seems that capitalize-first should just capitalize the first letter
and leave the rest of the string alone. What it does instead is
lowercases the rest of the string including any proper nouns or
initials.

For example, genre in Chicago bibliography should be capitalized, so I
get “memorandum” in a citation, but “Memorandum” in bibliography.
Unfortunately, in bibliography I also get “Ph.d. diss.” instead of
“Ph.D. diss.”

Is this a bug? Or perhaps I could use another text-transform command
that would only capitalize the first letter?

I suppose in some sense that’s a bug, but it’s rather difficult to write
a parser that knows how to handle exceptions like proper names and
abbreviations. This is the reason why BibTeX, for example, requires
explicit encoding of them.

It seems to me for the immediate issue the CSL style ought not to
include any explicit encoding for this, and that you should rely on
Zotero (or the user) to provide the correct string?

Bruce

Elena Razlogova wrote:

It seems that capitalize-first should just capitalize the first
letter
and leave the rest of the string alone. What it does instead is
lowercases the rest of the string including any proper nouns or
initials.

For example, genre in Chicago bibliography should be capitalized,
so I
get “memorandum” in a citation, but “Memorandum” in bibliography.
Unfortunately, in bibliography I also get “Ph.d. diss.” instead of
“Ph.D. diss.”

Is this a bug? Or perhaps I could use another text-transform command
that would only capitalize the first letter?

I suppose in some sense that’s a bug, but it’s rather difficult to
write
a parser that knows how to handle exceptions like proper names and
abbreviations. This is the reason why BibTeX, for example, requires
explicit encoding of them.

It seems to me for the immediate issue the CSL style ought not to
include any explicit encoding for this, and that you should rely on
Zotero (or the user) to provide the correct string?

Yes, sentence case is difficult and there is a ticket for this:

https://www.zotero.org/trac/ticket/832

But it should be easy to have a text-transform function that just
capitalizes the first letter of a string and displays the rest as it
was entered originally. This is all that’s needed for such citation
elements as genre, location in archive, etc. Can we add such a function?

Thank you,
Elena

Elena Razlogova wrote:

It seems that capitalize-first should just capitalize the first
letter
and leave the rest of the string alone. What it does instead is
lowercases the rest of the string including any proper nouns or
initials.

For example, genre in Chicago bibliography should be capitalized,
so I
get “memorandum” in a citation, but “Memorandum” in bibliography.
Unfortunately, in bibliography I also get “Ph.d. diss.” instead of
“Ph.D. diss.”

Is this a bug? Or perhaps I could use another text-transform command
that would only capitalize the first letter?

I suppose in some sense that’s a bug, but it’s rather difficult to
write
a parser that knows how to handle exceptions like proper names and
abbreviations. This is the reason why BibTeX, for example, requires
explicit encoding of them.

It seems to me for the immediate issue the CSL style ought not to
include any explicit encoding for this, and that you should rely on
Zotero (or the user) to provide the correct string?

Bruce and/or Simon–

Okay, I figured out how to set Zotero to display the string the way
users entered it with only the first letter capitalized (Bruce, I
think this is what you mean above). I would like to commit this change
to cite.js, unless there are objections.

The schema would need to be changed slightly. Right now it says:

      "capitalize-first"
    > # capitalize first character; other characters
      # displayed lowercase

instead it would say:

      "capitalize-first"
    > # capitalize first character

Any objections to this?

Thanks,
Elena

Okay, I figured out how to set Zotero to display the string the way
users entered it with only the first letter capitalized (Bruce, I
think this is what you mean above). I would like to commit this change
to cite.js, unless there are objections.

The schema would need to be changed slightly. Right now it says:

      "capitalize-first"
    > # capitalize first character; other characters
      # displayed lowercase

instead it would say:

      "capitalize-first"
    > # capitalize first character

Any objections to this?

I think we need something like this, but also the existing behaviour
might be needed.
If you wanted to transform “NATURE” into “Nature” for instance. I
think if you want to capitalize the first character and leave the rest
alone, then a new directive would be clearer. capitalize-first-letter
maybe?

Julian.

Okay, I figured out how to set Zotero to display the string the way
users entered it with only the first letter capitalized (Bruce, I
think this is what you mean above). I would like to commit this
change
to cite.js, unless there are objections.

The schema would need to be changed slightly. Right now it says:

     "capitalize-first"
   > # capitalize first character; other characters
     # displayed lowercase

instead it would say:

     "capitalize-first"
   > # capitalize first character

Any objections to this?

I think we need something like this, but also the existing behaviour
might be needed.
If you wanted to transform “NATURE” into “Nature” for instance. I
think if you want to capitalize the first character and leave the rest
alone, then a new directive would be clearer. capitalize-first-letter
maybe?

Yes, that would be great.

Adding another function was my original suggestion (see my previous
message), but I didn’t get a response from Bruce or Simon on that
either. Certain kinds of formatting (such as displaying “genre” for
bibliographies and citations differently) cannot be done in note
styles without a “capitalize-first-letter” function.

“Capitalize-first” as it works now is designed to transform titles–a
completely different function that is currently buggy anyway.

Can we please add this feature?

Thanks!
Elena

Elena Razlogova wrote:

Adding another function was my original suggestion (see my previous
message), but I didn’t get a response from Bruce or Simon on that
either.

I’ve been busy, and was sort of wondering what Simon would say.

Certain kinds of formatting (such as displaying “genre” for
bibliographies and citations differently) cannot be done in note
styles without a “capitalize-first-letter” function.

“Capitalize-first” as it works now is designed to transform titles–a
completely different function that is currently buggy anyway.

Can we please add this feature?

What is the specific recommendation then? Keep in mind that we need to
be able to support transformation of titles; this is why that feature is
primarily there.

I also don’t like baking stuff into CSL that are designed to work around
bugs in implementations (which is the case here; right?).

Bruce

Certain kinds of formatting (such as displaying “genre” for
bibliographies and citations differently) cannot be done in note
styles without a “capitalize-first-letter” function.

“Capitalize-first” as it works now is designed to transform titles–a
completely different function that is currently buggy anyway.

Can we please add this feature?

What is the specific recommendation then? Keep in mind that we need to
be able to support transformation of titles; this is why that
feature is
primarily there.

      "capitalize-first"
    > # capitalize first character; other characters
      # displayed lowercase
      "capitalize-first-letter"
    > # capitalize first character; other characters
      # displayed as entered by the user

I also don’t like baking stuff into CSL that are designed to work
around
bugs in implementations (which is the case here; right?).

This is not a bug. This is a clear case of CSL formatting for note
styles.

Here are example Chicago note citations for conference paper and
thesis. Note that “paper” is displayed in lowercase here:

Alexander B. Magoun, “Pushing Technology: David Sarnoff and Wireless
Communications, 1911-1921,” paper presented at the IEEE Conference on
the History of Telecommunications, St. John’s, Newfoundland, 2001.

Scott DeVeaux, “Jazz in Transition: Coleman Hawkins and Howard McGee,
1935-1945” (Ph.D. diss., University of California at Berkeley, 1985).

The above formatting means that the user has to enter “paper” (genre
field) in lowercase. In bibliographies, however, “paper” needs to be
capitalized. With current “capitalize-first” formatting I get the
paper bibliographic entry to display correctly but that breaks the
thesis entry where I get “Ph.d. diss.” instead of “Ph.D. diss.”:

Magoun, Alexander B. “Pushing Technology: David Sarnoff and Wireless
Communications, 1911-1921.” Paper presented at the IEEE Conference on
the History of Telecommunications. St. John’s, Newfoundland, 2001.

DeVeaux, Scott. “Jazz in Transition: Coleman Hawkins and Howard McGee,
1935-1945.” Ph.d. diss. University of California at Berkeley, 1985.

This is not a Zotero bug, or user entry/translator issue–this is a
clear case of CSL formatting where the first character in a field has
to be capitalized in bibliography but not in a citation. This is just
one example of many–in archive-location capitalized folder titles
would be lowercased in bibliographies in a current setup.

I don’t know how else I can explain this to make it clear. Perhaps
this is not immediately obvious to you and Simon because you don’t
usually work with note styles. This is not a case that’s relevant to
neuroscience, or to the Chicago Author-Date style that you use, so I
understand why you guys don’t want to deal with it. However, note
styles won’t work correctly without this feature.

Best,
Elena> Bruce

Elena Razlogova wrote:

This is not a bug. This is a clear case of CSL formatting for note
styles.

Here are example Chicago note citations for conference paper and
thesis. Note that “paper” is displayed in lowercase here:

Alexander B. Magoun, “Pushing Technology: David Sarnoff and Wireless
Communications, 1911-1921,” paper presented at the IEEE Conference on
the History of Telecommunications, St. John’s, Newfoundland, 2001.

Scott DeVeaux, “Jazz in Transition: Coleman Hawkins and Howard McGee,
1935-1945” (Ph.D. diss., University of California at Berkeley, 1985).

The above formatting means that the user has to enter “paper” (genre
field) in lowercase. In bibliographies, however, “paper” needs to be
capitalized. With current “capitalize-first” formatting I get the
paper bibliographic entry to display correctly

Right, but …

but that breaks the thesis entry where I get “Ph.d. diss.” instead of “Ph.D. diss.”:

… this is the bug I was referring to. If Zotero didn’t do this, would
you be asking for a new feature in CSL?

Magoun, Alexander B. “Pushing Technology: David Sarnoff and Wireless
Communications, 1911-1921.” Paper presented at the IEEE Conference on
the History of Telecommunications. St. John’s, Newfoundland, 2001.

DeVeaux, Scott. “Jazz in Transition: Coleman Hawkins and Howard McGee,
1935-1945.” Ph.d. diss. University of California at Berkeley, 1985.

This is not a Zotero bug, or user entry/translator issue–this is a
clear case of CSL formatting where the first character in a field has
to be capitalized in bibliography but not in a citation.

Here you’ve lost me. As I understand this thread, we have an expectation
that “capitalize-first” really means “capitalize the first character of
a string, and lowercase everything else EXCEPT content that should never
be lowercased (like proper names and acronyms).”

Since Zotero doesn’t handle the last part well (or at all?), you’re
suggesting we add a different kind of “capitalize-first” behavior which
means precisely “capitalize the first character of the string and do not
transform the rest of the string at all.” E.g. if input is “this StRiNg”
then output is “This StRiNg”.

Please correct me if I’m wrong here. Because if I’m right, I’m not
understanding how you don’t consider the Zotero behavior a bug from the
CSL standpoint.

Bruce

but that breaks the thesis entry where I get “Ph.d. diss.” instead
of “Ph.D. diss.”:

… this is the bug I was referring to. If Zotero didn’t do this,
would
you be asking for a new feature in CSL?

This is not a bug, as defined in CSL:

      "capitalize-first"
    > # capitalize first character; other characters
      # displayed lowercase

Magoun, Alexander B. “Pushing Technology: David Sarnoff and Wireless
Communications, 1911-1921.” Paper presented at the IEEE Conference
on
the History of Telecommunications. St. John’s, Newfoundland, 2001.

DeVeaux, Scott. “Jazz in Transition: Coleman Hawkins and Howard
McGee,
1935-1945.” Ph.d. diss. University of California at Berkeley, 1985.

This is not a Zotero bug, or user entry/translator issue–this is a
clear case of CSL formatting where the first character in a field has
to be capitalized in bibliography but not in a citation.

Here you’ve lost me. As I understand this thread, we have an
expectation
that “capitalize-first” really means “capitalize the first character
of
a string, and lowercase everything else EXCEPT content that should
never
be lowercased (like proper names and acronyms).”

This is not how your own CSL schema defines it (see above).

Since Zotero doesn’t handle the last part well (or at all?),

Whether Zotero can handle sentence case is not the issue here–this is
not the function I’m asking for.

you’re
suggesting we add a different kind of “capitalize-first” behavior
which
means precisely “capitalize the first character of the string and do
not
transform the rest of the string at all.” E.g. if input is “this
StRiNg”
then output is “This StRiNg”.

Yes, I can’t use “sentence-case” for “genre” and “location in
archive.” I need a new function, the one you describe above.

Please correct me if I’m wrong here. Because if I’m right, I’m not
understanding how you don’t consider the Zotero behavior a bug from
the
CSL standpoint.

Again, whether Zotero can handle sentence case is not the issue here–
this is not the function I’m asking for. The current “capitalize-
first” behavior is needed to toggle from title case/all caps to
sentence case. I have a completely different problem.

What I’m saying is that “genre” and “archive-location” need to be
formatted differently from titles–the capitalization should be left
as is. For example, in this source:

F. A. Metzgar to NBC, February 12, 1936, folder “Programs-Criticism
1936,” NBC Mss. (LC).

No “sentence-case” formatting for “genre,” however sophisticated,
would know that in this case “Programs-Criticism” has to be
capitalized. Proper “sentence-case” (once it works) would result in
this formatting:

Metzgar, F. A. Letter to NBC. February 12, 1936. Folder “programs-
criticism 1936.” NBC Mss. (LC).

Whereas I need:

Metzgar, F. A. Letter to NBC. February 12, 1936. Folder “Programs-
Criticism 1936.” NBC Mss. (LC).

I’m asking for an additional function that would be able to handle
these cases.

Best,
Elena> Bruce

but that breaks the thesis entry where I get “Ph.d. diss.” instead
of “Ph.D. diss.”:

… this is the bug I was referring to. If Zotero didn’t do this,
would
you be asking for a new feature in CSL?

yes, because there are many other cases where proper sentence-case
formatting will display the string incorrectly–see my example with
folder names in my previous message.

elena

Elena,

Elena Razlogova wrote:

but that breaks the thesis entry where I get “Ph.d. diss.” instead
of “Ph.D. diss.”:
… this is the bug I was referring to. If Zotero didn’t do this,
would
you be asking for a new feature in CSL?

This is not a bug, as defined in CSL:

      "capitalize-first"
    > # capitalize first character; other characters
      # displayed lowercase

Well, OK, maybe a bug in the documentation too :slight_smile:

Whether Zotero can handle sentence case is not the issue here–this is
not the function I’m asking for.

But I’m trying to figure out WHY you’re asking for it, and what the
implications are of adding it. I understand you need a solution for this
issue, but we need to work through the details of how to solve it best.

Yes, I can’t use “sentence-case” for “genre” and “location in
archive.” I need a new function, the one you describe above.

OK, so we’re at least understanding each other.

Please correct me if I’m wrong here. Because if I’m right, I’m not
understanding how you don’t consider the Zotero behavior a bug from
the
CSL standpoint.

Again, whether Zotero can handle sentence case is not the issue here–
this is not the function I’m asking for. The current “capitalize-
first” behavior is needed to toggle from title case/all caps to
sentence case. I have a completely different problem.

What I’m saying is that “genre” and “archive-location” need to be
formatted differently from titles–the capitalization should be left
as is. For example, in this source:

F. A. Metzgar to NBC, February 12, 1936, folder “Programs-Criticism
1936,” NBC Mss. (LC).

No “sentence-case” formatting for “genre,” however sophisticated,
would know that in this case “Programs-Criticism” has to be
capitalized. Proper “sentence-case” (once it works) would result in
this formatting:

Metzgar, F. A. Letter to NBC. February 12, 1936. Folder “programs-
criticism 1936.” NBC Mss. (LC).

Whereas I need:

Metzgar, F. A. Letter to NBC. February 12, 1936. Folder “Programs-
Criticism 1936.” NBC Mss. (LC).

I’m asking for an additional function that would be able to handle
these cases.

But is this really an issue confined to genre and location formatting?
Or is it instead a generic problem of potentially any string?

Consider, for example, a title like:

A Commentary on "Some Title"

Don’t we end up with the exact same problem you identify for your use
case? If the CSL says to use sentence case, I’d presume we’d end up with:

A commentary on "some title"

… when it should probably be:

A commentary on "Some title"

…?

Note: since I’m not British, I’m not totally sure I have this example
right. But if I’m right, then how does adopting your proposed solution
solve this case? Can we figure out a generic mechanism that can?

I suppose one (potentially bad) solution is to decouple the basics of
transformation from more specific (and difficult) algorithms about
internal formatting. In that case, we have your suggestion, but then add
another attribute something like:

In cases where lowercase transformation is used, formatter

should attempt to preserve correct casing for semantic terms

content such as acronyms, personal names, titles and so forth.

attribute preserve-internal-semantics { boolean }?

So we could have:

… or:

This might be a bad idea; just thinking out loud …

Bruce

But is this really an issue confined to genre and location formatting?
Or is it instead a generic problem of potentially any string?

Yes, this could be a problem for titles also (and maybe other fields i
haven’t thought of) but titles are a special case I think because they
have to switch between Title and Sentence formatting, whereas other
fields can be displayed as-is all the time, with the exception of the
first letter. You just don’t need to run as many conditionals on
“genre”, etc. as on titles.

Consider, for example, a title like:

A Commentary on “Some Title”

Don’t we end up with the exact same problem you identify for your use
case? If the CSL says to use sentence case, I’d presume we’d end up
with:

A commentary on “some title”

… when it should probably be:

A commentary on “Some title”

…?

Note: since I’m not British, I’m not totally sure I have this example
right. But if I’m right, then how does adopting your proposed solution
solve this case? Can we figure out a generic mechanism that can?

Well, the ticket for this in Zotero (#832 (Handle title case/sentence case properly) – Zotero
) suggests to have users set case for titles in the info pane instead
of CSL, and either use a preference to turn off title casing in CSL
altogether or have a complex algorithm that formats the casing based
on the corrections done by the user (a very cool feature if I
understand it correctly, it was Julian’s suggestion). Either of these
options would work with your suggestion below, and with mine.

I suppose one (potentially bad) solution is to decouple the basics of
transformation from more specific (and difficult) algorithms about
internal formatting. In that case, we have your suggestion, but then
add
another attribute something like:

In cases where lowercase transformation is used, formatter

should attempt to preserve correct casing for semantic terms

content such as acronyms, personal names, titles and so forth.

attribute preserve-internal-semantics { boolean }?

So we could have:

… or:

This might be a bad idea; just thinking out loud …

This would work for me, but how is that better than just having two
separate attributes? Couldn’t you just have instead:

The first would be a sentence-case algorithm with all attendant
complications, the second a simpler function that just capitalizes the
first letter.

Elena> Bruce

Elena Razlogova wrote:

The first would be a sentence-case algorithm with all attendant
complications, the second a simpler function that just capitalizes the
first letter.

Let me take a look again at the schema later today and get to you.

Bruce

(Actually it was Simon’s suggestion.) It might not happen for a while,
and won’t happen on 1.0 (since it will require DB changes).

Well, the ticket for this in Zotero (#832 (Handle title case/sentence case properly) – Zotero
) suggests to have users set case for titles in the info pane instead
of CSL, and either use a preference to turn off title casing in CSL
altogether or have a complex algorithm that formats the casing based
on the corrections done by the user (a very cool feature if I
understand it correctly, it was Julian’s suggestion)

(Actually it was Simon’s suggestion.) It might not happen for a while,
and won’t happen on 1.0 (since it will require DB changes).

Ah, sorry about misattribution–the ticket was reported by codec, so I
assumed it was him.

Perhaps the best behavior in the interim would be to turn off title
casing in CSL and just to change it on option-click in Zotero, where
users can fix it.

e

sorry, i meant control-click, not option-click, below. elena

Bruce–
Any chance you have made a decision on this?
Thanks,
Elena

Elena Razlogova wrote:

Any chance you have made a decision on this?

I’m just looking at it now. So we’ve now got:

 attribute text-case {
   # display all text as lowercase
   "lowercase"
   > # display all text as uppercase
     "uppercase"
   > # capitalize first character; other characters
     # displayed lowercase
     "capitalize-first"
   > # capitalize first character of every word;
     # other characters displayed lowercase
     "capitalize-all"
   > # display as title case (the Chicago Manual
     # of Style calls this "headline style")
     "title"
   > # display as sentence case/sentence style
     "sentence"
 }?,

So I see two issues to resolve:

  1. does CSL need a rule that says that the first character of a string
    is capitalized, but all others are left alone? The answer is “no” if we
    consider that the existing options should cover the use cases you
    outline (irrespective of how Zotero currently implements this), and
    otherwise “yes.”

if we conclude yes, then:

  1. what should the name of that value be, and how should it be
    described, such that users and developers are totally clear on how it
    differs from both “capitalize-first” and “sentence”?

I’m ambivalent on the answer to 1, and keep hoping that someone else
will render an opinion on it. Julian? Simon?

On 2, for me the distinction between “capitalize-first-letter” and
“capitalize-first” is unclear. I would hope we could come up with
something else, but am not sure ATM what. Again, any ideas?

Bruce

bruce–
julian actually already weighed in on this–note that he agrees that
we need the attribute i’m requesting. as i mention my previous email,
his example below can be handled by the “sentence” attribute.
elenaBegin forwarded message: