public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Divergent styling when using CSL in pandoc(?)
@ 2022-05-20 11:00   ` John Carter Wood
       [not found]     ` <0daa1a20-d847-47f5-a465-708c7875ff8an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John Carter Wood @ 2022-05-20 11:00 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2395 bytes --]

I have been working on creating a CSL style for the publication house-style 
at my institution: I've been making progress adapting another style but am 
running into a few issues that seem to only crop up when using the CSL 
during a document transformation with pandoc (version 2.18, with CSL file 
specified in a YAML block). In the preview for the visual editor they look 
OK and when I insert them via Zotero's connector into a LibreOffice / Word 
document they look fine too; however, when I create the docx via pandoc 
there are unwanted variations on a few points

There are a few issues, but the format for items in collections seems to be 
the main one. 

Here is a screenshot of the same citation: the one on top (which formats 
incorrectly) was created by using pandoc. The one on the bottom (which 
formats correctly) was directly inserted into the document using Zotero's 
functionality in LibreOffice. 
[image: CSL-pandoc-issues.png]

The problems: 
1. et al. is capitalising
2. (ed.) is capitalising
3. the p./pp. contextualisation isn't working right: using pandoc, when the 
locator is a single page, *the page range for the whole citation* revert to 
a single "p.", even when it should be plural; if the locator is more than 
one page, then "pp." appears in both, as it should. 

As I said, when looking at style using the example citations in the visual 
editor at for CSL (https://editor.citationstyles.org/visualEditor/), it 
also looks right (as in the second cite.)

[image: CSL-IEG-Visual-Editor.png]

I am running into a few other challenges with working out CSL, but since 
this one seems to specifically relate to using pandoc (which is my main 
workflow, as I write in Markdown), I thought I would ask here whether this 
is a known issue, whether I'm doing something wrong and whether there's a 
way to solve this. 

Here, for reference, is my CSL file (which is still a work in progress): 

https://pastebin.com/xefmukzw

Thanks in advance for any help. 

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3029 bytes --]

