Need help on CSL syntax

Hello!

I am learning how to create Citation Styles. I encountered a few issues that I cannot solve. Here is an example of bibliography section what I am dissecting:

-------------------------------------------------------------------
<bibliography>
<option name="second-field-align" value="true"/>
<option name="entry-spacing" value="0"/>
<layout>
<text variable="citation-number" suffix="."/>
<text variable="title" prefix=" " suffix=". "/>
<text variable="container-title" form="short"/>
</layout>
</bibliography>
-------------------------------------------------------------------


It generates Bibliography in my case as follows:
-------------------------------------------------------------------
1. Protein-DNA recognition patterns and predictions. Annu Rev Biophys Biomol Struct
2. Computational redesign of endonuclease DNA binding and cleavage specificity. Nature
-------------------------------------------------------------------

1) The first question is what should be done so the abbreviated journal title will look like:
Annu. Rev. Biophys. Biomol. Struct.
(note periods at the end of each word)

I found an attribute: include-periods="true" but it did not help. Perhaps I used it wrongly.

2) There is a strange dependency between two above options in <bibliography> section. Somehow if I use only one option:
<option name="entry-spacing" value="0"/>

I get a spacing between lines in generated bibliography. Adding the second option:
<option name="second-field-align" value="true"/>

solves the problem but I do not not understand how these two are connected.

I would be grateful if someone could help me with these two issues.
  • 1) isn't there yet. What you have is the best currently possible: It takes the information from the "Journal Abbreviation" field in Zotero. The next version of CSL will allow you to strip away the periods, but that's it (note - only strip away, not add). Longterm a more advanced solution that makes use of different abbreviation lists is envisioned.

    no idea on 2)
  • edited October 18, 2009
    What's exactly the problem with 2)? Do you wish to remove the spacing between lines? If so, maybe adding this line will help:
    <option name="line-spacing" value="0"/>
  • -------------------------------------------------------------------
    <bibliography>
    <option name="line-spacing" value="0"/>
    <layout>
    <text variable="citation-number" suffix="."/>
    <text variable="title" prefix=" " suffix=". "/>
    <text variable="container-title" form="short"/>
    </layout>
    </bibliography>
    -------------------------------------------------------------------

    The code above generates the bibliography as shown below. There is an empty line between 1 and 2!
    -------------------------------------------------------------------
    1. Protein-DNA recognition patterns and predictions. Annu Rev Biophys Biomol Struct

    2. Computational redesign of endonuclease DNA binding and cleavage specificity. Nature
    -------------------------------------------------------------------

    Only combination of two options produces bibliography without empty lines.
    <option name="second-field-align" value="true"/>
    <option name="entry-spacing" value="0"/>

    This is something that I do not understand. I would never figure it out on my own. I found this combination of options in "Nature journal" style. Once you remove one of the options, strangely, you get empty lines in bibliography.
  • Yes the line-spacing is for spacing between the lines after say text wrapping in word
    But the entry-spacing is just like space for starting a new line as in some paragraphs spacing. so Value="0" is the least.
  • right- but vl_popatov points out is that this doesn't work as it should.
    Actual single spaced bibliographies should happen when you have both line-spacing=1 and entry-spacing=0 -but they don't - you also need second field align=true and that only works for numerical styles (everything else looks ridiculous). No idea why, but it's clearly a bug.
  • Ok great understand. what about this line <text variable="container-title" form="short"/> ?
    Does it really abbreviate? I was also in your line that it should. but I tried but has not. Or did not do it well
  • Good, this gives me a chance to inquire if you have an idea on a syntax for acronym.
  • container-title=short prints whatever is in the journal abbr. field.
    If you search for Journal Abbreviations on the forum you'll find very, very extensive discussions on this in the future and at least the seeds for this (maybe more) are going to be in csl 1.0.
    Because of the way this works in practice, having a syntax/algorythm that creates acronyms is neither feasible nor desirable. We should probably continue that part of the discussion in one of the relevant threads.
  • Ok and thanks.
Sign In or Register to comment.