# Punctuation issues

**URL:** <https://discourse.citationstyles.org/t/punctuation-issues/191>\
**Category:** CSL Development\
**Created:** [August 12, 2006, 8:13pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191 "2006-08-12T20:13:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 12, 2006, 8:13pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/1 "2006-08-12T20:13:21Z")

</div>

I’m very close to completing an updated version of my JavaScript-based  
parser. However, if I strictly follow the schema, I get output like this:

Rosenzweig, R… (1983). Eight hours for what we will : workers and leisure  
in an industrial city, 1870-1920.New York:Cambridge University Press.

If I add an editor, I get:

Doe, J… (1996). My Book., Hitchcock, A. editor.New York:Random House.

Shall I simply say, if there are two periods or commas anywhere in the  
bibliographic output, get rid of the first one (or, for the regular  
expression inclined, s/.,/$1/g)? Or do we need more complex rules to  
solve this?

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 12, 2006, 8:17pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/2 "2006-08-12T20:17:48Z")

</div>

The fist question is, why are you getting the spurious output? Is there  
something wrong with the style and/or the schema? Generally speaking,  
the design is such that this would more-than-likely be a bug of some  
sort.

I did recall a case where it’s hard to avoid problems, though, but I  
can’t remember what it was.

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 12, 2006, 8:31pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/3 "2006-08-12T20:31:09Z")

</div>

The style is defined as:

```
  <item suffix=".">
    <choose>
      <type name="book">
        <author/>
        <date prefix=" (" suffix=").">
          <year/>
        </date>
        <titles font-style="italic" prefix=" " suffix="."/>
        <editor prefix=", "/>
        <publisher/>
        <access prefix=" "/>
      </type>

```

If you have a contributor with initialize-with=".", and the contributor  
field has suffix=".", you will inevitably sometimes end up with an extra  
period. You can’t get rid of the suffix, because then institutional authors  
and authors with no last name will lack a period. We definitely need some  
rules to handle this.

As for the case of the editor, I actually can’t find any resources that list  
what I’m supposed to do with a book which has both an author and an editor  
(do such books exist?), so this may be a moot point in this situation, but  
the same thing will happen with pages. I think it’s fixable within the  
style; I’ll give it a try.

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 12, 2006, 8:44pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/4 "2006-08-12T20:44:29Z")

</div>

> We definitely need some rules to handle this.

OK, let’s do it then, but try to catch where there are bugs.

> As for the case of the editor, I actually can’t find any resources  
> that list  
> what I’m supposed to do with a book which has both an author and an  
> editor  
> (do such books exist?),

Yes, there are books that have authors, editors and translators; I have  
one on my shelf:

\<[http://www.amazon.com/gp/product/0674013557/sr=8-5/qid=1155415329/](http://www.amazon.com/gp/product/0674013557/sr=8-5/qid=1155415329/)  
ref=pd\_bbs\_5/104-7919287-9567914?ie=UTF8\>

> so this may be a moot point in this situation, but  
> the same thing will happen with pages. I think it’s fixable within the  
> style; I’ll give it a try.

OK, let me know. I’ll probably deal with the schema changes tomorrow.

Do you need SVN access Simon?

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 4:13pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/5 "2006-08-13T16:13:17Z")

</div>

> OK, let me know. I’ll probably deal with the schema changes tomorrow.

Okay, I think I’ve got everything working properly. I’m still not positive  
the output is 100% correct, but it matches the output guidelines on the  
Internet for the items I was working with. To perfect things, I might have  
to find a copy of the APA Style Guide (apparently the APA’s single most  
profitable enterprise), but in any case, this output is much closer to  
right, and didn’t require any schema modifications.

The downside is that there’s a bit of repetition:

