# styling design question

**URL:** <https://discourse.citationstyles.org/t/styling-design-question/103>\
**Category:** CSL Development\
**Created:** [October 3, 2005, 11:49pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103 "2005-10-03T23:49:08Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [October 3, 2005, 11:49pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/1 "2005-10-03T23:49:08Z")

</div>

Hi,

I’ve been talking to the OpenDocument people about the possibility of  
including the citation style language (CSL) I designed in OpenDocument  
in some form.

[http://xbiblio.sourceforge.net/csl.html](http://xbiblio.sourceforge.net/csl.html)

One issue they raised is that it doesn’t really make use of the OD  
styling infrastructure. So I’ve been experimenting a bit with what it  
might mean to bring them closer in line.

Basically, it would primarily mean moving a lot of element content into  
attributes. This fragment, for example, is about 75% more compact than  
my current schema, and more in line with an OD approach:

```
 <names initialize-with="." and-as=" &amp;"/>
 <months jan="Jan" feb="Feb" mar="Mar" apr="Apr" may="May" jun="Jun"
   jul="Jul" aug="Aug" sep="Sep" oct="Oct" nov="Nov" dec="Dec"/>
 <locator unit="page" use-when="missing-volume-issue" single="p. "
   multiple="pp. "/>
 <locator unit="paragraph" single="¶ " multiple="¶¶ "/>
 <role term="editor" single="Ed. " multiple="Eds. "/>
 <role term="translator" single="tran. " multiple="trans. "/>
 <genre term="dissertation" value="PhD Dissertation"/>
 <genre term="letter" value="letter"/>
 <genre term="press release" value="press release"/>
 <genre term="memo" value="memo"/>
 <medium term="cdrom" value="CD-ROM"/>

```

OK, so it’s a lot more compact (and probably faster to process as a  
result). What we give up with this approach is any possibility to add  
markup to attribute content. So for example, current OOo code to  
handle prefixes and suffixes for citations is handled in attributes.  
Hence, they can only ever be strings effectively.

Is that a reasonable tradeoff? How much of a compromise would it be  
worth it to get this into the OD file format?

And thinking about the document I posted the other day, how would  
people imagine configuring the styling for the example which has:

author name  
… citation 1 …  
… citation 2 …

In other words, how would you see configuring a GUI such that you  
indicate that a) citations should be grouped by author, and b) that the  
group ought to be labeled with the author name, followed by a paragraph  
break? It might have bearing on the above.

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 12:59am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/2 "2005-10-04T00:59:03Z")

</div>

Could you do this?

```
 <role term="editor" single="Ed. " multiple="Eds. " font-style- 

```

prefix=“italic” font-style=“regular” /\>

where font-style is the mark-up used for the editors name and font-  
style-prefix (and -suffix) are used for the markup of those. That  
should handle most needs, right? So the above should result in  
something like:

```
Johan Kool Ed.

```

I’m by far not a XML expert, so I hope this makes sense.

Johan

---

<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:** [October 4, 2005, 1:21am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/3 "2005-10-04T01:21:43Z")

</div>

Yes, it makes sense. However, the OD standard uses FO for font  
styling, so that in reality you end up with something like:

\<csl:role text:prefix="Ed. " fo:font-style=“italic” … /\>

… and I’m pretty sure FO has no such font-style-prefix attribute.

Have you seen examples where “Ed.” is italicized like that?

Bruce

---

<div class="post-metadata">

