public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: <denis.maier-NSENcxR/0n0@public.gmane.org>
To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: AW: Divergent styling when using CSL in pandoc(?)
Date: Wed, 25 May 2022 21:36:01 +0000	[thread overview]
Message-ID: <727f6fde7695493c8d44da2ed2cb52b1@unibe.ch> (raw)
In-Reply-To: <4217cb45-f6db-4b04-a598-20ac2422d02an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- 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 --]

  parent reply	other threads:[~2022-05-25 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHYbDjihMB6Uii56E23JjqNZrfiNK0npPkAgABzaCCAB6Z9gIAAY+Sw>
     [not found] ` <AQHYbDjihMB6Uii56E23JjqNZrfiNK0npPkAgABzaCA=>
2022-05-20 11:00   ` 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                 ` denis.maier-NSENcxR/0n0 [this message]
     [not found]                   ` <727f6fde7695493c8d44da2ed2cb52b1-NSENcxR/0n0@public.gmane.org>
2022-05-26  7:18                     ` John Carter Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=727f6fde7695493c8d44da2ed2cb52b1@unibe.ch \
    --to=denis.maier-nsencxr/0n0@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).