From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30590 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Carter Wood Newsgroups: gmane.text.pandoc Subject: Re: Divergent styling when using CSL in pandoc(?) Date: Fri, 20 May 2022 09:06:19 -0700 (PDT) Message-ID: <04626317-9c4b-4135-abfb-5ab0ae4909b5n@googlegroups.com> References: <0daa1a20-d847-47f5-a465-708c7875ff8an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_984_770189636.1653062779682" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5201"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCYPBGVKTEEBB7HYT2KAMGQE44TEG5A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 18:06:27 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f186.google.com ([209.85.167.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ns58y-0000zK-Ma for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 May 2022 18:06:24 +0200 Original-Received: by mail-oi1-f186.google.com with SMTP id r10-20020aca440a000000b0032909da55c1sf4184904oia.4 for ; Fri, 20 May 2022 09:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=UcWzuaOZaU0w5M7qp67NtTPj+ld/FPRlWxEBz7mADr0=; b=frx2Sfh+yiU8TbbyltM0o13yQcvNW6I2YUj3KsVRyFAd4eFBumz0Ul041iNZ70Emh6 AdDdS9kKzIeRyiUVI6F9liBGKiqQhRn5wuOZoPK0+hfNdKUs5ZOMToTwRAdBosvGXLuY WfTHhm+6SFbVpAsBKILi5Bdy5Tn15MyeHd1xsRymo3nyZLFjGcqDuNQzrj9zbd4olTsB unzPNrevqm40Jo/7aQs4QC/tRUcdbxzCsP3/MPaKYQ7qu+J2/KZfk9Mpql7IU7dFfR1z cDzYLdyD7tlMKMEE/qmQN6f8YmREuRSVuldwzuGy4w2ULkVrD3rXfKP/XImmzWFX08V/ qPaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=UcWzuaOZaU0w5M7qp67NtTPj+ld/FPRlWxEBz7mADr0=; b=xVraQFg24jrbnQcGF0QdMsgXzI+Vx2IARVtTzG0SWvb9rUg9mCQ1pnkLKa5cEjRmLv BssCB1+8DntXYpvaKIMa86L+fC5Jy+w3eX0jCnw7DqCrDOPzwnAI0BIPakljWl3nyhX6 CwwukTRNhME5pgRcEIZJfAullCLMiNhIxGA1ylcrhbMJ02Kho3/SBcokB3CqwGMtl4XT FuFwkTrSVvmssGPrV1xUq57Ra/cvtCM1Y1wmcVAKZ7uQDgFA1grz1HiEjRTt3ivPVJ65 BmD897RYA++k73epY3I/5/vLXPUoXclh4NdasYpu6o5Fm9fLzBGuiOde9U3VHqEw+WSe wGQQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533FXN5cXyuPOn6c7JLVj9KwVD1M2dYTl9sPLX324rByiJFL77xE nn5jyaK0ABDkcfE/M8RjOfE= X-Google-Smtp-Source: ABdhPJxYnkfeyS8WRHkvYibFcmbF7xclP92Jdj7+uGShkyphNjRYnTus0Xo9Dy7Kh8XJfJQl7sWcDQ== X-Received: by 2002:a05:6820:160b:b0:35f:2ac3:1aa6 with SMTP id bb11-20020a056820160b00b0035f2ac31aa6mr4522240oob.43.1653062783525; Fri, 20 May 2022 09:06:23 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:79b:b0:f1:f328:8e8a with SMTP id o27-20020a056871079b00b000f1f3288e8als2143190oap.7.gmail; Fri, 20 May 2022 09:06:20 -0700 (PDT) X-Received: by 2002:a05:6870:b254:b0:ec:6ca4:c89f with SMTP id b20-20020a056870b25400b000ec6ca4c89fmr6471741oam.272.1653062780284; Fri, 20 May 2022 09:06:20 -0700 (PDT) In-Reply-To: X-Original-Sender: woodjo-ZOsAvrTRSvuEhhMi0yms2Q@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:30590 Archived-At: ------=_Part_984_770189636.1653062779682 Content-Type: multipart/alternative; boundary="----=_Part_985_1232613995.1653062779682" ------=_Part_985_1232613995.1653062779682 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you! Removing text-case=3D"title" on l. 312 does solve the et al. and= =20 ed. problems.=20 But then book titles (e.g., the Mumford citation in the examples I sent)=20 becomes sentence case, and I need book titles to be in title case. Hmmm.=20 Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 17:50:41 UTC+2: > Remove also text-case=3D"title" on l. 312. As for the p./pp. issue, I don= 't=20 > have any explanation... It may be a bug. > > Le Friday 20 May 2022 =C3=A0 07:56:58AM, John Carter Wood a =C3=A9crit : > > Thank you! > >=20 > > That's a helpful explanation. My own workflow is based on Markdown /=20 > Pandoc, so > > that's the "right" version as far as I'm concerned. :-) > >=20 > > I removed the attribute as you suggested, but the et al. and ed. are=20 > still > > being capitalised in the notes (though not in the bibliography...I feel= =20 > like > > this should help, but this is my first escapade with re-writing CSL, so= =20 > this > > insight hasn't brought me any further). > >=20 > > I have attached an .md file, a .json bibliography and a new version (19= )=20 > of the > > .csl file (that includes the change you suggested in the last version). > >=20 > > The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IEG-2-19.doc= x > > --citeproc --lua-filter pandoc-quotes.lua" > >=20 > > The bibliography is specified in the YAML header. > >=20 > > I hope I have done all this right. > >=20 > >=20 > > Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2: > >=20 > > When testing your CSL file, you should be aware that Zotero and (I gues= s) > > the Visual Editor rely on citeproc-js, which is not fully compliant wit= h > > the CSL specification. Sometimes, Pandoc is right against them. For > > instance, if I remember well, the default value for the "match" attribu= te > > is "any" in citeproc-js, although it should be "all" (as it is in=20 > Pandoc). > > On the other hand, the specification does not define the expected=20 > 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 attribu= te > > text-case=3D"title", but the element on l. 117 included in this= =20 > macro > > has text-case=3D"lowercase": which one should have the precedence? Unle= ss 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 on= ly > > solution is to avoid such conflicts in your stylesheet (e.g. by removin= g > > the attribute on l. 332). > >=20 > > 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= =20 > MD > > file with a stylesheet and a bibliography? > >=20 > > Le Friday 20 May 2022 =C3=A0 04:00:49AM, John Carter Wood a =C3=A9crit = : > > > 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=20 > 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 unwant= ed > > > variations on a few points > > > > > > There are a few issues, but the format for items in collections seems= =20 > to > > be the > > > main one. > > > > > > Here is a screenshot of the same citation: the one on top (which=20 > formats > > > incorrectly) was created by using pandoc. The one on the bottom (whic= h > > 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, wh= en > > the > > > locator is a single page, *the page range for the whole citation*=20 > revert > > to a > > > single "p.", even when it should be plural; if the locator is more th= an > > 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=20 > 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=20 > 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=20 > progress): > > > > > > [2]https://pastebin.com/xefmukzw > > > > > > Thanks in advance for any help. > > > > > > -- > > > You received this message because you are subscribed to the Google=20 > Groups > > > "pandoc-discuss" group. > > > To unsubscribe from this group and stop receiving emails from it, sen= d=20 > 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=3Demail& > > utm_source=3Dfooter > >=20 > >=20 > >=20 > >=20 > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > 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= . > >=20 > > References: > >=20 > > [1] https://editor.citationstyles.org/visualEditor/ > > [2] https://pastebin.com/xefmukzw > > [3] https://groups.google.com/d/msgid/ > > [4] http://40googlegroups.com/ > > [5]=20 > https://groups.google.com/d/msgid/pandoc-discuss/0daa1a20-d847-47f5-a465-= 708c7875ff8an%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > [6] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [7]=20 > https://groups.google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-= 61f9f3309670n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > > --- > > title: CSL-Test-2=20 > > subtitle: Minimal CSL file=20 > > 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=20 > [@latourette_community_1938, 15]. Donec "hendrerit tempor tellus"=20 > [@oldham_responsible_1948]. Donec pretium posuere tellus=20 > [@latourette_community_1938, 10-12]. Proin quam nisl, "tincidunt et,=20 > 'mattis eget', convallis nec, purus" [@muller_european_2011, 585]. Cum=20 > sociis natoque penatibus et magnis dis parturient montes, nascetur=20 > ridiculus mus. Nulla posuere [@muller_european_2011, 586-587]. Donec vita= e=20 > dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla.=20 > Nullam rutrum. Nam vestibulum accumsan nisl [@mumford_technics_1934, 45]. > >=20 > > # Bibliography > >=20 > > > > --=20 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 e= mail 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. ------=_Part_985_1232613995.1653062779682 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you! Removing text-case=3D"title" on l. 312 does solve the et al. and= ed. problems.

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


Bastien Dumont schrieb am Freit= ag, 20. Mai 2022 um 17:50:41 UTC+2:
Remove also text-case=3D"title" on l.=C2= =A0312. As for the p./pp. issue, I don't have any explanation... It may= be a bug.

Le Friday 20 May 2022 =C3=A0 07:56:58AM, John Carter Wood a =C3=A9crit = :
> Thank you!
>=20
> That's a helpful explanation. My own workflow is based on Mark= down / Pandoc, so
> that's the "right" version as far as I'm concern= ed. :-)
>=20
> I removed the attribute as you suggested, but the et al. and ed. a= re 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 CS= L, so this
> insight hasn't brought me any further).
>=20
> I have attached an .md file, a .json bibliography and a new versio= n (19) of the
> .csl file (that includes the change you suggested in the last vers= ion).
>=20
> The command I used was "pandoc CSL-Test-2.md -o CSL-Test-2-IE= G-2-19.docx
> --citeproc --lua-filter pandoc-quotes.lua"
>=20
> The bibliography is specified in the YAML header.
>=20
> I hope I have done all this right.
>=20
>=20
> Bastien Dumont schrieb am Freitag, 20. Mai 2022 um 15:42:47 UTC+2:
>=20
> When testing your CSL file, you should be aware that Zotero an= d (I guess)
> the Visual Editor rely on citeproc-js, which is not fully comp= liant 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 expec= ted behaviour
> for all cases. The issue documented by your first screenshot i= s a good
> example of that. The "title" macro is called on l.= =C2=A0332 with the attribute
> text-case=3D"title", but the <text> element on= l.=C2=A0117 included in this macro
> has text-case=3D"lowercase": which one should have t= he precedence? Unless I
> have missed something, the CSL specification does not define t= hat, so
> Pandoc applies the attribute value set on the upper-most eleme= nt 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.= =C2=A0by removing
> the attribute on l.=C2=A0332).
>=20
> As for the issue with "p./pp.", I guess that the pro= blem is in your
> Markdown input, but I can't be sure. Could you provide a m= inimal sample MD
> file with a stylesheet and a bibliography?
>=20
> Le Friday 20 May 2022 =C3=A0 04:00:49AM, John Carter Wood a = =C3=A9crit :
> > I have been working on creating a CSL style for the publi= cation
> house-style at
> > my institution: I've been making progress adapting an= other style but am
> running
> > into a few issues that seem to only crop up when using th= e CSL during a
> > document transformation with pandoc (version 2.18, with C= SL file
> specified in a
> > YAML block). In the preview for the visual editor they lo= ok 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 ther= e are unwanted
> > variations on a few points
> >
> > There are a few issues, but the format for items in colle= ctions 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 c= itation* 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 citati= ons in the
> visual
> > editor at for CSL ([1]https://editor.citationstyles.org/visua= lEditor/),
> 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 i= s 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&#= 39;s a way to solve
> this.
> >
> > Here, for reference, is my CSL file (which is still a wor= k in progress):
> >
> > [2]https://pastebin.co= m/xefmukzw
> >
> > Thanks in advance for any help.
> >
> > --
> > You received this message because you are subscribed to t= he Google Groups
> > "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails = from it, send an
> email
> > to [1]pandoc-d= iscus...-/JYPxA39Uh5TLH3MbocFFw@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:pan= doc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2] [5]https://groups.google.com/d/msgid/pandoc-discuss/<= /a>
> 0daa1a20-d847-47f5-a465-708c7875ff8an%
40googlegroups.com?utm_med= ium=3Demail&
> utm_source=3Dfooter
>=20
>=20
>=20
>=20
> --
> 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...@= googlegroups.com.
> To view this discussion on the web visit [7]https://groups.google.com/d/msgid/
> pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40googlegroups.com.
>=20
> References:
>=20
> [1] https://editor.citationstyles.org/visualEditor/
> [2] https://pastebin.com/xefmuk= zw
> [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%40= googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter
> [6] mailto:pandoc-discu= s...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups= .google.com/d/msgid/pandoc-discuss/e4cef3f2-bf3f-4359-87b7-61f9f3309670n%40= googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter

> ---
> title: CSL-Test-2=20
> subtitle: Minimal CSL file=20
> 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 [@latoure= tte_community_1938, 15]. Donec "hendrerit tempor tellus" [@oldha= m_responsible_1948]. Donec pretium posuere tellus [@latourette_community_1= 938, 10-12]. Proin quam nisl, "tincidunt et, 'mattis eget', c= onvallis 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 trist= ique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam v= estibulum accumsan nisl [@mumford_technics_1934, 45].
>=20
> # Bibliography
> =09



--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
------=_Part_985_1232613995.1653062779682-- ------=_Part_984_770189636.1653062779682--