```
<contributor>
  <name and="symbol" sort-separator=", " initialize-with="."/>
  <role prefix=", " />
</contributor>
<author>
  <substitute>
    <choose>
      <editor>
        <name and="symbol" sort-separator=", " initialize-with="."/>
        <role prefix=" (" suffix=")" />
      </editor>
      <translator>
        <name and="symbol" sort-separator=", " initialize-with="."/>
        <role prefix=" (" suffix=")" />
      </translator>
      <titles relation="container" font-style="italic"/>
      <titles>
        <name form="short"/>
      </titles>
    </choose>
   </substitute>
</author>

```

This is because, where there is no author but there is an editor, we need  
output like:

Duncan, G.J., & Brooks-Gunn, J. (Eds.). (1997). Consequences of growing up  
poor. New York: Russell Sage Foundation.

But where there are both authors and editors, we need output like:

Plath, S. (2000). The unabridged journals (K.V. Kukil, Ed.). New York:  
Anchor.

Is it worth trying to alter the schema to avoid this repetition? I’m exactly  
not sure what one could do.

> Do you need SVN access Simon?

It might make things easier. I could also email you the file, if you’d  
prefer to review it first. Whatever’s more convenient for you.

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 4:49pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/6 "2006-08-13T16:49:14Z")

</div>

If I’m reading this right, the CSL fragment doesn’t match the expected  
output.

One obvious change to consider is to have role is as top-level default?

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 5:16pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/7 "2006-08-13T17:16:10Z")

</div>

Just send me your SF account name.

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 5:16pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/8 "2006-08-13T17:16:04Z")

</div>

> If I’m reading this right, the CSL fragment doesn’t match the expected  
> output.

I just realized that you are, in fact, correct. The output I get with both  
an author and an editor is:

Rosenzweig, R. (1986). Government and the arts in thirties America : a guide  
to oral histories and other research materials (Jones, B., editor). Lanham,  
MD: Distributed by arrangement with University Pub. Associates.

Where (B. Jones, editor) should be (Jones, B., editor).

Is getting rid of the sort-separator attribute supposed to nullify the  
author-as-sort-order attribute on ? If so, I can fix this  
without schema modifications. Otherwise, perhaps author-as-sort-order should  
be an attribute of or ?

The output for an editor but no author does in fact match:

Rosenzweig, R. (editor). (1994). The park and the people : a history of  
Central Park. New York: H. Holt and Co.

(Although actually, editor should be Ed., but that’s pending schema  
modification.)

> One obvious change to consider is to have role is as top-level default?

I don’t think this solves the problem. (Can you come up syntax where it  
works? Perhaps I’m just misunderstanding you.) We could do something like:

```
<contributor>
  <name and="symbol" sort-separator=", " initialize-with="."/>
  <role prefix=", " />
</contributor>
<author>
  <substitute>
    <choose>
      <contributor role="editor,translator">
        <name and="symbol" initialize-with="."/>
        <role prefix=" (" suffix=")" />
      </contributor>
      <titles relation="container" font-style="italic"/>
      <titles>
        <name form="short"/>
      </titles>
    </choose>
   </substitute>
</author>

```

It seems inevitable that both and need to be redefined, but by  
letting the role attribute take multiple roles, we can redefine it only  
once. (But then again, how many books have a translator but no author,  
besides the Bible? Maybe I could just get rid of the tag in  
?)

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 5:18pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/9 "2006-08-13T17:18:28Z")

</div>

I guess if we take this example …

> Duncan, G.J., & Brooks-Gunn, J. (Eds.). (1997). Consequences of  
> growing up  
> poor. New York: Russell Sage Foundation.
> 
> But where there are both authors and editors, we need output like:
> 
> Plath, S. (2000). The unabridged journals (K.V. Kukil, Ed.). New York:  
> Anchor.

I’d say:

… etc.

How’s that?

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 5:35pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/10 "2006-08-13T17:35:37Z")

</div>

The problem I see (perhaps there’s another?) is how to solve the prefix and  
suffix issues on the roles. In the first case, the role needs " (" before  
and “)” after, while in the second case, the role needs ", " before and  
nothing after (the parentheses are on the whole field).