**Author:** ![Matthias\_Steffens](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Matthias\_Steffens](https://discourse.citationstyles.org/u/Matthias_Steffens)\
**Post date:** [October 4, 2005, 8:23am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/4 "2005-10-04T08:23:17Z")

</div>

I’m currently writing a paper for a journal that requires  
"ed./eds." to be printed in italic.

I guess it would be too much work to support both CSL schemas, so  
that others who require this feature and want to use CSL outside  
of OOo can make use of it?

However, I think that having CSL included into the OpenDocument  
format would be a very good thing. Best option would be to press  
them to support styled prefixes and suffixes. 😉 Well, at least  
it’s a valid feature request from a user point of view.

Regards, Matthias

---

<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:** [October 4, 2005, 10:34am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/5 "2005-10-04T10:34:14Z")

</div>

> > Have you seen examples where “Ed.” is italicized like that?
> 
> I’m currently writing a paper for a journal that requires  
> “ed./eds.” to be printed in italic.

Well that settles it then; it stays as it is in that case 🙂

> I guess it would be too much work to support both CSL schemas, so  
> that others who require this feature and want to use CSL outside  
> of OOo can make use of it?

Yes, it’d be too much work. The challenge in this case is not really  
the XML anyway, but the GUI to edit it.

> However, I think that having CSL included into the OpenDocument  
> format would be a very good thing. Best option would be to press  
> them to support styled prefixes and suffixes. 😉 Well, at least  
> it’s a valid feature request from a user point of view.

Yes, and I think that’s what I need to make a case.

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:** [October 4, 2005, 10:49am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/6 "2005-10-04T10:49:44Z")

</div>

Actually, correction here:

This example would still work in the alternate approach, as the "Ed."  
content is actually handled with the role element:

\<csl:role text:prefix=" " text:value=“Ed.” fo:font-style=“italic”/\>

As I see it, the prefix/suffix stuff is really for punctuation.

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 12:40pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/7 "2005-10-04T12:40:38Z")

</div>

Do I understand it correctly that

- a prefix or suffix can not have its own markup?
- extra text such as Ed./Eds. and p./pp. can have its own markup?

If you go with the assumption that the prefix/suffix wil always use the same  
markup as the data in question, e.g. (2005) will be all bold, than I think  
you have a big majority of citations covered. I think that wanting the  
brackets to be italic and the year to be bold are rare occasions.

Johan\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Message sent using  
Mailophalen 0.2.7.2

---

<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:** [October 4, 2005, 11:49am UTC](https://discourse.citationstyles.org/t/styling-design-question/103/8 "2005-10-04T11:49:25Z")

</div>

Correct.

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 5:27pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/9 "2005-10-04T17:27:29Z")

</div>

My second attempt to send this file seems to have failed too.  
SourceForge doesn’t accept zip files. Download the file here: http://  
[sheba.geo.vu.nl/~jkool/filearea/GUI%20CSL.zip](http://sheba.geo.vu.nl/~jkool/filearea/GUI%20CSL.zip)

Just a plain and quick mockup for a CSL GUI in IB for OS X. Clearly  
not finished…

The empty lists should hold all the options, article, book-chapter,  
editor, translator etc. The font style, prefix and suffix fields  
should only be enabled when a token in NSTokenField is selected. The  
current implementation for NSTokenField doesn’t allow this, but it’s  
close enough to show my intentions. The plus button should show a  
list with options to choose from. Multiple author stuff is not any  
good yet. There are stil plenty alignment issues.

I hope this is any help/good. 🙂

Johan

---

<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:** [October 4, 2005, 6:16pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/10 "2005-10-04T18:16:25Z")

</div>

Johan Kool wrote:

> My second attempt to send this file seems to have failed too.  
> SourceForge doesn’t accept zip files. Download the file here:  
> [http://sheba.geo.vu.nl/~jkool/filearea/GUI%20CSL.zip](http://sheba.geo.vu.nl/~jkool/filearea/GUI%20CSL.zip)
> 
> Just a plain and quick mockup for a CSL GUI in IB for OS X. Clearly not  
> finished…

Cool! Except, I can’t seem to get it to open right on my box.

While opening “GUI CSL.nib”, the following error occured:

\*\*\* -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of  
class (NSTokenField)

A screenshot perhaps?

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 6:34pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/11 "2005-10-04T18:34:40Z")

</div>

Missed a crucial part on this sentence:

There are 4 windows now. The most Mac way to switch between these,  
would, I think, be by using a toolbar with some nice icons. Like the  
preference windows in many OS X apps.

Johan

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 6:28pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/12 "2005-10-04T18:28:32Z")

