Edititng Style: Book: include Edition, Report: Name of the Series

edited February 17, 2021
Hello dear community,
I would like to have some slight additions to my style and I would appreciate some help a lot, as my attempts did not work.
1.
I would like books and book chapters to include the Edition in the bibliography. Example: (** means italicised)
[1] Borges, J. L.: *Selected Non-Fictions*. 3rd Edition. New York: Viking, 1999, p. 50-54.

2.
For Reports I want to include the Name of the Series left to the Report Number. Example:
[2] Ahlquist, J. S., Breuning, C.: *Country clustering in comparative political economy*. MPIfG Discussion Paper 09–5. Cologne: Max-Planck Institute for the Study of Societies, 2009, p. 30-33.

I tried to copy code from styles that include the previously mentioned information to (kind of) similar looking placed in my style, but usually the output did not change at all.
I hope some generous person can help me with these. You guys have been awesome so far.
--
This is what the code looks like:

<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl"; class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="de-DE">
<info>
<title>Acta Polytechnica Beuth mod</title>
<id>http://www.zotero.org/styles/acta-polytechnica Beuth mod</id>
<link href="http://www.zotero.org/styles/acta-polytechnica-bm"; rel="self"/>
<link href="http://www.cvut.cz/en/facilities/ph/ap/resolveuid/a1a4420631dd2b61eff7a823f4b4f949"; rel="documentation"/>
<author>
<name>Libor Ansorge</name>
<email>libor.ansorge@gmail.com</email>
</author>
<category citation-format="numeric"/>
<category field="engineering"/>
<issn>1210-2709</issn>
<eissn>1805-2363</eissn>
<summary>Style for journal Acta Polytechnica</summary>
<updated>2021-02-17T10:11:41+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="de">
<terms>
<term name="et-al">et al.</term>
<term name="accessed">Stand:</term>
</terms>
</locale>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" sort-separator=", " initialize-with="." delimiter-precedes-last="never" delimiter=", "/>
<label form="short" prefix=" "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
<macro name="container-author"/>
<macro name="year-date">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year" form="long"/>
</date>
</if>
<else>
<text term="no date"/>
</else>
</choose>
</macro>
<macro name="page">
<group delimiter=" ">
<text term="page" form="short"/>
<text variable="page"/>
</group>
</macro>
<macro name="issue">
<group delimiter=" " prefix="(" suffix=")"/>
</macro>
<citation collapse="citation-number" after-collapse-delimiter="; ">
<sort>
<key variable="citation-number"/>
</sort>
<layout prefix="[" suffix="]" delimiter=", ">
<text variable="citation-number"/>
<group delimiter=" ">
<label variable="locator" form="short" prefix=" "/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography entry-spacing="1" second-field-align="flush" et-al-min="3" et-al-use-first="1">
<sort>
<key variable="citation-number"/>
</sort>
<layout>
<text variable="citation-number" prefix="[" suffix="]"/>
<group delimiter=", " suffix=": ">
<text macro="author"/>
</group>
<choose>
<if type="book report" match="any">
<group delimiter=". " suffix=". ">
<text variable="title" font-style="italic"/>
<text variable="number"/>
<group delimiter=", ">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
<text macro="year-date"/>
</group>
</group>
</if>
<else-if type="paper-conference chapter" match="any">
<group delimiter=". " suffix=". ">
<text variable="title" font-style="italic"/>
<group delimiter=" ">
<group delimiter=": ">
<text term="in" text-case="capitalize-first"/>
<text variable="container-title"/>
</group>
<text variable="event"/>
<text macro="container-author" prefix="(" suffix=")"/>
</group>
<group delimiter=", ">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
<text macro="year-date"/>
<text macro="page"/>
</group>
</group>
</else-if>
<else-if type="article-journal article-magazine article-newspaper" match="any">
<group delimiter=". " suffix=". ">
<text variable="title"/>
<group delimiter=", ">
<text variable="container-title" form="short" font-style="italic"/>
<group delimiter=" ">
<text variable="volume" font-style="italic" font-weight="normal"/>
<text macro="issue"/>
</group>
<text macro="year-date"/>
<text macro="page"/>
</group>
</group>
</else-if>
<else-if type="webpage" match="any">
<group delimiter=". ">
<text variable="URL"/>
<group delimiter=": ">
<text term="accessed" text-case="capitalize-first"/>
<date variable="accessed" form="numeric"/>
</group>
</group>
</else-if>
<else>
<group delimiter=". " suffix=". ">
<text variable="title" font-style="italic"/>
<group delimiter=", ">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
<text macro="year-date"/>
<text variable="volume"/>
<text macro="page"/>
</group>
</group>
</else>
</choose>
</layout>
</bibliography>
</style>
  • edited February 17, 2021
    You know you can just continue in one of your other threads?
    Also, always easier for us to just upload the code to pastebin.com and post the link. Then we can just tell you the line number where to make changes and don't have to scroll up and down so much. ;)

    Anyway,...

    1. I would suggest to copy the edition macro from another style into your own style (e.g. https://www.zotero.org/styles/apa?source=1) and then call that macro where you need it via text macro="edition"/

    2. "MPIfG Discussion Paper" is stored in the variable "genre", so you'll need to call that.
  • edited February 17, 2021
    Thank you.
    I have now copied their edition macro in line 36-48. And added text macro = edition and text macro = genre in line 102 and 103 (idk why pastebin indents my edits so weirdly after creating the link. They are actually indented normaly).
    Still, the ouput has not changed. I assume, that I put the call in the wrong if type, as I dont know, if "book report" refers to a book or a report.
    Can you help me with this, please?
    https://pastebin.com/BzfqwSKm
    (Independent of this, https://validator.citationstyles.org/ finds 3 Errors in the code.)
    Edit: I mistook macro for variable, sorry!
  • edited February 17, 2021
    Formatting:
    You can use this: formatter.citationstyles.org/

    errors:
    error 1 is because you have a macro in your style that you have not called. The style will work in Zotero, but will tell you it's not a valid style when installing.
    error 2 is because you have an empty group which is not allowed.

    edition:
    You need to call the macro, not the variable in line 96. See my above comment where I told you how to. Then it'll work. (that conditional works for book OR report, so either of them. You're in the correct section)


  • I noticed my mistake with the macro/variable.
    I have now called the macro for edition and genre in Line 102 and 103, but still no change in output + 1 Error regarding the genre. Do I need to copy a genre macro of another style?
    https://pastebin.com/WarWiEab
  • edited February 17, 2021
    works for me. [3] Borges, J.L.: Selected non-fictions. New York, NY: Viking, 3. Aufl., 1999.

    You actually need to use an example that has the edition provided. In the Code/VisualEditor you need to use the Borges example. Otherwise, if you're doing it in the Editor within Zotero, make sure you item has edition data provided.


    replace that conditional with:

    <if type="book report" match="any">
    <group delimiter=". " suffix=". ">
    <text variable="title" font-style="italic"/>
    <group delimiter=" ">
    <text variable="genre"/>
    <text variable="number"/>
    </group>
    <group delimiter=", ">
    <group delimiter=": ">
    <text variable="publisher-place"/>
    <text variable="publisher"/>
    </group>
    <text macro="edition"/>
    <text macro="year-date"/>
    </group>
    </group>
    </if>
  • Habe den Code nun eingefügt und ein minimal etwas an der Reihenfolge angepasst, damit die Auflage direkt auf den Titel folgt.
    Der Grund warum ich dachte, dass die Auflage gar nicht erst funktioniert ist, dass er das nicht anzeigt, wenn es sich bei der Eintragsart um einen "Buchteil" (Quasi wie Buch mit Seitenzahl im Literaturverzeichnis) anstelle eines Buches handelt. Bekommt man das hin, dass er das auch bei einem Buchteil macht? Würde nämlich die Seitenzahlen ins Quellenverzeichnis packen und das geht bei Büchern nur via Buchteil.

    Bei Berichten meinte ich mit "Name of the Series" den "Titel der Reihe", nicht die "Art von Bericht". Wenn ich MPIfG... ins Feld "Titel der Reihe" eintrage, erscheint es nicht. Wenn ich es in "Art von Bericht" eintrage, fehlt das Leerzeichen zwischen Art von Bericht und Nummer des Berichts. Wie kriegt man das hin, dass das MPIfG... als Titel der Reihe im Literaturverzeichnis auftaucht (Vgl. [2])?

    Ich danke dir schonmal für die ganze Mühe und die Geduld!
    https://pastebin.com/pWsBXD1W
  • Book vs chapter:
    Ich glaube, da verstehst du noch nicht ganz, wie der Stil aufgebaut ist.
    Du hast im "bibliography" teil ein conditional, wo es die einzelnen Dokumenttypen behandelt. If book und report und darunter dann im else-if chapter und paper-conference.
    Dort musst du halt eben auch dein edition Makro aufrufen.

    https://aurimasv.github.io/z2csl/typeMap.xml#map-report schau dir das mal an.

  • edited February 17, 2021
    Ahh, danke dir!
    Habe jetzt den Code korrigiert. Das einzige Problemchen das ich noch habe ist, dass er komischerweise noch immer kein Leerzeichen zwischen "Titel der Reihe" und "Nummer des Berichts" macht (Vgl. [3]) . Muss man dafür einen Delimiter "" irgendwo einbauen, oder wie bekomm ich das Leerzeichen da hin?

    [3] Ahlquist, J.S., Breunig, C.: *Country Clustering in Comparative Political Economy*. MPIfG Discussion Paper09–5. Cologne: Max Planck Intitute for the Study of Societies, 2009.
    https://pastebin.com/aT1Kq8jP (Book-Report beginnt ab Zeile 93, text variable = collection-title in Zeile 98)
  • edited February 17, 2021
    Du musst halt auch ein Leerzeichen in den delimiter reinmachen:


    <group delimiter=" ">
    <text variable="collection-title"/>
    <text variable="number"/>
    </group>


    Aber wie oben gesagt, das "MPIfG Discussion Paper" sollte in einem anderen Feld in Zotero sein, dass dann per genre aufgerufen werden kann.
  • Okay, das war simpler als ich dachte... thank you, sir!
  • edited February 20, 2021
    Andere Frage:
    Wie bekommt man es hin, dass nach einem Satzzeichen im Titel kein Punkt gesetzt wird, sprich doppelte Satzzeichen vermieden werden (Vgl. [1] und [2])? Durch Löschen des Punktes im Suffix, Delimiter oder Prefix würde der Punkt ja bei allen Titeln entfallen, nicht nur bei denen mit Satzzechen am Ende.

    [1] Mares, I.: Firms and the Welfare State: When, Why, and How Does Social Policy Matter to Employers?. In: Sammelwerkname. New York: Oxford University Press 2001. S. 200–202.
    [2] Mares, I.: Firms and the Welfare State: When, Why, and How Does Social Policy Matter to Employers? In: Sammelwerkname. New York: Oxford University Press 2001. S. 200–202.

    Der Code: https://pastebin.com/QwnG9AFK
  • Das sollte eigentlich automatisch funktionieren und scheint hier an dem kursive gestzten Titel zu scheitern (wenn Du font-style="italic" löscht, verschwindet auch der zusäzliche Punkt.

    Das ist natürlich so nicht richtig und sollte nicht vom Schriftsatz abhängen.
  • edited February 21, 2021
    Danke fürs Aufklären. Falls die Information weiterhilft: Der "Ursprungs-Stil" (Acta Polytechnica) setzt scheinbar standardmäßig diesen Punkt bzw. hat dasselbe Problem:
    https://editor.citationstyles.org/styleInfo/?styleId=http://www.zotero.org/styles/acta-polytechnica

    Wenn es sich hierbei um einen Bug handelt (wonach es aussieht) und man das nicht selber beheben kann, wo kann man das melden?

    Scheinbar trat das Problem bereits vorher auf: https://forums.zotero.org/discussion/41934/suppressing-period-in-citations-with-other-punctuation
Sign In or Register to comment.