How can I use special characters in a csl style, e.g. the non-breaking space or a m-dash? I'd like to use e.g. the non-breaking space between the prefix "S." and the page numbers.
CSL is written in XML, so numeric entities should work. A non-breaking space would look something like this:<text variable="locator" prefix="&#x00A0;"/>Note that you need to use numeric character references for most things, rather than named entities. Wikipedia (among other sources) has a list of codes.
I am new to modifying CSL. I would like to use hard returns within a citation, and I'm having difficulty finding the correct code that Word will correctly interpret. When I use suffix="& # x 0 D;" (without the spaces, of course) Word returns "\line". Can anyone help? Thanks.
I'm not sure what you're trying to do, could you give an example of how you want things to look? in general, try <...suffix=" "/> including the line break.
The code I tried appended suffix="& # x 0 D;" to, for example: <text macro="title" suffix="& # x 0 D;"/> <text macro="container" suffix="& # x 0 D;"/> <text macro="access" suffix="& # x 0 D;"/> <text variable="URL" suffix="& # x 0 D;"/>
Returns in Word: title\linecontainer\lineaccess\lineURL\line
Instead of what I want: title container access URL
OK, I'm getting closer. Now with using 'display="block"', I'm closer to what I want; however, the citation is displaying with "_" before each field that follows author.
Like adamsmith I'm not sure why this didn't work for you before. For me, both
the xml code and suffix="
"
work without a problem. Have you tried debugging your style to check it's not got other problems which are stopping your citations from displaying properly?
the spaces need to be there so he can display the xml code in the forum, I'm sure that's the only reason they're there.
Thomas, just to makes sure we're on the same page, if you try this in the test pane:
chrome://zotero/content/tools/csledit.xul
it looks OK, right? James - do you have Word? Have you tried this in Word?
oh wait - which Zotero version are you using? and which plugin?
I noticed that when I installed the updated CSL but did not restart Word, the formatting did not occur as I expected. I only noticed this after toggling codes on the citation field, and seeing the garbage it was putting between fields. After updating the CSL, reinstalling it, exiting and restarting Word, this is the code that formatted the citation correctly:
I realize there are other problems - particularly, the date (access) is not displaying at all - but I think perhaps it'd be best that I fumble with this myself rather than publicly embarrass myself further. :-/
<text variable="locator" prefix="&#x00A0;"/>
Note that you need to use numeric character references for most things, rather than named entities. Wikipedia (among other sources) has a list of codes.in general, try
<...suffix="
"/>
including the line break.
title
author
publication
publication-date
URL
The code I tried appended suffix="& # x 0 D;" to, for example:
<text macro="title" suffix="& # x 0 D;"/>
<text macro="container" suffix="& # x 0 D;"/>
<text macro="access" suffix="& # x 0 D;"/>
<text variable="URL" suffix="& # x 0 D;"/>
Returns in Word:
title\linecontainer\lineaccess\lineURL\line
Instead of what I want:
title
container
access
URL
<text macro="title" suffix="
"/>
<text macro="container" suffix="
"/>
<text macro="access" suffix="
"/>
<text variable="URL" suffix="
"/>
exactly like that. Works for me.
edit: ooh wait, so does your solution... so maybe something else is going on.
I don't know whether it makes a difference, but I am using MS Word 2003 SP 3.
The code is:
<citation>
<option name="et-al-min" value="99"/>
<option name="et-al-use-first" value="1"/>
<layout delimiter=" " display="block">
<group delimiter=" ">
<choose>
<if variable="author editor translator" match="any">
<group delimiter=" ">
<text macro="author" display="block"/>
</group>
</if>
<else>
<text variable="locator" prefix=" " display="block"/>
<text macro="title" display="block"/>
</else>
</choose>
<text macro="title" display="block"/>
<text macro="container" display="block"/>
<text macro="access" display="block"/>
<text variable="URL" display="block"/>
</group>
</layout>
</citation>
Would appreciate any assistance!! Thanks.
the xml code and suffix="
"
work without a problem. Have you tried debugging your style to check it's not got other problems which are stopping your citations from displaying properly?
Thomas, just to makes sure we're on the same page, if you try this in the test pane:
chrome://zotero/content/tools/csledit.xul
it looks OK, right? James - do you have Word? Have you tried this in Word?
oh wait - which Zotero version are you using? and which plugin?
I also know that line breaks in bibliographies worked fine in Zotero 1.0 and MS Word because I wrote a style that used them.
<citation>
<option name="et-al-min" value="99"/>
<option name="et-al-use-first" value="1"/>
<layout delimiter=" " display="block">
<group delimiter=" " display="block">
<choose>
<if variable="author editor translator" match="any">
<group delimiter=" ">
<text macro="author"/>
</group>
</if>
</choose>
<text macro="title" display="block"/>
<text macro="container" display="block"/>
<text macro="access" display="block"/>
<text variable="URL" display="block"/>
</group>
</layout>
</citation>
I realize there are other problems - particularly, the date (access) is not displaying at all - but I think perhaps it'd be best that I fumble with this myself rather than publicly embarrass myself further. :-/