Display only the first author in a homemade citation style

Hi,
I would like to program a macro which display something like that:
:FirstauthorYear:

e.g:
:Bliss1973:

But i can't find the command to display only the first author in <names/>

Thanks a lot,

P.S: Zotero is really a great software i love it !!!
  • For the name, I think you should be able to use something like this for that:
    <bibliography>
    <option name="et-al-min" value="2"/>
    <option name="et-al-use-first" value="1"/>
    <names variable="author">
    <name form="short"/>
    </names>
    </bibliography>

    But if you want first author in one location (for a label, say) and more authors elsewhere (in the actual cite), you'll be out of luck. The et al settings take effect for the whole environment (citation or bibliography) in which they are invoked.
  • Thanks a lot for the fast and clear response,
    but what i would like to obtain is something like that :

    : Brunel2004 : Brunel, N., Hakim, V., Isope, P., Nadal, J. & Barbour, B. Optimal Information Storage and the Distribution of Synaptic Weights Perceptron versus Purkinje Cell. Neuron 43, 745-757 (2004).

    And not that :

    : Brunel et al.2004 : Brunel, N. et al. Optimal Information Storage and the Distribution of Synaptic WeightsPerceptron versus Purkinje Cell. Neuron 43, 745-757 (2004).

    I know this citation index is weird (I use that for wikidot.com).

    To be more precise I would like a way to extract only the first name of the first author and not havint the et al. I don't know what is the best way but I thought that a macro named wikidot which i could add in every style i want would be really cool.
  • I see. Unfortunately, there's no way to do this currently. In a few months (early next year) a variable called "citation-label" will be available that does something like this. But for now, there's no way to extract just the name of the first author without the et al bit, and without messing up the et al handling for the main part of the cite.
  • Ok I will deal with that,
    Thank you again for your help. You're doing a really great job with Zotero ! I wish you very good luck.
    Thanks
    Romain
  • edited October 31, 2009
    Hello,
    My problem is similar. There are special requirements for bibliography in thesis.

    I need to place 2 sections related to authors within bibliography:
    1st - before title (exists only when number of authors < 4). Here only first author's name should be placed.
    2nd - after title. Here all authors' names (formatted not like in 1st section). If number of authors >= 4 then here after first-author should be [et al]

    Example:
    Stamou, A.I. Evaluation of thermal comfort in Galatsi Arena of the Olympics “Athens 2004” using a CFD model / A.I. Stamou, I. Katsiris, A. Schaelin // Applied Thermal Engineering. – 2008. – Vol. 28, № 10. – P. 1206–1215.

    So my Q are:
    1 - How to extract name of the first author to operate it independently (i.e. without et al)?
    2a - How to get total number of authors?
    2b - Is it possible to make condition like
    <choose>
    __<if number-of-authors >= 4>
    ____<text macro="no-1st-auth-section"/> <!--or now action here-->
    __</if>
    __<else>
    ____<text macro="1st-auth-section"/>
    __</else>
    </choose>

    P.S. I like Zotero very much! Hope some day people that develop bibliographic standards and instructions will provide ready-made styles :)
    P.P.S. Sorry I found no other way to make XML-code more readable except insertion of underscores.
  • none of this is currently possible, unfortunately.
  • Thank you for soon reply, adamsmith!
    I hope my Q1 will be solved soon as fbennett said above
    In a few months (early next year) a variable called "citation-label" will be available that does something like ... extract just the name of the first author without the et al
    But Q2a and Q2b...
    According to info at
    http://www.zotero.org/support/dev/csl_syntax_summary#conditionals
    today conditionals in CSL have limited functionality, IMHO.
    It would be great to be able to test the exact content of variables. It would really extend the use of fields like language, extra (note) and others.
    For example:
    if language = "EN" then accessed-date-text = "accessed date:"
    else-if language = "RU" then accessed-date-text = "дата обращения:"
    else-if language = "LNG3" then accessed-date-text = "accessed date in LNG3"
    and so on.

    So my new Q:
    Q3 - Where I can read more information on conditionals? Are there any detailed examples of usage?
    Q4 - Is there any hope that in nearest future conditionals will be able to test exact content of variables?
  • ...
    else-if language = "RU" then accessed-date-text = "дата обращения:"
    ...
    I wondered about this too, when I first encountered CSL. But it turns out that testing for variable content is not supported for some pretty sound reasons. CSL isn't a general-purpose programming language, it's just meant to provide a streamlined way of describing, in fairly exact terms, the logic of a citation style. To make the logic clear -- and portable from one style to another -- the language contains lots of very specific attributes and commands, each of which is useful only for a single rather specialized purpose.

    The effect of your example can actually be achieved using locale terms, in the current design of CSL, with less code and less risk of breakage than you would encounter when using a conditional. The CSL code would look like this:<text term="accessed"/>Locale terms are localized automatically, so in Russian, this would yield "вызвано". If you wanted a different phrase, it is possible to modify the locale term inside the style, for individual languages.
    So my new Q:
    Q3 - Where I can read more information on conditionals? Are there any detailed examples of usage?
    The documentation for CSL 1.0 will be much improved. You can preview drafts of the docs on http://citationstyles.org/. Although CSL 1.0 is not yet released, and not to be deployed in Zotero before early next year, this is the direction in which things are headed.
    Q4 - Is there any hope that in nearest future conditionals will be able to test exact content of variables?
    It's best to assume not, for the reasons given above -- it would cause many more problems than it would solve, in the long run.
  • @Alexius: We're looking into the problem of printing the first-listed name of an author under particular conditions. As adamsmith says, this isn't possible currently. Not sure when a solution will come, but the issue is on the table.
  • @ fbennett: thank you for substantial info!
    ...CSL isn't a general-purpose programming language, it's just meant to provide a streamlined way of describing, in fairly exact terms, the logic of a citation style. To make the logic clear -- and portable from one style to another -- the language contains lots of very specific attributes and commands, each of which is useful only for a single rather specialized purpose
    Well, I see that... I'm being interesting CSL nearly for a week... I've already understood that CSL 0.8 doesn't enable me to make the style I exactly need (mainly because of first author's name and necessity to apply formatting for it other then for all authors' list).
    We're looking into the problem of printing the first-listed name of an author under particular conditions. ... Not sure when a solution will come, but the issue is on the table.
    So I will wait with impatience!

    For current CSL version I found some tricks. For example, I can put lastname-firstname of 1st author under proper formatting into Extra field. But you know, I need to do several other tricks and currently I need to have a special field for every trick (to test whether it is empty or not). Unfortunately, extra field is only one :)
    So, I decide to wait as much as possible for new version of CSL with proper upgrade. But when my thesis will be finished (nearly 3 months) ... I'll have to choose certain way.
  • And BTW I think for the development of CSL it might be useful to point on the official Instruction of the Republic of Belarus defining the formatting of thesis and particularly bibliography:
    http://www.vak.org.by/modules/Files/pub/1256300485_1216279755_instr_oforml_2007-08-15.rar (written in Russian)
    Appendix 2 on page 21 contains wide list covering all types of sources that could be cited in thesis. If something won't be clear after machine translation, I can provide some comment. Well, one can understand the structure of bibliographic description almost without translation.
    The above mentioned Instruction is developed according to Intergovernmental Standard ГОСТ 7.1–2003 "Bibliographic record. Bibliographic description. General requirements and rules" (utilized in most countries of the former USSR, written in Russian). If somebody of CSL developers is interesting, I can find a link to it.
  • @ fbennett:
    The effect of your example can actually be achieved using locale terms...
    <text term="accessed"/>
    Let's consider example from http://www.zotero.org/support/dev/csl_syntax_summary#terms :

    <terms>
    <locale xml:lang="en">
    <term name="editor" form="verb-short">ed. by</term>
    <term name="editor" form="short">
    <single>edtr</single>
    <multiple>edtrs</multiple>
    </term>
    </locale>
    </terms>

    As I understand from above, in all bibliography items these terms will act like for "EN". May be I'm mistaken... Then how Zotero can understand the language of every separate bibliography item in its base? Through the language field? But testing for variable content is not supported... Well, I would appreciate for some more explanation about the use of terms.
  • You're right Zotero cannot detect the language of each item - it only looks for the language of your FF (or the one you have specified in your hidden preferences). I.e. you either have all entries saying дата обращения: or all entries saying date accessed:

    Is this really a common feature that you'd have terms in different languages in the same bibliography?
  • edited November 2, 2009
    Is this really a common feature that you'd have terms in different languages in the same bibliography
    Yes, indeed!
    Here is the quotation from the Instruction I mentioned above:
    Анализ источников, использованных при подготовке научной статьи, должен свидетельствовать о знании автором (авторами) статьи научных достижений в соответствующей области. В этой связи обязательными являются ссылки на работы других авторов. При этом должны присутствовать ссылки на публикации последних лет, включая зарубежные публикации в данной области.
    In a few words: Good scientific research should contain literature survey that covers sources all over the world.
    BTW, similar requirements were in USSR.

    For Russia that leads to the bibliography with minimum 2 languages: RU and EN.
    For Belarus (mostly for humanities) - 3 languages: Belarusian language, RU and EN.
    For engineering in Belarus quite enough 2 languages: RU and EN.

    So almost every student and researcher need to make bibliography using at least 2 languages.
  • yes, I understand that the sources should be international, my bibliographies tend to have 3 languages at least - but the question is: Should the _terms_ in the bibliography - i.e the part of the bibliography that doesn't literally cite something, but that adds information - such as "editor", "in", "accessed" be in that language.
    In the style's I'm using the answer is clearly "no".
    So for example, I would cite

    Beccaria, Luis. “El mercado de trabajo luego de la crisis. Avances y desafíos.” Pages 357-394 in Crisis, recuperacióny nuevos dilemas. La economía argentina 2002-2007. Edited by Bernardo Kosacoff. Santiago de Chile: CEPAL, 2007.

    or

    Pilotabschluss: Metaller legen Streit um Altersteilzeit bei - SPIEGEL ONLINE - Nachrichten - Wirtschaft. Available at: http://www.spiegel.de/wirtschaft/0,1518,576129,00.html [Accessed September 4, 2008].

    i.e. Spanish and German citations with English terms. The question is if there are really many styles that do that differently.
  • edited November 2, 2009
    OK, here are examples from Instruction:

    Статут Международного Суда // Организация Объединенных Наций [Электронный ресурс]. – 2005. – Режим доступа : http://www.un.org/russian/documen/basicdoc/statut.htm. – Дата доступа : 10.05.2005.

    Cryer, R. Prosecuting international crimes : selectivity and the international criminal law regime / R. Cryer // Peace Palace Library [Electronic resource]. – The Hague, 2003–2005. – Mode of access : http://catalogue.ppl.nl/DB=l/SET=3/TTL=ll/SHW?FRST=12. –
    Date of access : 04.01.2006.

    Seems that developers of Instruction didn't take into account automation :(
  • edited November 2, 2009
    @Alexius, We seem to have settled on a tentative solution for printing the first author and suppressing the leading author listing when the author list rises above a certain length, as required by your style. It will not be deployed until the new processor comes out, however, which will not be in time for your thesis; we're grateful for your input, but you may need to handle your citations the old fashioned way.

    Concerning the examples above, do the style guidelines permit the bibliography to be sectioned by language? It seems like it would be difficult to scan cites that mix languages in the explanatory glosses. If sectioning by language is possible, the new processor would be able to cope without too much extra trouble. If it is necessary to really tie the explanatory text to the language of the source as a general feature of the style, that's going to be difficult.
  • edited November 4, 2009
    We seem to have settled on a tentative solution for printing the first author and suppressing the leading author listing when the author list rises above a certain length, as required by your style.
    Yes, that's what I need. But there is one thing concerning addition of et al. It should be placed everywhere in bibliography in square brackets.
    Here are examples from Instruction (on different types of sources):
    For RU = [и др.]
    Культурология : учеб. пособие для вузов / С.В. Лапина [и др.] ; под общ. ред. С.В. Лапиной. – 2-е изд. – Минск : ТетраСистемс, 2004. – 495 с.

    Национальная стратегия устойчивого социально-экономического развития Республики Беларусь на период до 2020 г. / Нац. комис. по устойчивому развитию Респ. Беларусь ; редкол.: Л.М. Александрович [и др.]. – Минск : Юнипак, 2004. – 202 с.

    For Belarusian = [і інш.]
    Гісторыя Беларусі : у 6 т. / рэдкал.: М. Касцюк (гал. рэд.) [і інш.]. – Мінск : Экаперспектыва, 2000–2005. – Т. 3 : Беларусь у часы Рэчы Паспалітай (XVII–XVIII ст.) / Ю. Бохан [і інш.]. – 2004. – 343 с.

    For EN = [et al.]
    Caesium-137 migration in Hungarian soils / P. Szerbin [et al.] // Science of the Total Environment. – 1999. – Vol. 227, № 2/3. – P. 215–227.

    So, may be the decision is to use "et-al term" for <macro name="second-position-author"> just like you do for
    <macro name="first-position-author">
    <names variable="author">
    <name et-al-min="2" et-al-use-first="1" suppress-min="4" name-as-sort-order="first" sort-separator=", "/>
    <et-al term="and others"/>
    </names>
    </macro>
  • if I understand that correctly, that should be possible by defining et al to include the square brackets in the <terms> section of the style.
  • edited November 6, 2009
    Concerning the examples above, do the style guidelines permit the bibliography to be sectioned by language?
    Don't exactly understand what such sectioning is. May be below is answer:
    The Instruction allows 2 ways of numeration items in bibliography:
    1 - in the order of citing
    2 - alphabetically (in the order of 1st author's names and(or) titles).

    While using case 2 bibliography should be separated into 3 parts:
    2.1 - Items written with Cyrillic alphabet
    2.2 - Items written with Roman (=Latin) alphabet
    2.3 - Items written with other characters
  • if I understand that correctly, that should be possible by defining et al to include the square brackets in the section of the style.
    Probably yes... You know better :)
  • If it is necessary to really tie the explanatory text to the language of the source as a general feature of the style...
    Well, yes it is.

    I've looked through standard 7.1-2003 and found something like that:
    Language of the bibliographic description, as a rule, corresponds to the language of the source document. Separate elements in the description can be resulted in the language of establishment that makes bibliographing.
    Well, I'm not an establishment that makes bibliographing :)

    Also, the Instruction I mentioned above says:
    Bibliography should correspond to examples according to the appendix 2.
    Appendix 2 contains examples in RU, BE (Belarusian) and EN.
    Several examples I've already posted above...
  • My bibliography will contain sources only in RU and EN.
    Let's consider alphabetical sorting of bibliography ( mentioned there in case 2).
    The problem is that default computer sorting will give inappropriate result:
    All EN items will be on the top of the list while RU items will go to the bottom.
    Is it possible to make descending sorting for languages to achieve RU before EN, while ascending sorting within language section (А-Я for RU and A-Z for EN)?

    @ fbennett: (in order to understand clearly)
    ...until the new processor comes out
    Do you mean the release date of CSL 1.0?
  • yes, that's what he means.
    Generally, if there are "sectioned" bibliographies - e.g. one for Russian titles, one for English ones, you should be able to determine the order, independent of the alphabetical sorting.
    Frank also suggests that that would make it easier to use different languages for the bibliographic description.
  • OK, "sectioned" bibliography will make it possible to tie the explanatory text to the language of the source, but for the case of alphabetical sorting only.
    For the case when items in bibliography are sorted in the order of citing, i.e.
    <sort>
    <key variable="citation-number"/>
    </sort>
    the question is still on.
    And I got the idea how to solve it. Now there is a usual field called Language. But in order to let user to pick the desirable language of the explanatory text for that very item, it would be nice to have a dropdown list box. Especially when source's data are represented with some mix of languages and language auto detection may fail. The list box might contain either all possible languages or only several, specified by user in Zotero preferences.
    I hope that my idea will correspond to the philosophy of Zotero and CSL development and will be useful.
  • The questions raised by Alexius here have come up again in a discussion I'm having with some Russian Zotero users.

    The requirements are the same-- terms need to match the language of the source, bibliographies need to be sectioned by source language. Neither is going to happen for Zotero 2.1, presumably, but can someone point me to appropriate bugs/threads for the CSL/XBiblio discussions, or should I raise that there myself?
  • edited February 5, 2011
    Flipping between locales (and even whole styles) according to the language tag of the reference is implemented in citeproc-js. There are a couple of illustrative tests here:

    https://bitbucket.org/fbennett/citeproc-js/src/44a634db9054/tests/fixtures/local/language_BaseLocale.txt

    https://bitbucket.org/fbennett/citeproc-js/src/44a634db9054/tests/fixtures/local/language_InterCiteJoins.txt

    The stylesheets are not valid CSL, and vanilla Zotero doesn't yet pass the language variable to the processor, but it could be hooked up anytime.
  • I know it's been a while, but to answer the original question, you can try using et al. with this:
    <term name="et-al"></term>
    So that et al. will not appear in your citation or bibliography.
Sign In or Register to comment.