</div>

Ah, you’ll need 10.4 for this.

Here are some screenshots:

There are 4 windows now. The most Mac way, would, I think, be by  
using a toolbar with some nice icons.

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/412d69aadb16e07108f39dcfaa6878914678de27.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/b14cd1dbacee91a553e1f31a0ed00eb50380bbd5.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/e72ec0ce500e9cf2124820e638d11885ea77f563.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/10b7feccc1a7abe8b8493c8e481886f3bd360460.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/a3709e962b24652657ae7701793e284d0b4aff5e.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/77f0d44b5bcfb22fa194c9fe86c20353379a90bc.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/2a3f4ae53404849a8bb203c9d75e5f33cb018a86.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/9e3848aee57bcd100a5889f7327ceeec52a130d5.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/3f83336ddfa55e53211900ce294120481eb2de92.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/82ad5dd733d7e1ce02756301cd262099934e9cbb.png)

---

<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:** [October 4, 2005, 7:00pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/13 "2005-10-04T19:00:15Z")

</div>

Really nice Johan!

So are you planning to develop this into something, or were you just  
playing with understanding how feasible it’d be?

One thing of note is how you’d handle the layout nesting. For example,  
your “Author” field should be:

creator  
name  
role

And then there’s the container element. How easy is that nesting to handle?

Bruce

PS - Mind if I blog about this and use a screenshot or two?

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 7:22pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/14 "2005-10-04T19:22:16Z")

</div>

> Really nice Johan!
> 
> So are you planning to develop this into something, or were you  
> just playing with understanding how feasible it’d be?

Not sure yet what I’ll do.

> One thing of note is how you’d handle the layout nesting. For  
> example, your “Author” field should be:
> 
> creator  
> name  
> role

Something like this?Op 4-okt-2005, om 20:00 heeft Bruce D’Arcus het volgende geschreven:

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/0ed8397e613b47e8b3c21d126d38d7962b80fedb.png)

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/56008338b497e056a5a2c47d08a2d9562cf85f1c.png)

---

<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:** [October 4, 2005, 7:38pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/15 "2005-10-04T19:38:35Z")

</div>

Johan Kool wrote:

> > One thing of note is how you’d handle the layout nesting. For  
> > example, your “Author” field should be:
> > 
> > creator  
> > name  
> > role
> 
> Something like this?

No, because the names and role are nested. One finds a similar thing  
with the origin field, in order to get (New York: ABC Books).

> I hope there can not be a container within a container? I can’t imagine  
> any journal wanting to have such a reference in its articles!

You certainly could for books: chapter, book, series.

I ask about this because I’ve considered whether it might make sense to  
reconsider this. There are definite advantages to this approach from a  
processing standpoint, because it makes it easy to handle punctuation.  
Going to a flat model would make some things more difficult. But it does  
become more tricky from a GUI perspective to keep it nested.

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:** [October 4, 2005, 8:02pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/16 "2005-10-04T20:02:17Z")

</div>

Oh, this page has a mockup I did in HTML of the nesting:

[http://xbiblio.sourceforge.net/csl.html](http://xbiblio.sourceforge.net/csl.html)

Just not sure how easy that it to program (in JS, or Cocoa, etc.) …

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 8:06pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/17 "2005-10-04T20:06:31Z")

</div>

> Johan Kool wrote:
> 
> > > One thing of note is how you’d handle the layout nesting. For  
> > > example, your “Author” field should be:
> > > 
> > > creator  
> > > name  
> > > role  
> > > Something like this?
> 
> No, because the names and role are nested. One finds a similar  
> thing with the origin field, in order to get (New York: ABC Books).

Then it’ll have to be a similar thing as I did with the container.

> > I hope there can not be a container within a container? I can’t  
> > imagine any journal wanting to have such a reference in its articles!
> 
> You certainly could for books: chapter, book, series.
> 
> I ask about this because I’ve considered whether it might make  
> sense to reconsider this. There are definite advantages to this  
> approach from a processing standpoint, because it makes it easy to  
> handle punctuation. Going to a flat model would make some things  
> more difficult. But it does become more tricky from a GUI  
> perspective to keep it nested.