Additionally, there’s the problem of controlling name inversion (Doe, J. if  
the editor replaces the author, or J. Doe if not), which I spoke about in  
the previous email.

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 6:08pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/11 "2006-08-13T18:08:45Z")

</div>

> Rosenzweig, R. (1986). Government and the arts in thirties America : a  
> guide  
> to oral histories and other research materials (Jones, B., editor).  
> Lanham,  
> MD: Distributed by arrangement with University Pub. Associates.
> 
> Where (B. Jones, editor) should be (Jones, B., editor).

I think I see. When you do substitution, you are wanting to carry the  
formatting logic along with the variable.

That’s not how I see it. If an editor is substituted for an author,  
then the editor takes on the formatting of the author. So …

> Is getting rid of the sort-separator attribute supposed to nullify the  
> author-as-sort-order attribute on ?

No. Sort separator apples simply _if_ a name gets displayed as the sort  
order. And the order may vary between citations and bib.

> If so, I can fix this  
> without schema modifications. Otherwise, perhaps author-as-sort-order  
> should  
> be an attribute of or ?

The essential thing about the author-as-ssrt-order attribute is it  
defines the ordering of each name within a list of names, regardless of  
the variable (if author, editor, etc.).

> The output for an editor but no author does in fact match:
> 
> Rosenzweig, R. (editor). (1994). The park and the people : a history of  
> Central Park. New York: H. Holt and Co.
> 
> (Although actually, editor should be Ed., but that’s pending schema  
> modification.)

text-transform=“capitalize”

… though I’m still thinking that ought to be default.

> > One obvious change to consider is to have role is as top-level  
> > default?
> 
> I don’t think this solves the problem.

You’re probably right. Was just thinking might avoid some potential  
duplication.

See if my explanation at top solves your problem (as I am seeing it,  
there isn’t one).

[…]

> It seems inevitable that both and need to be redefined,  
> but by  
> letting the role attribute take multiple roles, we can redefine it only  
> once. (But then again, how many books have a translator but no author,  
> besides the Bible? Maybe I could just get rid of the tag  
> in  
> ?)

Am not sure on that one.

There’s actually another problem with the current substitution logic:

A little down the list I have a container title. But actually, that’s  
not really specific enough. The rule is typically “periodical-title” |  
“title” | “anonymous”

In other words, certain kinds of container titles (may) get  
substituted, but not other kinds.

BTW, you now should have developer access (to SVN and such).

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 6:39pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/12 "2006-08-13T18:39:41Z")

</div>

> > Rosenzweig, R. (1986). Government and the arts in thirties America : a  
> > guide  
> > to oral histories and other research materials (Jones, B., editor).  
> > Lanham,  
> > MD: Distributed by arrangement with University Pub. Associates.
> > 
> > Where (B. Jones, editor) should be (Jones, B., editor).
> 
> I think I see. When you do substitution, you are wanting to carry the  
> formatting logic along with the variable.
> 
> That’s not how I see it. If an editor is substituted for an author,  
> then the editor takes on the formatting of the author. So …

Ah. Then we have other problems. My previous assumption was that if there  
was a substitute element, the substitute element inherited as follows:

child element  
_overrides_  
element with the same name in the same   
_overrides_  
default element.

I admit that this hierarchy is a bit clearer:

child element  
_overrides_  
author element  
_overrides_  
default element

But, we need some way to control the italicization of the title, which  
depends on the type. In most styles, a book title gets italicized, but an  
article title does not. How do we do this within a element? Do  
we just assume no one will have books without authors or editors?

We could use the rule that substitute contributors use the second hierarchy  
above, while other fields use the first, but that’s kind of a messy  
solution.

> > Is getting rid of the sort-separator attribute supposed to nullify the  
> > author-as-sort-order attribute on ?
> 
> No. Sort separator apples simply _if_ a name gets displayed as the sort  
> order. And the order may vary between citations and bib.
> 
> > If so, I can fix this  
> > without schema modifications. Otherwise, perhaps author-as-sort-order  
> > should  
> > be an attribute of or ?
> 
> The essential thing about the author-as-ssrt-order attribute is it  
> defines the ordering of each name within a list of names, regardless of  
> the variable (if author, editor, etc.).