[-- Attachment #2: CSL-pandoc-issues.png --]
[-- Type: image/png, Size: 39492 bytes --]

[-- Attachment #3: CSL-IEG-Visual-Editor.png --]
[-- Type: image/png, Size: 39430 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]     ` <0daa1a20-d847-47f5-a465-708c7875ff8an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-05-20 11:32       ` John Carter Wood
  2022-05-20 13:42       ` Bastien DUMONT
  1 sibling, 0 replies; 12+ messages in thread
From: John Carter Wood @ 2022-05-20 11:32 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2670 bytes --]

I didn't really make clear enough in the original post: with pandoc in 
these cases I'm going from Markdown to docx. Sorry. 

John Carter Wood schrieb am Freitag, 20. Mai 2022 um 13:00:49 UTC+2:

> I have been working on creating a CSL style for the publication 
> house-style at my institution: I've been making progress adapting another 
> style but am running into a few issues that seem to only crop up when using 
> the CSL during a document transformation with pandoc (version 2.18, with 
> CSL file specified in a YAML block). In the preview for the visual editor 
> they look OK and when I insert them via Zotero's connector into a 
> LibreOffice / Word document they look fine too; however, when I create the 
> docx via pandoc there are unwanted variations on a few points
>
> There are a few issues, but the format for items in collections seems to 
> be the main one. 
>
> Here is a screenshot of the same citation: the one on top (which formats 
> incorrectly) was created by using pandoc. The one on the bottom (which 
> formats correctly) was directly inserted into the document using Zotero's 
> functionality in LibreOffice. 
> [image: CSL-pandoc-issues.png]
>
> The problems: 
> 1. et al. is capitalising
> 2. (ed.) is capitalising
> 3. the p./pp. contextualisation isn't working right: using pandoc, when 
> the locator is a single page, *the page range for the whole citation* 
> revert to a single "p.", even when it should be plural; if the locator is 
> more than one page, then "pp." appears in both, as it should. 
>
> As I said, when looking at style using the example citations in the visual 
> editor at for CSL (https://editor.citationstyles.org/visualEditor/), it 
> also looks right (as in the second cite.)
>
> [image: CSL-IEG-Visual-Editor.png]
>
> I am running into a few other challenges with working out CSL, but since 
> this one seems to specifically relate to using pandoc (which is my main 
> workflow, as I write in Markdown), I thought I would ask here whether this 
> is a known issue, whether I'm doing something wrong and whether there's a 
> way to solve this. 
>
> Here, for reference, is my CSL file (which is still a work in progress): 
>
> https://pastebin.com/xefmukzw
>
> Thanks in advance for any help. 
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7eba7c69-7dae-4f82-92ac-6e98b3bcb639n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4118 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]     ` <0daa1a20-d847-47f5-a465-708c7875ff8an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-05-20 11:32       ` John Carter Wood
@ 2022-05-20 13:42       ` Bastien DUMONT
  2022-05-20 14:56         ` John Carter Wood
  2022-05-20 18:45         ` AW: " denis.maier-NSENcxR/0n0
  1 sibling, 2 replies; 12+ messages in thread
From: Bastien DUMONT @ 2022-05-20 13:42 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

When testing your CSL file, you should be aware that Zotero and (I guess) the Visual Editor rely on citeproc-js, which is not fully compliant with the CSL specification. Sometimes, Pandoc is right against them. For instance, if I remember well, the default value for the "match" attribute is "any" in citeproc-js, although it should be "all" (as it is in Pandoc). On the other hand, the specification does not define the expected behaviour for all cases. The issue documented by your first screenshot is a good example of that. The "title" macro is called on l. 332 with the attribute text-case="title", but the <text> element on l. 117 included in this macro has text-case="lowercase": which one should have the precedence? Unless I have missed something, the CSL specification does not define that, so Pandoc applies the attribute value set on the upper-most element and citeproc-js that of the inner-most element. Neither is wrong, so the only solution is to avoid such conflicts in your stylesheet (e.g. by removing the attribute on l. 332).

As for the issue with "p./pp.", I guess that the problem is in your Markdown input, but I can't be sure. Could you provide a minimal sample MD file with a stylesheet and a bibliography?

Le Friday 20 May 2022 à 04:00:49AM, John Carter Wood a écrit :
> I have been working on creating a CSL style for the publication house-style at
> my institution: I've been making progress adapting another style but am running
> into a few issues that seem to only crop up when using the CSL during a
> document transformation with pandoc (version 2.18, with CSL file specified in a
> YAML block). In the preview for the visual editor they look OK and when I
> insert them via Zotero's connector into a LibreOffice / Word document they look
> fine too; however, when I create the docx via pandoc there are unwanted
> variations on a few points
> 
> There are a few issues, but the format for items in collections seems to be the
> main one.
> 
> Here is a screenshot of the same citation: the one on top (which formats
> incorrectly) was created by using pandoc. The one on the bottom (which formats
> correctly) was directly inserted into the document using Zotero's functionality
> in LibreOffice.
> CSL-pandoc-issues.png
> 
> The problems:
> 1. et al. is capitalising
> 2. (ed.) is capitalising
> 3. the p./pp. contextualisation isn't working right: using pandoc, when the
> locator is a single page, *the page range for the whole citation* revert to a
> single "p.", even when it should be plural; if the locator is more than one
> page, then "pp." appears in both, as it should.
> 
> As I said, when looking at style using the example citations in the visual
> editor at for CSL (https://editor.citationstyles.org/visualEditor/), it also
> looks right (as in the second cite.)
> 
> CSL-IEG-Visual-Editor.png
> 
> I am running into a few other challenges with working out CSL, but since this
> one seems to specifically relate to using pandoc (which is my main workflow, as
> I write in Markdown), I thought I would ask here whether this is a known issue,
> whether I'm doing something wrong and whether there's a way to solve this.
> 
> Here, for reference, is my CSL file (which is still a work in progress):
> 
> https://pastebin.com/xefmukzw
> 
> Thanks in advance for any help.
> 
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com.
> 
> References:
> 
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&utm_source=footer



-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/Yoea0AfkWCp%2B6FGe%40localhost.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
  2022-05-20 13:42       ` Bastien DUMONT
@ 2022-05-20 14:56         ` John Carter Wood
       [not found]           ` <e4cef3f2-bf3f-4359-87b7-61f9f3309670n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-05-20 18:45         ` AW: " denis.maier-NSENcxR/0n0
  1 sibling, 1 reply; 12+ messages in thread
From: John Carter Wood @ 2022-05-20 14:56 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 5605 bytes --]

Thank you!

That's a helpful explanation. My own workflow is based on Markdown / 
Pandoc, so that's the "right" version as far as I'm concerned. :-) 

I removed the attribute as you suggested, but the et al. and ed. are still 
being capitalised in the notes (though not in the bibliography...I feel 
like this should help, but this is my first escapade with re-writing CSL, 
so this insight hasn't brought me any further). 

I have attached an .md file, a .json bibliography and a new version (19) of 
the .csl file (that includes the change you suggested in the last version).

The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IEG-2-19.docx 
--citeproc --lua-filter pandoc-quotes.lua"

The bibliography is specified in the YAML header.

I hope I have done all this right. 


Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2:

> When testing your CSL file, you should be aware that Zotero and (I guess) 
> the Visual Editor rely on citeproc-js, which is not fully compliant with 
> the CSL specification. Sometimes, Pandoc is right against them. For 
> instance, if I remember well, the default value for the "match" attribute 
> is "any" in citeproc-js, although it should be "all" (as it is in Pandoc). 
> On the other hand, the specification does not define the expected behaviour 
> for all cases. The issue documented by your first screenshot is a good 
> example of that. The "title" macro is called on l. 332 with the attribute 
> text-case="title", but the <text> element on l. 117 included in this macro 
> has text-case="lowercase": which one should have the precedence? Unless I 
> have missed something, the CSL specification does not define that, so 
> Pandoc applies the attribute value set on the upper-most element and 
> citeproc-js that of the inner-most element. Neither is wrong, so the only 
> solution is to avoid such conflicts in your stylesheet (e.g. by removing 
> the attribute on l. 332).
>
> As for the issue with "p./pp.", I guess that the problem is in your 
> Markdown input, but I can't be sure. Could you provide a minimal sample MD 
> file with a stylesheet and a bibliography?
>
> Le Friday 20 May 2022 à 04:00:49AM, John Carter Wood a écrit :
> > I have been working on creating a CSL style for the publication 
> house-style at
> > my institution: I've been making progress adapting another style but am 
> running
> > into a few issues that seem to only crop up when using the CSL during a
> > document transformation with pandoc (version 2.18, with CSL file 
> specified in a
> > YAML block). In the preview for the visual editor they look OK and when I
> > insert them via Zotero's connector into a LibreOffice / Word document 
> they look
> > fine too; however, when I create the docx via pandoc there are unwanted
> > variations on a few points
> > 
> > There are a few issues, but the format for items in collections seems to 
> be the
> > main one.
> > 
> > Here is a screenshot of the same citation: the one on top (which formats
> > incorrectly) was created by using pandoc. The one on the bottom (which 
> formats
> > correctly) was directly inserted into the document using Zotero's 
> functionality
> > in LibreOffice.
> > CSL-pandoc-issues.png
> > 
> > The problems:
> > 1. et al. is capitalising
> > 2. (ed.) is capitalising
> > 3. the p./pp. contextualisation isn't working right: using pandoc, when 
> the
> > locator is a single page, *the page range for the whole citation* revert 
> to a
> > single "p.", even when it should be plural; if the locator is more than 
> one
> > page, then "pp." appears in both, as it should.
> > 
> > As I said, when looking at style using the example citations in the 
> visual
> > editor at for CSL (https://editor.citationstyles.org/visualEditor/), it 
> also
> > looks right (as in the second cite.)
> > 
> > CSL-IEG-Visual-Editor.png
> > 
> > I am running into a few other challenges with working out CSL, but since 
> this
> > one seems to specifically relate to using pandoc (which is my main 
> workflow, as
> > I write in Markdown), I thought I would ask here whether this is a known 
> issue,
> > whether I'm doing something wrong and whether there's a way to solve 
> this.
> > 
> > Here, for reference, is my CSL file (which is still a work in progress):
> > 
> > https://pastebin.com/xefmukzw
> > 
> > Thanks in advance for any help.
> > 
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email
> > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [2]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com.
> > 
> > References:
> > 
> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2] 
> https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&utm_source=footer
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 8034 bytes --]

[-- Attachment #2: CSL-Test-2.md --]
[-- Type: text/markdown, Size: 920 bytes --]

---
title: CSL-Test-2 
subtitle: Minimal CSL file 
author: PD Dr. John Carter Wood
bibliography: /home/john/Documents/libraries/CSL-minimal-test.json
csl: /home/john/Documents/csl/ieg-2-en-19.csl
lang: en-GB
quot-lang: da
header-includes:
 - \usepackage{csquotes}
---
# Introduction
Lorem ipsum dolor sit amet, consectetuer adipiscing elit [@latourette_community_1938, 15].  Donec "hendrerit tempor tellus" [@oldham_responsible_1948].  Donec pretium posuere tellus [@latourette_community_1938, 10-12].  Proin quam nisl, "tincidunt et, 'mattis eget', convallis nec, purus" [@muller_european_2011, 585].  Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.  Nulla posuere [@muller_european_2011, 586-587].  Donec vitae dolor.  Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.  Nam vestibulum accumsan nisl [@mumford_technics_1934, 45].

# Bibliography
			

[-- Attachment #3: CSL-minimal-test.json --]
[-- Type: application/json, Size: 4029 bytes --]

[-- Attachment #4: ieg-2-en-19.csl --]
[-- Type: application/octet-stream, Size: 12511 bytes --]

<?xml version="1.0" encoding="utf-8"?>
<style class="note" version="1.0" et-al-min="4" et-al-use-first="1" et-al-subsequent-min="4" et-al-subsequent-use-first="1" page-range-format="expanded" default-locale="en-GB" xmlns="http://purl.org/net/xbiblio/csl">
  <!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
  <info>
    <title>IEG-2-en</title>
    <id>http://www.zotero.org/styles/ieg-2-en</id>
    <link rel="self" href="http://www.zotero.org/styles/ieg-2-en"/>
    <category citation-format="note"/>
    <category field="humanities"/>
    <updated>2022-05-11T13:18:17+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="en">
    <terms>
      <term name="cited">op. cit.</term>
      <term name="editor" form="short">
        <single>ed.</single>
        <multiple>eds.</multiple>
      </term>
    </terms>
  </locale>
  <macro name="author">
    <choose>
      <if variable="author">
        <names variable="author">
          <name font-style="normal" delimiter=" /" and="text" delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" text-case="lowercase" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="author-short">
    <choose>
      <if variable="author">
        <names variable="author">
          <name form="short" font-style="normal" and="text" delimiter-precedes-last="never" et-al-use-first="1" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" text-case="lowercase" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="author-bib">
    <choose>
      <if variable="author">
        <names variable="author">
          <name name-as-sort-order="all" form="long" and="symbol" delimiter-precedes-last="never" sort-separator=", " font-style="normal">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name name-as-sort-order="all" form="long" delimiter="/" delimiter-precedes-last="never" sort-separator=", " font-style="normal">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="translator">
    <names variable="translator">
      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" " font-style="normal" prefix=" traduit par ">
        <name-part name="family" font-variant="small-caps"/>
      </name>
    </names>
  </macro>
  <macro name="title">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song" match="any">
        <text variable="title" text-case="title"/>
      </if>
      <else-if type="article-journal article-newspaper article-magazine" match="any">
        <group delimiter=", ">
          <text variable="title" text-case="title"/>
          <text variable="container-title" prefix="in: "/>
        </group>
      </else-if>
      <else-if type="thesis" match="any">
        <group>
          <text variable="title" text-case="capitalize-first" suffix=", Diss."/>
        </group>
      </else-if>
      <else-if type="manuscript">
        <group delimiter=",">
          <text variable="title" text-case="capitalize-first"/>
          <text variable="genre" prefix=" "/>
        </group>
      </else-if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group>
          <text variable="title" text-case="title" suffix=", "/>
          <text value="in" suffix=": "/>
          <names variable="editor">
            <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
              <name-part name="family" font-variant="small-caps"/>
            </name>
          </names>
          <text value=" (ed.), " text-case="lowercase"/>
          <text variable="container-title" text-case="title"/>
        </group>
      </else-if>
      <else-if type="webpage">
        <group>
          <text variable="title" text-case="capitalize-first" suffix=", "/>
          <text variable="container-title" prefix="unter: " suffix=", "/>
          <text variable="URL" prefix="&lt; " suffix=" &gt;"/>
        </group>
      </else-if>
      <else>
        <text variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-short">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song" match="any">
        <text variable="title" form="short" text-case="title"/>
      </if>
      <else-if type="article-journal article-newspaper article-magazine" match="any">
        <group delimiter=", ">
          <text variable="title" form="short" text-case="title"/>
        </group>
      </else-if>
      <else-if type="thesis" match="any">
        <group>
          <text variable="title" form="short" text-case="capitalize-first" suffix=", Diss."/>
        </group>
      </else-if>
      <else-if type="manuscript">
        <group delimiter=",">
          <text variable="title" form="short" text-case="capitalize-first"/>
          <text variable="genre" prefix=" "/>
        </group>
      </else-if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group>
          <text variable="title" form="short" text-case="capitalize-first" suffix=", "/>
        </group>
      </else-if>
      <else-if type="webpage">
        <group>
          <text variable="title" text-case="capitalize-first" suffix=", "/>
          <text variable="container-title" prefix="unter: " suffix=", "/>
          <text variable="URL" prefix="&lt; " suffix=" &gt;"/>
        </group>
      </else-if>
      <else>
        <text variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="pub-place">
    <choose>
      <if type="bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song" match="any">
        <text variable="publisher-place"/>
      </if>
    </choose>
  </macro>
  <macro name="yearpage-bib">
    <choose>
      <if type="bill book graphic legal_case motion_picture paper-conference manuscript report song thesis" match="any">
        <group delimiter=", ">
          <group delimiter=", " font-style="normal">
            <date variable="issued">
              <date-part name="year"/>
            </date>
          </group>
        </group>
      </if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group delimiter=", " font-style="normal">
          <date form="numeric" variable="issued">
            <date-part name="year"/>
          </date>
          <group>
            <text term="volume" form="short" suffix="."/>
            <text variable="number-of-volumes" prefix=". " suffix="/"/>
            <text variable="volume"/>
          </group>
          <group>
            <label variable="page" form="short"/>
            <text variable="page" prefix=" "/>
          </group>
        </group>
      </else-if>
      <else-if type="article-journal chapter" match="any">
        <group delimiter=" " font-style="normal">
          <label variable="page" form="short"/>
          <text variable="page"/>
        </group>
      </else-if>
      <else-if type="article-newspaper article-magazine" match="any">
        <group delimiter=" " font-style="normal">
          <label variable="page" form="short"/>
          <text variable="page"/>
        </group>
      </else-if>
      <else-if type="webpage" match="any">
        <group delimiter=" " font-style="normal">
          <date variable="accessed" form="numeric" prefix="(" suffix=")">
            <date-part name="day" form="numeric"/>
            <date-part name="month" form="numeric"/>
            <date-part name="year"/>
          </date>
        </group>
      </else-if>
    </choose>
    <group>
      <label prefix=", at " suffix=" " variable="locator" form="short"/>
      <text variable="locator" form="short"/>
    </group>
  </macro>
  <macro name="edition">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song chapter paper-conference" match="any">
        <choose>
          <if is-numeric="edition">
            <group delimiter=" ">
              <number variable="edition" form="ordinal"/>
              <text term="edition" form="short"/>
            </group>
          </if>
          <else>
            <text variable="edition" text-case="capitalize-first" suffix="."/>
          </else>
        </choose>
      </if>
      <else-if type="article-journal article-magazine" match="any">
        <group>
          <choose>
            <if variable="issued">
              <text macro="volume" suffix=" "/>
              <group>
                <date variable="issued">
                  <date-part name="year" prefix="(" suffix=")"/>
                </date>
              </group>
            </if>
            <else>
              <text macro="volume" text-case="capitalize-first"/>
            </else>
          </choose>
        </group>
      </else-if>
    </choose>
  </macro>
  <macro name="volume">
    <choose>
      <if is-numeric="volume">
        <text variable="volume"/>
      </if>
      <else>
        <text variable="volume"/>
      </else>
    </choose>
  </macro>
  <macro name="collection">
    <choose>
      <if is-numeric="collection-number">
        <text variable="collection-title" prefix=" ("/>
        <text variable="collection-number" prefix=", Vol. " suffix=") "/>
      </if>
    </choose>
  </macro>
  <citation>
    <layout suffix="." delimiter="; ">
      <choose>
        <if position="ibid-with-locator">
          <group delimiter=", ">
            <text term="ibid" text-case="lowercase" font-style="normal" suffix="."/>
            <group>
              <label suffix=" " variable="locator" form="short"/>
              <text variable="locator" form="short"/>
            </group>
          </group>
        </if>
        <else-if position="ibid">
          <text term="ibid" text-case="lowercase" font-style="normal"/>
        </else-if>
        <else-if position="subsequent">
          <group delimiter=", ">
            <text macro="author-short"/>
            <text macro="title-short" text-case="title"/>
            <group>
              <label suffix=" " variable="locator" form="short"/>
              <text variable="locator" form="short"/>
            </group>
          </group>
        </else-if>
        <else>
          <group delimiter=", " suffix=", ">
            <text macro="author"/>
            <text macro="title" text-case="title"/>
            <text macro="translator"/>
            <text macro="edition"/>
          </group>
          <group delimiter=" ">
            <text macro="pub-place"/>
            <text macro="yearpage-bib"/>
          </group>
        </else>
      </choose>
    </layout>
  </citation>
  <bibliography>
    <sort>
      <key macro="author" names-min="3" names-use-first="3"/>
      <key variable="issued" sort="descending"/>
    </sort>
    <layout suffix=".">
      <group delimiter=", " suffix=", ">
        <text macro="author-bib"/>
        <text macro="title"/>
        <text macro="collection"/>
        <text macro="translator"/>
        <text macro="edition"/>
      </group>
      <group delimiter=" ">
        <text macro="pub-place"/>
        <text macro="yearpage-bib"/>
      </group>
    </layout>
  </bibliography>
</style>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]           ` <e4cef3f2-bf3f-4359-87b7-61f9f3309670n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-05-20 15:50             ` Bastien DUMONT
  2022-05-20 16:06               ` John Carter Wood
  0 siblings, 1 reply; 12+ messages in thread
From: Bastien DUMONT @ 2022-05-20 15:50 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Remove also text-case="title" on l. 312. As for the p./pp. issue, I don't have any explanation... It may be a bug.

Le Friday 20 May 2022 à 07:56:58AM, John Carter Wood a écrit :
> Thank you!
> 
> That's a helpful explanation. My own workflow is based on Markdown / Pandoc, so
> that's the "right" version as far as I'm concerned. :-)
> 
> I removed the attribute as you suggested, but the et al. and ed. are still
> being capitalised in the notes (though not in the bibliography...I feel like
> this should help, but this is my first escapade with re-writing CSL, so this
> insight hasn't brought me any further).
> 
> I have attached an .md file, a .json bibliography and a new version (19) of the
> .csl file (that includes the change you suggested in the last version).
> 
> The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IEG-2-19.docx
> --citeproc --lua-filter pandoc-quotes.lua"
> 
> The bibliography is specified in the YAML header.
> 
> I hope I have done all this right.
> 
> 
> Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2:
> 
>     When testing your CSL file, you should be aware that Zotero and (I guess)
>     the Visual Editor rely on citeproc-js, which is not fully compliant with
>     the CSL specification. Sometimes, Pandoc is right against them. For
>     instance, if I remember well, the default value for the "match" attribute
>     is "any" in citeproc-js, although it should be "all" (as it is in Pandoc).
>     On the other hand, the specification does not define the expected behaviour
>     for all cases. The issue documented by your first screenshot is a good
>     example of that. The "title" macro is called on l. 332 with the attribute
>     text-case="title", but the <text> element on l. 117 included in this macro
>     has text-case="lowercase": which one should have the precedence? Unless I
>     have missed something, the CSL specification does not define that, so
>     Pandoc applies the attribute value set on the upper-most element and
>     citeproc-js that of the inner-most element. Neither is wrong, so the only
>     solution is to avoid such conflicts in your stylesheet (e.g. by removing
>     the attribute on l. 332).
> 
>     As for the issue with "p./pp.", I guess that the problem is in your
>     Markdown input, but I can't be sure. Could you provide a minimal sample MD
>     file with a stylesheet and a bibliography?
> 
>     Le Friday 20 May 2022 à 04:00:49AM, John Carter Wood a écrit :
>     > I have been working on creating a CSL style for the publication
>     house-style at
>     > my institution: I've been making progress adapting another style but am
>     running
>     > into a few issues that seem to only crop up when using the CSL during a
>     > document transformation with pandoc (version 2.18, with CSL file
>     specified in a
>     > YAML block). In the preview for the visual editor they look OK and when I
>     > insert them via Zotero's connector into a LibreOffice / Word document
>     they look
>     > fine too; however, when I create the docx via pandoc there are unwanted
>     > variations on a few points
>     >
>     > There are a few issues, but the format for items in collections seems to
>     be the
>     > main one.
>     >
>     > Here is a screenshot of the same citation: the one on top (which formats
>     > incorrectly) was created by using pandoc. The one on the bottom (which
>     formats
>     > correctly) was directly inserted into the document using Zotero's
>     functionality
>     > in LibreOffice.
>     > CSL-pandoc-issues.png
>     >
>     > The problems:
>     > 1. et al. is capitalising
>     > 2. (ed.) is capitalising
>     > 3. the p./pp. contextualisation isn't working right: using pandoc, when
>     the
>     > locator is a single page, *the page range for the whole citation* revert
>     to a
>     > single "p.", even when it should be plural; if the locator is more than
>     one
>     > page, then "pp." appears in both, as it should.
>     >
>     > As I said, when looking at style using the example citations in the
>     visual
>     > editor at for CSL ([1]https://editor.citationstyles.org/visualEditor/),
>     it also
>     > looks right (as in the second cite.)
>     >
>     > CSL-IEG-Visual-Editor.png
>     >
>     > I am running into a few other challenges with working out CSL, but since
>     this
>     > one seems to specifically relate to using pandoc (which is my main
>     workflow, as
>     > I write in Markdown), I thought I would ask here whether this is a known
>     issue,
>     > whether I'm doing something wrong and whether there's a way to solve
>     this.
>     >
>     > Here, for reference, is my CSL file (which is still a work in progress):
>     >
>     > [2]https://pastebin.com/xefmukzw
>     >
>     > Thanks in advance for any help.
>     >
>     > --
>     > You received this message because you are subscribed to the Google Groups
>     > "pandoc-discuss" group.
>     > To unsubscribe from this group and stop receiving emails from it, send an
>     email
>     > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > To view this discussion on the web visit [2][3]https://groups.google.com/
>     d/msgid/
>     > pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%[4]
>     40googlegroups.com.
>     >
>     > References:
>     >
>     > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [2] [5]https://groups.google.com/d/msgid/pandoc-discuss/
>     0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&
>     utm_source=footer
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [7]https://groups.google.com/d/msgid/
> pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com.
> 
> References:
> 
> [1] https://editor.citationstyles.org/visualEditor/
> [2] https://pastebin.com/xefmukzw
> [3] https://groups.google.com/d/msgid/
> [4] http://40googlegroups.com/
> [5] https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&utm_source=footer
> [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com?utm_medium=email&utm_source=footer

> ---
> title: CSL-Test-2 
> subtitle: Minimal CSL file 
> author: PD Dr. John Carter Wood
> bibliography: /home/john/Documents/libraries/CSL-minimal-test.json
> csl: /home/john/Documents/csl/ieg-2-en-19.csl
> lang: en-GB
> quot-lang: da
> header-includes:
>  - \usepackage{csquotes}
> ---
> # Introduction
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit [@latourette_community_1938, 15].  Donec "hendrerit tempor tellus" [@oldham_responsible_1948].  Donec pretium posuere tellus [@latourette_community_1938, 10-12].  Proin quam nisl, "tincidunt et, 'mattis eget', convallis nec, purus" [@muller_european_2011, 585].  Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.  Nulla posuere [@muller_european_2011, 586-587].  Donec vitae dolor.  Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.  Nam vestibulum accumsan nisl [@mumford_technics_1934, 45].
> 
> # Bibliography
> 			



-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/Yoe4q4BjrrEPSGKM%40localhost.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
  2022-05-20 15:50             ` Bastien DUMONT
@ 2022-05-20 16:06               ` John Carter Wood
       [not found]                 ` <04626317-9c4b-4135-abfb-5ab0ae4909b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John Carter Wood @ 2022-05-20 16:06 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 8537 bytes --]

Thank you! Removing text-case="title" on l. 312 does solve the et al. and 
ed. problems. 

But then book titles (e.g., the Mumford citation in the examples I sent) 
becomes sentence case, and I need book titles to be in title case. Hmmm. 


Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 17:50:41 UTC+2:

> Remove also text-case="title" on l. 312. As for the p./pp. issue, I don't 
> have any explanation... It may be a bug.
>
> Le Friday 20 May 2022 à 07:56:58AM, John Carter Wood a écrit :
> > Thank you!
> > 
> > That's a helpful explanation. My own workflow is based on Markdown / 
> Pandoc, so
> > that's the "right" version as far as I'm concerned. :-)
> > 
> > I removed the attribute as you suggested, but the et al. and ed. are 
> still
> > being capitalised in the notes (though not in the bibliography...I feel 
> like
> > this should help, but this is my first escapade with re-writing CSL, so 
> this
> > insight hasn't brought me any further).
> > 
> > I have attached an .md file, a .json bibliography and a new version (19) 
> of the
> > .csl file (that includes the change you suggested in the last version).
> > 
> > The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IEG-2-19.docx
> > --citeproc --lua-filter pandoc-quotes.lua"
> > 
> > The bibliography is specified in the YAML header.
> > 
> > I hope I have done all this right.
> > 
> > 
> > Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2:
> > 
> > When testing your CSL file, you should be aware that Zotero and (I guess)
> > the Visual Editor rely on citeproc-js, which is not fully compliant with
> > the CSL specification. Sometimes, Pandoc is right against them. For
> > instance, if I remember well, the default value for the "match" attribute
> > is "any" in citeproc-js, although it should be "all" (as it is in 
> Pandoc).
> > On the other hand, the specification does not define the expected 
> behaviour
> > for all cases. The issue documented by your first screenshot is a good
> > example of that. The "title" macro is called on l. 332 with the attribute
> > text-case="title", but the <text> element on l. 117 included in this 
> macro
> > has text-case="lowercase": which one should have the precedence? Unless I
> > have missed something, the CSL specification does not define that, so
> > Pandoc applies the attribute value set on the upper-most element and
> > citeproc-js that of the inner-most element. Neither is wrong, so the only
> > solution is to avoid such conflicts in your stylesheet (e.g. by removing
> > the attribute on l. 332).
> > 
> > As for the issue with "p./pp.", I guess that the problem is in your
> > Markdown input, but I can't be sure. Could you provide a minimal sample 
> MD
> > file with a stylesheet and a bibliography?
> > 
> > Le Friday 20 May 2022 à 04:00:49AM, John Carter Wood a écrit :
> > > I have been working on creating a CSL style for the publication
> > house-style at
> > > my institution: I've been making progress adapting another style but am
> > running
> > > into a few issues that seem to only crop up when using the CSL during a
> > > document transformation with pandoc (version 2.18, with CSL file
> > specified in a
> > > YAML block). In the preview for the visual editor they look OK and 
> when I
> > > insert them via Zotero's connector into a LibreOffice / Word document
> > they look
> > > fine too; however, when I create the docx via pandoc there are unwanted
> > > variations on a few points
> > >
> > > There are a few issues, but the format for items in collections seems 
> to
> > be the
> > > main one.
> > >
> > > Here is a screenshot of the same citation: the one on top (which 
> formats
> > > incorrectly) was created by using pandoc. The one on the bottom (which
> > formats
> > > correctly) was directly inserted into the document using Zotero's
> > functionality
> > > in LibreOffice.
> > > CSL-pandoc-issues.png
> > >
> > > The problems:
> > > 1. et al. is capitalising
> > > 2. (ed.) is capitalising
> > > 3. the p./pp. contextualisation isn't working right: using pandoc, when
> > the
> > > locator is a single page, *the page range for the whole citation* 
> revert
> > to a
> > > single "p.", even when it should be plural; if the locator is more than
> > one
> > > page, then "pp." appears in both, as it should.
> > >
> > > As I said, when looking at style using the example citations in the
> > visual
> > > editor at for CSL ([1]https://editor.citationstyles.org/visualEditor/
> ),
> > it also
> > > looks right (as in the second cite.)
> > >
> > > CSL-IEG-Visual-Editor.png
> > >
> > > I am running into a few other challenges with working out CSL, but 
> since
> > this
> > > one seems to specifically relate to using pandoc (which is my main
> > workflow, as
> > > I write in Markdown), I thought I would ask here whether this is a 
> known
> > issue,
> > > whether I'm doing something wrong and whether there's a way to solve
> > this.
> > >
> > > Here, for reference, is my CSL file (which is still a work in 
> progress):
> > >
> > > [2]https://pastebin.com/xefmukzw
> > >
> > > Thanks in advance for any help.
> > >
> > > --
> > > You received this message because you are subscribed to the Google 
> Groups
> > > "pandoc-discuss" group.
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an
> > email
> > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > > To view this discussion on the web visit [2][3]
> https://groups.google.com/
> > d/msgid/
> > > pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%[4]
> > 40googlegroups.com.
> > >
> > > References:
> > >
> > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [2] [5]https://groups.google.com/d/msgid/pandoc-discuss/
> > 0daa1a20-d847-47f5-a465-708c7875ff8an%
> 40googlegroups.com?utm_medium=email&
> > utm_source=footer
> > 
> > 
> > 
> > 
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email
> > to [6]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [7]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com.
> > 
> > References:
> > 
> > [1] https://editor.citationstyles.org/visualEditor/
> > [2] https://pastebin.com/xefmukzw
> > [3] https://groups.google.com/d/msgid/
> > [4] http://40googlegroups.com/
> > [5] 
> https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&utm_source=footer
> > [6] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [7] 
> https://groups.google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com?utm_medium=email&utm_source=footer
>
> > ---
> > title: CSL-Test-2 
> > subtitle: Minimal CSL file 
> > author: PD Dr. John Carter Wood
> > bibliography: /home/john/Documents/libraries/CSL-minimal-test.json
> > csl: /home/john/Documents/csl/ieg-2-en-19.csl
> > lang: en-GB
> > quot-lang: da
> > header-includes:
> > - \usepackage{csquotes}
> > ---
> > # Introduction
> > Lorem ipsum dolor sit amet, consectetuer adipiscing elit 
> [@latourette_community_1938, 15]. Donec "hendrerit tempor tellus" 
> [@oldham_responsible_1948]. Donec pretium posuere tellus 
> [@latourette_community_1938, 10-12]. Proin quam nisl, "tincidunt et, 
> 'mattis eget', convallis nec, purus" [@muller_european_2011, 585]. Cum 
> sociis natoque penatibus et magnis dis parturient montes, nascetur 
> ridiculus mus. Nulla posuere [@muller_european_2011, 586-587]. Donec vitae 
> dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. 
> Nullam rutrum. Nam vestibulum accumsan nisl [@mumford_technics_1934, 45].
> > 
> > # Bibliography
> > 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/04626317-9c4b-4135-abfb-5ab0ae4909b5n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 14709 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]                 ` <04626317-9c4b-4135-abfb-5ab0ae4909b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-05-20 16:15                   ` Bastien DUMONT
  2022-05-20 16:37                     ` John Carter Wood
  0 siblings, 1 reply; 12+ messages in thread
From: Bastien DUMONT @ 2022-05-20 16:15 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Then add title-case="title" in the relevant places.

Le Friday 20 May 2022 à 09:06:19AM, John Carter Wood a écrit :
> Thank you! Removing text-case="title" on l. 312 does solve the et al. and ed.
> problems.
> 
> But then book titles (e.g., the Mumford citation in the examples I sent)
> becomes sentence case, and I need book titles to be in title case. Hmmm.
> 
> 
> Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 17:50:41 UTC+2:
> 
>     Remove also text-case="title" on l. 312. As for the p./pp. issue, I don't
>     have any explanation... It may be a bug.
> 
>     Le Friday 20 May 2022 à 07:56:58AM, John Carter Wood a écrit :
>     > Thank you!
>     >
>     > That's a helpful explanation. My own workflow is based on Markdown /
>     Pandoc, so
>     > that's the "right" version as far as I'm concerned. :-)
>     >
>     > I removed the attribute as you suggested, but the et al. and ed. are
>     still
>     > being capitalised in the notes (though not in the bibliography...I feel
>     like
>     > this should help, but this is my first escapade with re-writing CSL, so
>     this
>     > insight hasn't brought me any further).
>     >
>     > I have attached an .md file, a .json bibliography and a new version (19)
>     of the
>     > .csl file (that includes the change you suggested in the last version).
>     >
>     > The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IEG-2-19.docx
>     > --citeproc --lua-filter pandoc-quotes.lua"
>     >
>     > The bibliography is specified in the YAML header.
>     >
>     > I hope I have done all this right.
>     >
>     >
>     > Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2:
>     >
>     > When testing your CSL file, you should be aware that Zotero and (I guess)
>     > the Visual Editor rely on citeproc-js, which is not fully compliant with
>     > the CSL specification. Sometimes, Pandoc is right against them. For
>     > instance, if I remember well, the default value for the "match" attribute
>     > is "any" in citeproc-js, although it should be "all" (as it is in
>     Pandoc).
>     > On the other hand, the specification does not define the expected
>     behaviour
>     > for all cases. The issue documented by your first screenshot is a good
>     > example of that. The "title" macro is called on l. 332 with the attribute
>     > text-case="title", but the <text> element on l. 117 included in this
>     macro
>     > has text-case="lowercase": which one should have the precedence? Unless I
>     > have missed something, the CSL specification does not define that, so
>     > Pandoc applies the attribute value set on the upper-most element and
>     > citeproc-js that of the inner-most element. Neither is wrong, so the only
>     > solution is to avoid such conflicts in your stylesheet (e.g. by removing
>     > the attribute on l. 332).
>     >
>     > As for the issue with "p./pp.", I guess that the problem is in your
>     > Markdown input, but I can't be sure. Could you provide a minimal sample
>     MD
>     > file with a stylesheet and a bibliography?
>     >
>     > Le Friday 20 May 2022 à 04:00:49AM, John Carter Wood a écrit :
>     > > I have been working on creating a CSL style for the publication
>     > house-style at
>     > > my institution: I've been making progress adapting another style but am
>     > running
>     > > into a few issues that seem to only crop up when using the CSL during a
>     > > document transformation with pandoc (version 2.18, with CSL file
>     > specified in a
>     > > YAML block). In the preview for the visual editor they look OK and when
>     I
>     > > insert them via Zotero's connector into a LibreOffice / Word document
>     > they look
>     > > fine too; however, when I create the docx via pandoc there are unwanted
>     > > variations on a few points
>     > >
>     > > There are a few issues, but the format for items in collections seems
>     to
>     > be the
>     > > main one.
>     > >
>     > > Here is a screenshot of the same citation: the one on top (which
>     formats
>     > > incorrectly) was created by using pandoc. The one on the bottom (which
>     > formats
>     > > correctly) was directly inserted into the document using Zotero's
>     > functionality
>     > > in LibreOffice.
>     > > CSL-pandoc-issues.png
>     > >
>     > > The problems:
>     > > 1. et al. is capitalising
>     > > 2. (ed.) is capitalising
>     > > 3. the p./pp. contextualisation isn't working right: using pandoc, when
>     > the
>     > > locator is a single page, *the page range for the whole citation*
>     revert
>     > to a
>     > > single "p.", even when it should be plural; if the locator is more than
>     > one
>     > > page, then "pp." appears in both, as it should.
>     > >
>     > > As I said, when looking at style using the example citations in the
>     > visual
>     > > editor at for CSL ([1][1]https://editor.citationstyles.org/visualEditor
>     /),
>     > it also
>     > > looks right (as in the second cite.)
>     > >
>     > > CSL-IEG-Visual-Editor.png
>     > >
>     > > I am running into a few other challenges with working out CSL, but
>     since
>     > this
>     > > one seems to specifically relate to using pandoc (which is my main
>     > workflow, as
>     > > I write in Markdown), I thought I would ask here whether this is a
>     known
>     > issue,
>     > > whether I'm doing something wrong and whether there's a way to solve
>     > this.
>     > >
>     > > Here, for reference, is my CSL file (which is still a work in
>     progress):
>     > >
>     > > [2][2]https://pastebin.com/xefmukzw
>     > >
>     > > Thanks in advance for any help.
>     > >
>     > > --
>     > > You received this message because you are subscribed to the Google
>     Groups
>     > > "pandoc-discuss" group.
>     > > To unsubscribe from this group and stop receiving emails from it, send
>     an
>     > email
>     > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > > To view this discussion on the web visit [2][3][3]https://
>     groups.google.com/
>     > d/msgid/
>     > > pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%[4]
>     > [4]40googlegroups.com.
>     > >
>     > > References:
>     > >
>     > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > > [2] [5][5]https://groups.google.com/d/msgid/pandoc-discuss/
>     > 0daa1a20-d847-47f5-a465-708c7875ff8an%[6]40googlegroups.com?utm_medium=
>     email&
>     > utm_source=footer
>     >
>     >
>     >
>     >
>     > --
>     > You received this message because you are subscribed to the Google Groups
>     > "pandoc-discuss" group.
>     > To unsubscribe from this group and stop receiving emails from it, send an
>     email
>     > to [6]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > To view this discussion on the web visit [7][7]https://groups.google.com/
>     d/msgid/
>     > pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%[8]
>     40googlegroups.com.
>     >
>     > References:
>     >
>     > [1] [9]https://editor.citationstyles.org/visualEditor/
>     > [2] [10]https://pastebin.com/xefmukzw
>     > [3] [11]https://groups.google.com/d/msgid/
>     > [4] [12]http://40googlegroups.com/
>     > [5] [13]https://groups.google.com/d/msgid/pandoc-discuss/
>     0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&
>     utm_source=footer
>     > [6] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/
>     e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com?utm_medium=email&
>     utm_source=footer
> 
>     > ---
>     > title: CSL-Test-2
>     > subtitle: Minimal CSL file
>     > author: PD Dr. John Carter Wood
>     > bibliography: /home/john/Documents/libraries/CSL-minimal-test.json
>     > csl: /home/john/Documents/csl/ieg-2-en-19.csl
>     > lang: en-GB
>     > quot-lang: da
>     > header-includes:
>     > - \usepackage{csquotes}
>     > ---
>     > # Introduction
>     > Lorem ipsum dolor sit amet, consectetuer adipiscing elit
>     [@latourette_community_1938, 15]. Donec "hendrerit tempor tellus"
>     [@oldham_responsible_1948]. Donec pretium posuere tellus
>     [@latourette_community_1938, 10-12]. Proin quam nisl, "tincidunt et,
>     'mattis eget', convallis nec, purus" [@muller_european_2011, 585]. Cum
>     sociis natoque penatibus et magnis dis parturient montes, nascetur
>     ridiculus mus. Nulla posuere [@muller_european_2011, 586-587]. Donec vitae
>     dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla.
>     Nullam rutrum. Nam vestibulum accumsan nisl [@mumford_technics_1934, 45].
>     >
>     > # Bibliography
>     >
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [16]https://groups.google.com/d/msgid/
> pandoc-discuss/04626317-9c4b-4135-abfb-5ab0ae4909b5n%40googlegroups.com.
> 
> References:
> 
> [1] https://editor.citationstyles.org/visualEditor/
> [2] https://pastebin.com/xefmukzw
> [3] https://groups.google.com/
> [4] http://40googlegroups.com/
> [5] https://groups.google.com/d/msgid/pandoc-discuss/
> [6] http://40googlegroups.com/?utm_medium=email&
> [7] https://groups.google.com/d/msgid/
> [8] http://40googlegroups.com/
> [9] https://editor.citationstyles.org/visualEditor/
> [10] https://pastebin.com/xefmukzw
> [11] https://groups.google.com/d/msgid/
> [12] http://40googlegroups.com/
> [13] https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-708c7875ff8an%40googlegroups.com?utm_medium=email&utm_source=footer
> [14] https://groups.google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com?utm_medium=email&utm_source=footer
> [15] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [16] https://groups.google.com/d/msgid/pandoc-discuss/04626317-9c4b-4135-abfb-5ab0ae4909b5n%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/Yoe%2Bhr4d1kQWS7DI%40localhost.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
  2022-05-20 16:15                   ` Bastien DUMONT
@ 2022-05-20 16:37                     ` John Carter Wood
  0 siblings, 0 replies; 12+ messages in thread
From: John Carter Wood @ 2022-05-20 16:37 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 956 bytes --]

Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 18:15:07 UTC+2:
 

> Then add title-case="title" in the relevant places. 
>
>
Thanks. I'll have to spend some time trying to figure out where that would 
be. The places where I think it should work either do nothing or bring back 
the original problem when I add text-case="title". Somehow it seems that 
the editor name and label are being counted as part of a title. Or 
something. I will spend some more time with it. But thanks, I feel like 
I've moved a step forward with it at least. 

 

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0c2e2300-ae63-4264-a005-e153922664d3n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1504 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: Divergent styling when using CSL in pandoc(?)
  2022-05-20 13:42       ` Bastien DUMONT
  2022-05-20 14:56         ` John Carter Wood
@ 2022-05-20 18:45         ` denis.maier-NSENcxR/0n0
       [not found]           ` <ae5227d7f2574c9ea33550a84d6e03e9-NSENcxR/0n0@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-05-20 18:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

> -----Ursprüngliche Nachricht-----
> Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
> discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
> Gesendet: Freitag, 20. Mai 2022 15:43
> An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> Betreff: Re: Divergent styling when using CSL in pandoc(?)
> 
> [...] On the other hand,
> the specification does not define the expected behaviour for all cases. The
> issue documented by your first screenshot is a good example of that. The
> "title" macro is called on l. 332 with the attribute text-case="title", but the
> <text> element on l. 117 included in this macro has text-case="lowercase":
> which one should have the precedence? Unless I have missed something, the
> CSL specification does not define that, so Pandoc applies the attribute value
> set on the upper-most element and citeproc-js that of the inner-most
> element. Neither is wrong, so the only solution is to avoid such conflicts in
> your stylesheet (e.g. by removing the attribute on l. 332).

Good catch. I'll open an issue on the CSL schema repo. But concerning precedence have a look at https://docs.citationstyles.org/en/stable/specification.html#inheritable-name-options where you'll find:

> When an inheritable name attribute is set on cs:style, cs:citation or cs:bibliography, its value is used for all cs:names elements within the scope of the element carrying the attribute. If an attribute is set on multiple hierarchical levels, the value set at the lowest level is used.

That's about inheritable name attributes, sure. But I'd infer from that that there seems to be a preference for settings at lower levels.
Maybe we should prohibit the use of styles and text-casing with macros as these run somewhat against the purpose of macros...

Denis

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ae5227d7f2574c9ea33550a84d6e03e9%40unibe.ch.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]           ` <ae5227d7f2574c9ea33550a84d6e03e9-NSENcxR/0n0@public.gmane.org>
@ 2022-05-25 17:25             ` John Carter Wood
       [not found]               ` <4217cb45-f6db-4b04-a598-20ac2422d02an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: John Carter Wood @ 2022-05-25 17:25 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 4331 bytes --]