It ain’t pretty, but it’s possible to program something like this:Op 4-okt-2005, om 20:38 heeft Bruce D’Arcus het volgende geschreven:

![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/39430fbd95423f5da677954c1ef92dc3b057c205.png)

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 9:36pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/18 "2005-10-04T21:36:52Z")

</div>

> Oh, this page has a mockup I did in HTML of the nesting:
> 
> [http://xbiblio.sourceforge.net/csl.html](http://xbiblio.sourceforge.net/csl.html)

The problem with your implementation is that I can only see the names  
of the deepest nested items. It’s important to show it, otherwise it  
can get very confusing. I did another little mockup. Basically the  
same, but more inspired by NSTokenField. It should handle nesting  
quite nicely, as I made sure that Name within Creator is of the same  
height. Otherwise you’ll get very odd things with big heights when  
using deeply nested structures.

The arrow indicates that there are actions to be performed on the  
item, such as adding other things and setting the fonts. It’s  
important to have shortcuts here, as it otherwise can get a tedious  
job to work it all with the mouse. The label “Creator” “Name” etc.  
should reflect the font settings. The label (and any non-used area,  
should be used for dragging and rearranging of the items.

The biggest drawback is that the amount of coding needed to create  
such widget.

 ![](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/732255bc2c51c7e4ff5a0e3675aa6f1ddfb336ed.png)

---

<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:** [October 4, 2005, 10:08pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/19 "2005-10-04T22:08:30Z")

</div>

Nice!

> The biggest drawback is that the amount of coding needed to create  
> such widget.

And is that because of the nesting, or just because it’s a  
non-standard widget that’s doing a fair bit of work?

I had pinged a guy working on some magic javascript stuff, including  
drag-and-dropable lists. Maybe I should see what he thinks about it  
WRT to JS, as he wanted to implement the hierarchcal dynamic lists  
this would need?

The problem with the flat approach is you need some funky way to then  
artifically (from an XML perspective) link content. I always hated  
the way Endnote handled that with it’s weird syntax.

Bruce

---

<div class="post-metadata">

**Author:** ![Johan\_Kool](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Johan\_Kool](https://discourse.citationstyles.org/u/Johan_Kool)\
**Post date:** [October 4, 2005, 10:28pm UTC](https://discourse.citationstyles.org/t/styling-design-question/103/20 "2005-10-04T22:28:35Z")

</div>

> Nice!
> 
> > The biggest drawback is that the amount of coding needed to create  
> > such widget.
> 
> And is that because of the nesting, or just because it’s a  
> non-standard widget that’s doing a fair bit of work?

A quick look at the NSTokenField documentation makes me believe that  
it should be possible to subclass it into something like we have in  
mind. It’s not the nesting that’s the problem, it is very possible to  
put a view in a view in a view. So the good news is that NSTokenField  
seems to be a good starting point. Might our requirements proof to be  
more than that, then it’s going to be a lot of work to implement the  
whole control.

I’ll fiddle around a bit with this NSTokenField idea.

> I had pinged a guy working on some magic javascript stuff, including  
> drag-and-dropable lists. Maybe I should see what he thinks about it  
> WRT to JS, as he wanted to implement the hierarchcal dynamic lists  
> this would need?

My JS is very limited. Not much more than copy-pasting interesting  
things together. But my guess would be that creating such a control  
in html and javascript (I think it should be called AJAX?) is very  
well possible. He probably can do it. I should be able to do the  
Cocoa one, I can’t do the JS one.

> The problem with the flat approach is you need some funky way to then  
> artifically (from an XML perspective) link content. I always hated  
> the way Endnote handled that with it’s weird syntax.

Endnote gets so much love from you!! 😉

JohanOp 4-okt-2005, om 23:08 heeft Bruce D’Arcus het volgende geschreven:
