CSL Month / Date Month

edited November 10, 2019
Hey, I rewrote an APA-code, so it suits for my University.

I have one Problem left: I need a way to get the following:
If there is a date with month:
Muster, M. (1996, 21. Mai). Titel Magazinartikel. Publikation, S. 12-13.
If there is only a month:
Muster, M. (1996, Mai). Titel Magazinartikel. Publikation, S. 12-13.

The first one is correct, with the second one I get:
Muster, M. (1996. Mai). Titel Magazinartikel. Publikation, S. 12-13.

I know I need to tell the Programm: if there is no date -> do this
But I'm no programmer, so I and 100 other students would be super happy for your help :)

This is my code:
  • edited November 10, 2019
    Sry, it was not displayed as desired…
    All lines that stop with >, begin with <

    macro name="issued">
    if type="bill legal_case legislation" match="any"/>
    else-if variable="issued">
    date variable="issued">
    date-part name="year"/>
    text variable="year-suffix"/>
    if type="article article-magazine article-newspaper broadcast interview pamphlet personal_communication post post-weblog treaty webpage" match="any">
    date variable="issued">
    date-part prefix=", " name="day"/>
    date-part prefix=". " name="month"/>
    !-- Only year: article-journal chapter entry entry-dictionary entry-encyclopedia dataset figure graphic motion_picture manuscript map musical_score paper-conference patent report review review-book song speech thesis -->
    else-if variable="status">
    text variable="status" text-case="lowercase"/>
    text variable="year-suffix" prefix="-"/>
    text term="no date" form="short"/>
    text variable="year-suffix" prefix="-"/>
  • Or is there a citation-style that already works this way? So I could include the code
  • The conditional to print "no date" or the "date" would look like this in it's minimal form:

    <macro name="date">
    <if match="any" is-uncertain-date="issued">
    <text term="no date"/>
    <date variable="issued">
    <date-part name="year"/>

    Adapt as necessary.
  • Thank you for your answer!

    Where do I need to add this? So far it hasn't changed anything when I tried. I also didn't find any hints in the forum how to do it...
  • edited December 16, 2019
    I gave you an example how this could be implemented in its minimal form.
    You can see a real example here. Lines 171... https://github.com/citation-style-language/styles/blob/master/academy-of-management-review.csl

    It all depends on the style you use. We'd need to see that to give better advice. You can upload your code to a code sharing tool like hastebin or pastebin and share the link here.
Sign In or Register to comment.