Following up on my original post, I have tried to follow Bastien Dumont's 
advice to get book titles in title case (i.e. 'add title-case="title" in 
the relevant places') , however I am having no luck and running into what 
seems to me to be a curious issue. 

I have included my minimal Markdown file, minimal json bibliography and the 
CSL file. 

The problem: I cannot get book titles to appear in title case. 

The relevant line in the CSL file would seem to be line 90. 


   - If I set text-case="uppercase" in line 90, then the book titles appear 
   as UPPERCASE in both citation and bibliography.

[image: Line-90-uppercase.png]

   - If I set text-case="lowercase" in line 90, then the book titles appear 
   as lowercase in both citation and bibliography. 

[image: Line-90-lowercase.png]

Those experiments suggest to me that line 90 is indeed the relevant line 
for setting book title case. 

However, if I set text-case="title" in line 90, then the book titles appear 
in "capitalize-first" case. 

[image: Line-90-title-case.png]

But, again, as in my original post, if I insert the citation directly in 
LibreOffice using the Zotero plugin, the titles appear correctly, in 
title-case. 

[image: Insert-book-LibreOffice.png]

The issue only comes up when using pandoc for conversion. 

If the issue is, as Denis suggests, something to do with nesting / 
precedence, I would be grateful is someone could point out where my CSL 
file is creating that conflict. I have tried to find something but without 
any success. 
But it seems odd to me if that is the case that I *can* set the titles to 
"uppercase" and "lowercase" but *not* to "title" case when changing the 
same line. 

And, again, this only arises with pandoc conversion. 

So is this something I can change in my CSL? Or is this a pandoc issue?



denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 20. Mai 2022 um 20:45:54 UTC+2:

> > -----Ursprüngliche Nachricht-----
> > Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
> > dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
> > Gesendet: Freitag, 20. Mai 2022 15:43
> > An: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > Betreff: Re: Divergent styling when using CSL in pandoc(?)
> > 
> > [...] On the other hand,
> > the specification does not define the expected behaviour for all cases. 
> The
> > issue documented by your first screenshot is a good example of that. The
> > "title" macro is called on l. 332 with the attribute text-case="title", 
> but the
> > <text> element on l. 117 included in this macro has 
> text-case="lowercase":
> > which one should have the precedence? Unless I have missed something, the
> > CSL specification does not define that, so Pandoc applies the attribute 
> value
> > set on the upper-most element and citeproc-js that of the inner-most
> > element. Neither is wrong, so the only solution is to avoid such 
> conflicts in
> > your stylesheet (e.g. by removing the attribute on l. 332).
>
> Good catch. I'll open an issue on the CSL schema repo. But concerning 
> precedence have a look at 
> https://docs.citationstyles.org/en/stable/specification.html#inheritable-name-options 
> where you'll find:
>
> > When an inheritable name attribute is set on cs:style, cs:citation or 
> cs:bibliography, its value is used for all cs:names elements within the 
> scope of the element carrying the attribute. If an attribute is set on 
> multiple hierarchical levels, the value set at the lowest level is used.
>
> That's about inheritable name attributes, sure. But I'd infer from that 
> that there seems to be a preference for settings at lower levels.
> Maybe we should prohibit the use of styles and text-casing with macros as 
> these run somewhat against the purpose of macros...
>
> Denis
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/4217cb45-f6db-4b04-a598-20ac2422d02an%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6015 bytes --]

