citation-style-language / styles

Official repository for Citation Style Language (CSL) citation styles.
https://citationstyles.org/
3.27k stars 3.75k forks source link

macros help #3291

Closed n-osennij closed 5 years ago

n-osennij commented 6 years ago

Hi! I try ty make csl styles. And I have a litle problem.

If more then 3 authors

Title / First_Author [et al.]

If less

First_Author / Title / All_Authors

How can I do this?

<bibliography et-al-min="4" et-al-use-first="1">
...

<group delimiter="&#160;/&#160;">
    <text macro="author"/>
    <text variable="title"/>
    <text macro="author"/>
</group>

<macro name="author">
    <names variable="author">
        <name initialize-with="."/>
    </names>
</macro>
POBrien333 commented 6 years ago

Hey. Could you post the complete code?

n-osennij commented 6 years ago

@POBrien333 Hi! My code is here - https://github.com/n-osennij/vak_belarus_2018

Citation example:

1-3 authors

citation

Lind, H. Raman spectroscopy of thin-film silicon on woven polyester / H. Lind, J. Wilson, R. Mather // Physica Status Solidi. A. – 2011. – Vol. 208, № 12. – P. 2765–2771.

structure

Author Title / Author // Publication. – Date. – Volume, Issue. – Pages. No dach between Author and Title

4 and more authors

citation

Raman spectroscopy of thin-film silicon on woven polyester / H. Lind [et al.] // Physica Status Solidi. A. – 2011. – Vol. 208, № 12. – P. 2765–2771.

structure

Title / Author // Publication. – Date. – Volume, Issue. – Pages.

POBrien333 commented 6 years ago

@rmzelle and @adam3smith as far as I understand one can't actually disambiguate citations with 1-3 or 4+ authors with CSL. Is that correct?

adam3smith commented 6 years ago

That's correct; the above isn't possible in CSL

POBrien333 commented 6 years ago

Thanks Adam. In that case, if you really need such a style, the only thing is to unlink the citations in your document and then change them manually afterwards. Laborious and you can't go back then.

n-osennij commented 6 years ago

@POBrien333 and @adam3smith I found some solution, but not fully understand how it works. Can you help with it? Correct some mistakes?

Macroses

  <macro name="author-title">
    <names variable="author" suffix=". ">
      <name et-al-min="2" et-al-use-first="1" suppress-min="4" initialize-with="." font-style="normal" name-as-sort-order="first" sort-separator=",&#160;"/>
      <et-al term="and others"/>
    </names>
    <text variable="title"/>
  </macro>
  <macro name="second-position-authors-only">
    <names variable="author">
      <label form="short" prefix=" " suffix=". " text-case="lowercase" strip-periods="true"/>
      <name et-al-min="4" et-al-use-first="1" delimiter=", " initialize-with="."/>
    </names>
  </macro>

Call

<if type="article-journal" match="any">
    <group delimiter="&#160;//&#160;">
        <group delimiter="&#160;/&#160;">
            <text macro="author-title"/>
            <text macro="second-position-authors-only"/>
        </group>
        <group delimiter=".&#160;&#8211;&#160;">
            <text variable="container-title"/>
            <date variable="issued">
                <date-part name="year"/>
            </date>
            <group delimiter=",&#160;">
                <text variable="volume"/>
                <text variable="issue"/>
            </group>
            <text variable="page"/>
        </group>
    </group>
</if>

Results

1-3 authors

Wramsby, M.L. Primary habitual abortions are associated with high frequency of factor V Leiden mutation / M.L. Wramsby, M. Sten-Linder, K. Bremme // Fertil. Steril. – 2000. – Vol. 74, № 5. – P. 987-991.

4 and more authors

Primary habitual abortions are associated with high frequency of factor V Leiden mutation / M.L. Wramsby [et al.] // Fertil. Steril. – 2000. – Vol. 74, № 5. – P. 987-991.

bwiernik commented 6 years ago

“suppress-min” and “suppress-max” are not officially part of CSL. They are part of the extended version of CSL used by the Juris-M program. Zotero and Juris-M use the same citation processor, so a style using them should work, but such a style won’t be accepted on the repository here.

n-osennij commented 6 years ago

@bwiernik ok. I see. But how can I solve my problem using official parts of CSL?

bwiernik commented 6 years ago

As @adam3smith says above, it is not possible.

stale[bot] commented 5 years ago

This issue hasn't seen any activity in the past 30 days. It will be automatically closed if no further activity occurs in the next two weeks.

rmzelle commented 5 years ago

(for posterity, this requirement is detailed at http://www.vak.org.by/bibliographicDescription, the website of the "Higher Attestation Commission of the Republic of Belarus"; see also https://en.wikipedia.org/wiki/Higher_Attestation_Commission for background on this type of institution)