The problem is, in APA, the name order changes depending on the variable.  
So, while the element (and and , if they’re  
substituted for ) should be author-as-sort-order=“all”, the   
tag should be author-as-sort-order=“no”.

The easy way to fix this problem is to add move the author-as-sort-order  
attribute to the element (from which and   
inherit). Then, you could define author-as-sort-order=“all” in the defaults  
and use:

(Ignore the group tag; it’s necessary to put the period in the right place.)

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 7:27pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/13 "2006-08-13T19:27:00Z")

</div>

Right, because in those positions, they are never the sort key, so  
cannot be displayed as sorted.

Are you making this more complicated than it needs to be?

I recognize there may be styles that do really strange things here, in  
which case we should indeed do something like you’re suggesting, but  
I’ve not run across one.

Will get back to you on the other questions later …

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 7:36pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/14 "2006-08-13T19:36:00Z")

</div>

In CBE (which is definitely in the top 10 citation styles we should  
support), you get citations like this:

Heisenberg W. The physical principles of the quantum theory. Eckart C, Hoyt  
FC, translators. Chicago: U Chicago P; 1930. 278 p.

Eckart C and Hoyt FC aren’t sort keys, but they’re still printed like they  
are.

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 7:45pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/15 "2006-08-13T19:45:57Z")

</div>

OK, then. Good you had that example in your pocket!

So yeah, then (not looking right this second at your suggestion) we  
need to get rid of the bibliography attribute for this, and instead use  
something like for this example:

When using the short form, of course this doesn’t apply.

An alternative is to have a “names\_as\_sorted” attribute on contributor,  
etc., which might make overriding that easier (because you wouldn’t  
need a child element to do it). I think this was your suggestion.

Bruce

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 7:48pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/16 "2006-08-13T19:48:16Z")

</div>

Yeah, the Amazon link I posted yesterday. But I’m not sure what’s  
you’re asking herr.

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 8:00pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/17 "2006-08-13T20:00:06Z")

</div>

I think the latter is a better idea, for the reason you’ve given. And to  
nitpick, shouldn’t it be “names-as-sorted”, with hyphens instead of  
underscores, to fit with the conventions of the rest of the schema?

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 8:04pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/18 "2006-08-13T20:04:45Z")

</div>

Yeah, I was just internalizing Johan’s point: that it’s nice to able to  
map attribute and elements directly to method calls.

But if people think that’s a good idea, then it does mean being  
consistent.

I have no strong opinion on this; might be more trouble than it’s worth  
to change.

Bruce

---

<div class="post-metadata">

**Author:** ![Simon\_Kornblith](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Simon\_Kornblith](https://discourse.citationstyles.org/u/Simon_Kornblith)\
**Post date:** [August 13, 2006, 8:06pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/19 "2006-08-13T20:06:08Z")

</div>

If you have author, editor, and translator, your output (presumably)  
becomes:

Plath, S. (2000). The unabridged journals (K.V. Kukil, Ed., J. Doe, Trans.).  
New York: Anchor.

Not:

Plath, S. (2000). The unabridged journals (K.V. Kukil, Ed.) (J. Doe,  
Trans.). New York: Anchor.

Correct? But how do we model this (admittedly unlikely) situation in CSL?

Simon

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [August 13, 2006, 8:32pm UTC](https://discourse.citationstyles.org/t/punctuation-issues/191/20 "2006-08-13T20:32:31Z")

</div>

They’re different fields, so:

… or:

Don’t ask me how we’d handle some other role; am not sure. Maybe  
default mappings?

```
composer = author
director = author

```

…?

Bruce

[Next page](https://discourse.citationstyles.org/t/punctuation-issues/191.md?page=2)
