How can I modify my CSL code to display author names in all uppercase?

138 Views Asked by At

Is it possible to change the code so the name will be all uppercase? When I add a text-case="uppercase" (or lowercase or anything) it changes nothing, even though I am in the correct block - if I have font-weight or something else, it changes correctly. My current CSL code looks like this:

<macro name="author">
    <names variable="author" font-weight="normal" text-decoration="none" vertical-align="baseline">
      <name font-variant="normal" font-weight="normal" delimiter-precedes-last="never" initialize-with=". " name-as-sort-order="all"/>
      <label form="short" prefix=" (" suffix=")"/>
      <et-al font-style="italic"/>
      <substitute>
        <names variable="editor"/>
        <names variable="translator"/>
        <choose>
          <if type="article-newspaper article-magazine" match="any">
            <text variable="container-title" text-case="title" font-style="italic"/>
          </if>
          <else>
            <text macro="title"/>
          </else>
        </choose>
      </substitute>
    </names>
  </macro>

If I give an example how it looks: Campbell, J. L., Pedersen, O. K. (2007): The varieties of capitalism and hybrid success, Comparative Political Studies, 40(3), 307–332. https://doi.org/10.1177/0010414006286542. What I would like to get: CAMPBELL, J. L., PEDERSEN, O. K. (2007): The varieties of capitalism and hybrid success, Comparative Political Studies, 40(3), 307–332. https://doi.org/10.1177/0010414006286542.

1

There are 1 best solutions below

0
adam.smith On

You want to set text-case="uppercase" on an explicit name-parts element, like so:

<macro name="author">
    <names variable="author">
      <name delimiter-precedes-last="never" initialize-with=". " name-as-sort-order="all">
        <name-part name="family" text-case="uppercase"/>
      </name>
      <label form="short" prefix=" (" suffix=")"/>
      <et-al font-style="italic"/>
      <substitute>
        ...
      </substitute>
    </names>
  </macro>

You don't actually have your code with uppercase in the question, but I suspect you had it set on either name or names, which isn't allowed as per the specification.