Sorry for the fuzzy subject, I'm not sure how to describe it in a few words.
The particular use case is not a big deal, but I would like to know
what's going on (looks like a potential bug in citeproc-js or I've
missed something).
Using the attached file without changes citeproc-js returns:
------
<div class="csl-bib-body">
<div class="csl-entry"> @article{ Family01_2008, title={Some title},
year={2008}, month={Jan}}</div>
</div>
------
(I was expecting to have "author={ Family01, Given01}" before the year).
If I delete the line 48:
<text macro="author-short" text-case="lowercase"/>
citeproc-js returns:
-------
<div class="csl-bib-body">
<div class="csl-entry"> @article{2008, title={Some title}, author={
Family01, Given01}, year={2008}, month={Jan}}</div>
</div>
-------
Notice that the "author=" appears and the "citekey" before the year disappears.
[ I don't think that the best approach to generate BibTeX is using
CSL, but can be handy :-) -and useful to train citeproc-js - .Even a
style to generate a nice HTML formatted code, CSV, SQL statements,
etc., could be generated if needed, with many limitations. ]
--
Carles Pina | Software Engineer
http://www.mendeley.com/profiles/Carles-Pina/
Mendeley Limited | London, UK | www.mendeley.com
Registered in England and Wales | Company Number 6419015
> On Nov 11, 2:50 am, Carles Pina <carles.p...@mendeley.com> wrote:
>> Hi,
>>
>> Sorry for the fuzzy subject, I'm not sure how to describe it in a few words.
>>
>> The particular use case is not a big deal, but I would like to know
>> what's going on (looks like a potential bug in citeproc-js or I've
>> missed something).
>
> A name variable rendered through cs:names can only appear once in an
> item, by design. A macro might render a name via cs:substitute, and a
> subsequent macro might attempt to call the same variable later in the
> cite. The suppression behavior provides a compact conditional
> mechanism. I think it predates the introduction of cs:choose into CSL
> (that was before my time), but it works quite well for normal use
> cases.
Zotero 2.0.x used to exclude any names or other variables that were rendered during substitution. If a style didn't use cs:substitute or if the substitution wasn't triggered, there was no limit to the number of times a name variable could be rendered. I don't have really have strong feelings about this, since BibTeX export through CSL is a bit of an edge case and for every bibliographic style I can think of, this shouldn't be a problem.
Is a canonical behavior documented in the schema now? I glanced at it and couldn't find anything obvious, but maybe I'm missing something. If not, it's probably ultimately my fault.
Simon
On 13 November 2010 01:35, Frank Bennett <bierc...@gmail.com> wrote:
>> I'll eventually get this right. :) The citeproc-js code behind
>> cs:substitute is a little convoluted, but I should be able to
>> replicate the original behavior. Will put it on the todo list.
>
> Done and committed.
Yes, in 1.0.71 right? I tested it and everything all right. Thanks
--
Carles Pina | Software Engineer