[-- Attachment #2: ieg-2-en-22.csl --]
[-- Type: application/octet-stream, Size: 12480 bytes --]

<?xml version="1.0" encoding="utf-8"?>
<style class="note" version="1.0" et-al-min="4" et-al-use-first="1" et-al-subsequent-min="4" et-al-subsequent-use-first="1" page-range-format="expanded" default-locale="en-GB" xmlns="http://purl.org/net/xbiblio/csl">
  <!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
  <info>
    <title>IEG-2-en</title>
    <id>http://www.zotero.org/styles/ieg-2-en</id>
    <link rel="self" href="http://www.zotero.org/styles/ieg-2-en"/>
    <category citation-format="note"/>
    <category field="humanities"/>
    <updated>2022-05-11T13:18:17+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="en">
    <terms>
      <term name="cited">op. cit.</term>
      <term name="editor" form="short">
        <single>ed.</single>
        <multiple>eds.</multiple>
      </term>
    </terms>
  </locale>
  <macro name="author">
    <choose>
      <if variable="author">
        <names variable="author">
          <name font-style="normal" delimiter=" /" and="text" delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" text-case="lowercase" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="author-short">
    <choose>
      <if variable="author">
        <names variable="author">
          <name form="short" font-style="normal" and="text" delimiter-precedes-last="never" et-al-use-first="1" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" text-case="lowercase" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="author-bib">
    <choose>
      <if variable="author">
        <names variable="author">
          <name name-as-sort-order="all" form="long" and="symbol" delimiter-precedes-last="never" sort-separator=", " font-style="normal">
            <name-part name="family" font-variant="small-caps"/>
          </name>
        </names>
      </if>
      <else-if variable="editor">
        <names variable="editor">
          <name name-as-sort-order="all" form="long" delimiter="/" delimiter-precedes-last="never" sort-separator=", " font-style="normal">
            <name-part name="family" font-variant="small-caps"/>
          </name>
          <label form="short" prefix=" (" suffix=".)"/>
        </names>
      </else-if>
    </choose>
  </macro>
  <macro name="translator">
    <names variable="translator">
      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" " font-style="normal" prefix=" traduit par ">
        <name-part name="family" font-variant="small-caps"/>
      </name>
    </names>
  </macro>
  <macro name="title">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song" match="any">
	<group>
          <text variable="title" text-case="title"/>
        </group>
      </if>
      <else-if type="article-journal article-newspaper article-magazine" match="any">
        <group delimiter=", ">
          <text variable="title" text-case="title"/>
          <text variable="container-title" prefix="in: "/>
        </group>
      </else-if>
      <else-if type="thesis" match="any">
        <group>
          <text variable="title" text-case="title" suffix=", Diss."/>
        </group>
      </else-if>
      <else-if type="manuscript">
        <group delimiter=",">
          <text variable="title" text-case="title"/>
          <text variable="genre" prefix=" "/>
        </group>
      </else-if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group>
          <text variable="title" text-case="title" suffix=", "/>
          <text value="in" suffix=": "/>
          <names variable="editor">
            <name font-style="normal" delimiter=" / " delimiter-precedes-last="never" sort-separator=" ">
              <name-part name="family" font-variant="small-caps"/>
            </name>
          </names>
          <text value=" (ed.), " text-case="lowercase"/>
          <text variable="container-title" text-case="title"/>
        </group>
      </else-if>
      <else-if type="webpage">
        <group>
          <text variable="title" text-case="title" suffix=", "/>
          <text variable="container-title" prefix="unter: " suffix=", "/>
          <text variable="URL" prefix="&lt; " suffix=" &gt;"/>
        </group>
      </else-if>
      <else>
        <text variable="title" text-case="title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-short">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song" match="any">
        <text variable="title" form="short" text-case="title"/>
      </if>
      <else-if type="article-journal article-newspaper article-magazine" match="any">
        <group delimiter=", ">
          <text variable="title" form="short" text-case="title"/>
        </group>
      </else-if>
      <else-if type="thesis" match="any">
        <group>
          <text variable="title" form="short" text-case="title" suffix=", Diss."/>
        </group>
      </else-if>
      <else-if type="manuscript">
        <group delimiter=",">
          <text variable="title" form="short" text-case="title"/>
          <text variable="genre" prefix=" "/>
        </group>
      </else-if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group>
          <text variable="title" form="short" text-case="title" suffix=", "/>
        </group>
      </else-if>
      <else-if type="webpage">
        <group>
          <text variable="title" text-case="title" suffix=", "/>
          <text variable="container-title" prefix="unter: " suffix=", "/>
          <text variable="URL" prefix="&lt; " suffix=" &gt;"/>
        </group>
      </else-if>
      <else>
        <text variable="title" text-case="title"/>
      </else>
    </choose>
  </macro>
  <macro name="pub-place">
    <choose>
      <if type="bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song" match="any">
        <text variable="publisher-place"/>
      </if>
    </choose>
  </macro>
  <macro name="yearpage-bib">
    <choose>
      <if type="bill book graphic legal_case motion_picture paper-conference manuscript report song thesis" match="any">
        <group delimiter=", ">
          <group delimiter=", " font-style="normal">
            <date variable="issued">
              <date-part name="year"/>
            </date>
          </group>
        </group>
      </if>
      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
        <group delimiter=", " font-style="normal">
          <date form="numeric" variable="issued">
            <date-part name="year"/>
          </date>
          <group>
            <text term="volume" form="short" suffix="."/>
            <text variable="number-of-volumes" prefix=". " suffix="/"/>
            <text variable="volume"/>
          </group>
          <group>
            <label variable="page" form="short"/>
            <text variable="page" prefix=" "/>
          </group>
        </group>
      </else-if>
      <else-if type="article-journal chapter" match="any">
        <group delimiter=" " font-style="normal">
          <label variable="page" form="short"/>
          <text variable="page"/>
        </group>
      </else-if>
      <else-if type="article-newspaper article-magazine" match="any">
        <group delimiter=" " font-style="normal">
          <label variable="page" form="short"/>
          <text variable="page"/>
        </group>
      </else-if>
      <else-if type="webpage" match="any">
        <group delimiter=" " font-style="normal">
          <date variable="accessed" form="numeric" prefix="(" suffix=")">
            <date-part name="day" form="numeric"/>
            <date-part name="month" form="numeric"/>
            <date-part name="year"/>
          </date>
        </group>
      </else-if>
    </choose>
    <group>
      <label prefix=", at " suffix=" " variable="locator" form="short"/>
      <text variable="locator" form="short"/>
    </group>
  </macro>
  <macro name="edition">
    <choose>
      <if type="bill book graphic legal_case motion_picture report song chapter paper-conference" match="any">
        <choose>
          <if is-numeric="edition">
            <group delimiter=" ">
              <number variable="edition" form="ordinal"/>
              <text term="edition" form="short"/>
            </group>
          </if>
          <else>
            <text variable="edition" text-case="capitalize-first" suffix="."/>
          </else>
        </choose>
      </if>
      <else-if type="article-journal article-magazine" match="any">
        <group>
          <choose>
            <if variable="issued">
              <text macro="volume" suffix=" "/>
              <group>
                <date variable="issued">
                  <date-part name="year" prefix="(" suffix=")"/>
                </date>
              </group>
            </if>
            <else>
              <text macro="volume" text-case="capitalize-first"/>
            </else>
          </choose>
        </group>
      </else-if>
    </choose>
  </macro>
  <macro name="volume">
    <choose>
      <if is-numeric="volume">
        <text variable="volume"/>
      </if>
      <else>
        <text variable="volume"/>
      </else>
    </choose>
  </macro>
  <macro name="collection">
    <choose>
      <if is-numeric="collection-number">
        <text variable="collection-title" prefix=" ("/>
        <text variable="collection-number" prefix=", Vol. " suffix=") "/>
      </if>
    </choose>
  </macro>
  <citation>
    <layout suffix="." delimiter="; ">
      <choose>
        <if position="ibid-with-locator">
          <group delimiter=", ">
            <text term="ibid" text-case="lowercase" font-style="normal" suffix="."/>
            <group>
              <label suffix=" " variable="locator" form="short"/>
              <text variable="locator" form="short"/>
            </group>
          </group>
        </if>
        <else-if position="ibid">
          <text term="ibid" text-case="lowercase" font-style="normal"/>
        </else-if>
        <else-if position="subsequent">
          <group delimiter=", ">
            <text macro="author-short"/>
            <text macro="title-short" text-case="title"/>
            <group>
              <label suffix=" " variable="locator" form="short"/>
              <text variable="locator" form="short"/>
            </group>
          </group>
        </else-if>
        <else>
          <group delimiter=", " suffix=", ">
            <text macro="author"/>
            <text macro="title"/>
            <text macro="translator"/>
            <text macro="edition"/>
          </group>
          <group delimiter=" ">
            <text macro="pub-place"/>
            <text macro="yearpage-bib"/>
          </group>
        </else>
      </choose>
    </layout>
  </citation>
  <bibliography>
    <sort>
      <key macro="author" names-min="3" names-use-first="3"/>
      <key variable="issued" sort="descending"/>
    </sort>
    <layout suffix=".">
      <group delimiter=", " suffix=", ">
        <text macro="author-bib"/>
        <text macro="title"/>
        <text macro="collection"/>
        <text macro="translator"/>
        <text macro="edition"/>
      </group>
      <group delimiter=" ">
        <text macro="pub-place"/>
        <text macro="yearpage-bib"/>
      </group>
    </layout>
  </bibliography>
</style>

[-- Attachment #3: Insert-book-LibreOffice.png --]
[-- Type: image/png, Size: 5868 bytes --]

[-- Attachment #4: CSL-minimal-test.json --]
[-- Type: application/json, Size: 4029 bytes --]

[-- Attachment #5: Line-90-title-case.png --]
[-- Type: image/png, Size: 5628 bytes --]

[-- Attachment #6: Line-90-uppercase.png --]
[-- Type: image/png, Size: 6454 bytes --]

[-- Attachment #7: CSL-Test-3.md --]
[-- Type: text/markdown, Size: 432 bytes --]

---
title: CSL-Test-3 
subtitle: Minimal CSL file
bibliography: CSL-minimal-test.json
csl: ieg-2-en-22.csl
lang: en-GB
header-includes:
 - \usepackage{csquotes}
---
# Introduction
Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.  Nam vestibulum accumsan nisl [@mumford_technics_1934, 45]. Lorem ipsum dolor sit amet, consectetuer adipiscing elit [@latourette_community_1938, 15].

# Bibliography
			

[-- Attachment #8: Line-90-lowercase.png --]
[-- Type: image/png, Size: 5495 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* AW: Divergent styling when using CSL in pandoc(?)
       [not found]               ` <4217cb45-f6db-4b04-a598-20ac2422d02an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-05-25 21:36                 ` denis.maier-NSENcxR/0n0
       [not found]                   ` <727f6fde7695493c8d44da2ed2cb52b1-NSENcxR/0n0@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-05-25 21:36 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


[-- Attachment #1.1: Type: text/plain, Size: 6247 bytes --]

I’ve opened an issue on the csl schema issue tracker: https://github.com/citation-style-language/schema/issues/417

As Bastien has pointed out, the schema is unclear here, but Sebastian has confirmed my initial impulse: setttings on lower elements should have precedence over settings on higher elements. That would be consistent with how name elements behave.

Anyway, I’m not sure this is the issue here as you don’t call the macro with a `text-case` attribute.

Maybe it’s due to your item metadata : the language of the item is set to « English ». I don’t know if that works. Try againg with « en ».

Some other hints :
- why do you use a group on 89–91. There only one variable to render so ne need for a group.
- line 119 : don’t use hardcoded values for « (ed.) ». there a dedicated label mechanism for that: https://docs.citationstyles.org/en/stable/specification.html#label-in-cs-names

Best,
Denis




Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Mittwoch, 25. Mai 2022 19:25
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Divergent styling when using CSL in pandoc(?)

Following up on my original post, I have tried to follow Bastien Dumont's advice to get book titles in title case (i.e. 'add title-case="title" in the relevant places') , however I am having no luck and running into what seems to me to be a curious issue.
I have included my minimal Markdown file, minimal json bibliography and the CSL file.

The problem: I cannot get book titles to appear in title case.

The relevant line in the CSL file would seem to be line 90.

  *   If I set text-case="uppercase" in line 90, then the book titles appear as UPPERCASE in both citation and bibliography.
[cid:image001.png-DGsOREnK7w13ekDzkDS8szRmByFHzeGd@public.gmane.org]

  *   If I set text-case="lowercase" in line 90, then the book titles appear as lowercase in both citation and bibliography.
[cid:image002.png-DGsOREnK7w13ekDzkDS8szRmByFHzeGd@public.gmane.org]

Those experiments suggest to me that line 90 is indeed the relevant line for setting book title case.

However, if I set text-case="title" in line 90, then the book titles appear in "capitalize-first" case.

[cid:image003.png-DGsOREnK7w13ekDzkDS8szRmByFHzeGd@public.gmane.org]

But, again, as in my original post, if I insert the citation directly in LibreOffice using the Zotero plugin, the titles appear correctly, in title-case.

[cid:image004.png-DGsOREnK7w13ekDzkDS8szRmByFHzeGd@public.gmane.org]

The issue only comes up when using pandoc for conversion.

If the issue is, as Denis suggests, something to do with nesting / precedence, I would be grateful is someone could point out where my CSL file is creating that conflict. I have tried to find something but without any success.
But it seems odd to me if that is the case that I *can* set the titles to "uppercase" and "lowercase" but *not* to "title" case when changing the same line.

And, again, this only arises with pandoc conversion.

So is this something I can change in my CSL? Or is this a pandoc issue?


denis...-NSENcxR/0n0@public.gmane.org<mailto:denis...-NSENcxR/0n0@public.gmane.org> schrieb am Freitag, 20. Mai 2022 um 20:45:54 UTC+2:
> -----Ursprüngliche Nachricht-----
> Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
> dis...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
> Gesendet: Freitag, 20. Mai 2022 15:43
> An: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> Betreff: Re: Divergent styling when using CSL in pandoc(?)
>
> [...] On the other hand,
> the specification does not define the expected behaviour for all cases. The
> issue documented by your first screenshot is a good example of that. The
> "title" macro is called on l. 332 with the attribute text-case="title", but the
> <text> element on l. 117 included in this macro has text-case="lowercase":
> which one should have the precedence? Unless I have missed something, the
> CSL specification does not define that, so Pandoc applies the attribute value
> set on the upper-most element and citeproc-js that of the inner-most
> element. Neither is wrong, so the only solution is to avoid such conflicts in
> your stylesheet (e.g. by removing the attribute on l. 332).

Good catch. I'll open an issue on the CSL schema repo. But concerning precedence have a look at https://docs.citationstyles.org/en/stable/specification.html#inheritable-name-options where you'll find:

> When an inheritable name attribute is set on cs:style, cs:citation or cs:bibliography, its value is used for all cs:names elements within the scope of the element carrying the attribute. If an attribute is set on multiple hierarchical levels, the value set at the lowest level is used.

That's about inheritable name attributes, sure. But I'd infer from that that there seems to be a preference for settings at lower levels.
Maybe we should prohibit the use of styles and text-casing with macros as these run somewhat against the purpose of macros...

Denis
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/4217cb45-f6db-4b04-a598-20ac2422d02an%40googlegroups.com<https://groups.google.com/d/msgid/pandoc-discuss/4217cb45-f6db-4b04-a598-20ac2422d02an%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/727f6fde7695493c8d44da2ed2cb52b1%40unibe.ch.

[-- Attachment #1.2: Type: text/html, Size: 17597 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 6454 bytes --]

[-- Attachment #3: image002.png --]
[-- Type: image/png, Size: 5495 bytes --]

[-- Attachment #4: image003.png --]
[-- Type: image/png, Size: 5628 bytes --]

[-- Attachment #5: image004.png --]
[-- Type: image/png, Size: 5868 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Divergent styling when using CSL in pandoc(?)
       [not found]                   ` <727f6fde7695493c8d44da2ed2cb52b1-NSENcxR/0n0@public.gmane.org>
@ 2022-05-26  7:18                     ` John Carter Wood
  0 siblings, 0 replies; 12+ messages in thread
From: John Carter Wood @ 2022-05-26  7:18 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1918 bytes --]

It was, in fact,...

denis...-NSENcxR/0n0@public.gmane.org schrieb am Mittwoch, 25. Mai 2022 um 23:36:08 UTC+2:

>   
>
> Maybe it’s due to your item metadata : the language of the item is set to 
> « English ». I don’t know if that works. Try againg with « en ».
>
> ...the item metadata! Switching to "en" fixed the problem. I now realise I 
have some inconsistent fields in my Zotero database, and I happened to use 
one of them for my tests. In retrospect, this is obvious (and explains why 
"uppercase" and "lowercase" worked but "title" did not), but I was being 
thrown off by it working fine when inserting directly via Zotero. I 
wouldn't have thought of the item-metadata. 

Thank you for your help and patience!
 
As to your other questions:

>  - why do you use a group on 89–91. There only one variable to render so 
> ne need for a group.
>
That was a remnant from an experiment of mine to solve the problem, which 
failed but the group tags remained. I will remove. 

> - line 119 : don’t use hardcoded values for « (ed.) ». there a dedicated 
> label mechanism for that: 
> https://docs.citationstyles.org/en/stable/specification.html#label-in-cs-names
>
>  
>
This was, I believe, in the CSL file I used as my starting point. Thanks 
for the tip, I will look into this. 

I still have some issues to solve, but I thank you all for the help on 
solving these. I feel like I'm (slowly, painfully...) learning something. 

Best,
John

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5de26d44-b649-4ef3-843f-eba64fea0b7bn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4231 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-05-26  7:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AQHYbDjihMB6Uii56E23JjqNZrfiNK0npPkAgABzaCCAB6Z9gIAAY+Sw>
     [not found] ` <AQHYbDjihMB6Uii56E23JjqNZrfiNK0npPkAgABzaCA=>
2022-05-20 11:00   ` Divergent styling when using CSL in pandoc(?) John Carter Wood
     [not found]     ` <0daa1a20-d847-47f5-a465-708c7875ff8an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-05-20 11:32       ` John Carter Wood
2022-05-20 13:42       ` Bastien DUMONT
2022-05-20 14:56         ` John Carter Wood
     [not found]           ` <e4cef3f2-bf3f-4359-87b7-61f9f3309670n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-05-20 15:50             ` Bastien DUMONT
2022-05-20 16:06               ` John Carter Wood
     [not found]                 ` <04626317-9c4b-4135-abfb-5ab0ae4909b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-05-20 16:15                   ` Bastien DUMONT
2022-05-20 16:37                     ` John Carter Wood
2022-05-20 18:45         ` AW: " denis.maier-NSENcxR/0n0
     [not found]           ` <ae5227d7f2574c9ea33550a84d6e03e9-NSENcxR/0n0@public.gmane.org>
2022-05-25 17:25             ` John Carter Wood
     [not found]               ` <4217cb45-f6db-4b04-a598-20ac2422d02an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-05-25 21:36                 ` AW: " denis.maier-NSENcxR/0n0
     [not found]                   ` <727f6fde7695493c8d44da2ed2cb52b1-NSENcxR/0n0@public.gmane.org>
2022-05-26  7:18                     ` John Carter Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).