text-case="capitalize-first" does not work consistently

Hi Guys,

text-case="capitalize-first" is a formatting option in CSL.

The intimation is that capitalize-first would make the first letter capitalized and the rest of the word lowercase. In fact I have found that all it does is capitalize the first letter and leaves the rest of the word alone. Therefore if you have a author called "LASTNAME", using capitalize-first actually does nothing.

Is there another option available. In some programming languages I use they have Proper() to allow "lastname", "lasTname", "LASTNAME", etc to be converted to "Lastname". The only way I can see of doing this in CSL currently is to create a macro that converted the variable author to lowercase then use another macro to capitalize the first letter but I am unsure where to place the 'label form...' and 'substitute...' components.


<macro name="author" suffix=".">
-
<names variable="author" text-case="capitalize-first">
<name name-as-sort-order="all" and="symbol"
sort-separator=", " initialize-with="." delimiter=", "
delimiter-precedes-last="never"/>
<label form="short" prefix=" (" suffix=".)"
text-case="lowercase"/>
-
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
-
</names>
-
</macro>


Alternatively, what is the chance of the 'proper' becoming available in the text-case="" option?

Simon
  • edited May 6, 2009
    If capitalize-first lowercased the rest of the string including any proper nouns or
    initials, some fields could not be properly represented in citation styles. For example, the "type" field in Chicago styles should be capitalized in bibliography but not in notes, displaying "memorandum" in a citation, but "Memorandum" in bibliography. If capitalize-first transformed the rest of the string, in bibliography I would get "Ph.d. diss." instead of "Ph.D. diss."

    Your request can also be handled by the ticket for allowing case transform on author fields in the Zotero pane. See the discussion here: http://forums.zotero.org/discussion/835/
  • erazlogo,

    I am not implying that any data is changed in the database. In fact using the style sheet only changes how it is outputed. I can make various macros to to handle the situation as mentioned above. All I am suggesting is that text-case="proper" might be a good way of handling unusually formatted names sucked into Zotero through the use of site translators.

    I envisage that despite having multiple references that have uppercase authors, you could hard wire how you want the author to output in the bibliography or in-text citation.

    So instead of the above code you would have...


    <macro name="author" suffix=".">
    -
    <names variable="author" text-case="proper">
    <name name-as-sort-order="all" and="symbol"
    sort-separator=", " initialize-with="." delimiter=", "
    delimiter-precedes-last="never"/>
    <label form="short" prefix=" (" suffix=".)"
    text-case="lowercase"/>
    -
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <text macro="title"/>
    </substitute>
    -
    </names>
    -
    </macro>


    This would result in all authors, regardless of how they are stored on the database (i.e. surname, Surname, SURNAME, suRNaMe) as presenting as "Surname + the other stuff".

    And just to clarify I am only suggesting this type of format option be used for segments of a citation not the entire reference. Plus unless someone changes a style to include this format option for a particular string nothing will change for anyone.

    I am aware of the ticket and read the mentioned thread but consider this option far superior and easier . I don't understand why having another formatting option in text-case is such a big problem - it would appear to be relatively easy to implement as the two functions "everything to lowercase" and "capitalize first letter" are already present.

    Sorry for being so naive but it seems that every time someone mentions it they start an uproar. I don't understand why. It is like saying to a word processor user they can have an italics function because it might be used in the wrong way. Let them have the functionality - it can only improve the format of output not reduce it.

    Simon
  • edited May 6, 2009
    I think it's important to take note of the fact that it's far easier for computers to remove information than to add it. As such, it's usually easier and more reliable to make sure the data in your library is as information rich as possible (i.e. properly capitalized names, sentence cased titles, etc), and use CSL styles to remove some of that information richness when desired (e.g. uppercasing the author names).

    In your proposal for adding a proper-text case option, the McEwens and O'Reillys of this world will be formatted incorrectly, unless Zotero has a list of names so it can correct them, but that would have significant drawbacks. It would most probably require you to check the text transformations each time you cite some sources. If, on the other hand, you transform the case of the authors in your library (from surname, SURNAME and suRNaMe or Surname), you only have to curate your data once.

    Text transformation options have their uses in CSL, but IMHO modifying author names usually isn't one of them.
  • Rintze,

    That is a fair point, although creation of a name routine that captured Mc and O'; and other common prefixes could also work. That said, someone needs to develop the functionality then curate a list, and from what I can tell there are more pressing matters for the Zotero Development Team.

    Simon
Sign In or Register to comment.