public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Thomas Newhall <tom.newhall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: citeproc hack for multilingual citations?
Date: Mon, 11 Dec 2023 17:48:36 -0800 (PST)	[thread overview]
Message-ID: <8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn@googlegroups.com> (raw)


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

Hello everyone,

I'm trying to use pandoc's citeproc to render multilingual citations, saved 
in zotero, and automatically exported to CSL JSON. I wrote about this issue 
on the Zotero forum 
<https://forums.zotero.org/discussion/110097/using-the-note-field-for-rendering-mutilingual-text-with-csl#latest> earlier 
today, but was told this was "more of a Pandoc issue". I see there are also 
similar threads on this forum here 
<https://groups.google.com/g/pandoc-discuss/c/mjmQqT3xJd0/m/RVkHA6a4AgAJ>, 
here 
<https://groups.google.com/g/pandoc-discuss/c/iYW55X9PDWA/m/lGwXhHslAgAJ>, 
and here 
<https://groups.google.com/g/pandoc-discuss/c/BaD8D5y7Nb8/m/SHjZk2rKAAAJ>, 
but I couldn't determine whether the solutions provided would work for me.

I know there are some limitations to citeproc (that may be getting 
addressed with the citeproc-rs <https://github.com/zotero/citeproc-rs> 
project), but I am trying to figure out the best workaround that still 
maintains a markdown-based workflow. I think I almost have it as I need 
them, but there's a few issues still:

Right now, my html output renders like this:

Inline citation: (Ōtani 2016)

Bibliography:
Ōtani, Yūka 大谷由香. 2016. “(Ronbun) Nissōsō Shunjō wo hattan toshita nissōkan 
‘Enshū kaitai’ ronsō[論文]入宋僧俊芿を発端とした日宋間「円宗戒体」論争.” *Nihon Bukkyō sōgō kenkyū 
日本仏教綜合研究* 14: 105–132.

There are two changes I would like to make to this.

First, I would like to be able to *keep the inline citation as is, while 
removing the comma after the name "Ōtani" in the bibliography*. This would 
be possible with Juris-m if I were to simply copy-and-paste citations, but 
I was hoping to be able to have in-text citations linked to the 
bibliography (and, ideally, live citations), which seem like they will be 
difficult to implement if I'm not rendering citations using citeproc.

Second, I would like to *keep the English language transliteration of the 
journal title in italics (i.e. Nihon Bukkyō sōgō kenkyū), while making the 
Japanese text for the journal title (i.e. 日本仏教綜合研究) to be regular 
non-italicized text*. In a latex/pdf output this is no problem; latex 
ignores italicized Chinese characters, but I am wondering if it is possible 
with the HTML output. I thought this would be possible by including the 
Japanese text for the title of the journal as a "note" field, but I 
couldn't get the "note" field to print at all (see following example). 
Alternatively, if there were a way to simply tell css to ignore italics for 
Chinese/Japanese fonts (like latex does), that could work.

Here is the (Better)CSL-JSON for this entry:

```json
{
"id": "otani-2016",
"author": [{ "family": "Ōtani", "given": "Yūka 大谷由香" }],
"citation-key": "otani-2016",
"container-title": "Nihon Bukkyō sōgō kenkyū 日本仏教綜合研究",
"DOI": "10.20588/nbs.14.0_105",
"ISSN": "1348-4850",
"issued": { "date-parts": [["2016"]] },
"language": "jpn",
"note": "cjk-title: 日本仏教綜合研究",
"page": "105–132",
"publisher": "日本仏教綜合研究学会",
"source": "search.library.ucla.edu",
"title": "(Ronbun) Nissōsō Shunjō wo hattan toshita nissōkan 'Enshū kaitai' 
ronsō[論文]入宋僧俊芿を発端とした日宋間「円宗戒体」論争",
"type": "article-journal",
"volume": "14"
}
```

And here is the CSL of the portion that I think will apply to this case:

```
< /macro>
    <macro name="container-title">
        <choose>
            <if type="chapter entry-dictionary entry-encyclopedia 
paper-conference" match="any">
                <text macro="container-prefix" suffix=" "/>
            </if>
        </choose>
        <choose>
            <if type="webpage">
                <text variable="container-title" text-case="title"/>
            </if>
            <else-if type="legal_case" match="none">
                <group delimiter=" ">
                    <text variable="container-title" text-case="title" 
font-style="italic"/>
                    <choose>
                        <if variable="note">
                            <text variable="note"/>
                        </if>
                    </choose>
                </group>
            </else-if>
        </choose>
    </macro>
````

If this is impossible to do with a "hack" (i.e. using the note field for 
the Chinese/japanese title) in CSL or zotero, is is possible to wrote some 
custom (lua or python) filter that either gets rid of the commas or gets 
rid of the italics (or both)?

Thanks in advance,
Tom

-- 
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/8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn%40googlegroups.com.

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

             reply	other threads:[~2023-12-12  1:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  1:48 Thomas Newhall [this message]
     [not found] ` <8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-12-12  6:43   ` Bastien DUMONT

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=8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn@googlegroups.com \
    --to=tom.newhall-re5jqeeqqe8avxtiumwx3w@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).