public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: citeproc hack for multilingual citations?
Date: Tue, 12 Dec 2023 06:43:25 +0000	[thread overview]
Message-ID: <ZXgBDc7RKdBbLAOZ@localhost> (raw)
In-Reply-To: <8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

I don't understand why it should be a Pandoc issue. I can't help you for the HTML/CSS part, but I think that you can achieve what you want by modifying your CSL stylesheet only.

For the author, you use a custom variable in the "note" field specifying the author name as a literal string ("Ōtani Yūka") and use this variable (as a regular string variable, not a name) in the stylesheet for the bibliography. You will have to change the sorting rule to take account of this new variable.

When you use a variable in the "note" field, don't use "note", use the name of the variable. In your sample:

<choose>
  <if variable="cjk-title">
    <text variable="cjk-title"/>
  </if>
</choose>

Le Monday 11 December 2023 à 05:48:36PM, Thomas Newhall a écrit :
> 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 [1]Zotero forum earlier today, but was told this was "more of a Pandoc
> issue". I see there are also similar threads on this forum [2]here, [3]here,
> and [4]here, 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 [5]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 [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/8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn%40googlegroups.com.
> 
> References:
> 
> [1] https://forums.zotero.org/discussion/110097/using-the-note-field-for-rendering-mutilingual-text-with-csl#latest
> [2] https://groups.google.com/g/pandoc-discuss/c/mjmQqT3xJd0/m/RVkHA6a4AgAJ
> [3] https://groups.google.com/g/pandoc-discuss/c/iYW55X9PDWA/m/lGwXhHslAgAJ
> [4] https://groups.google.com/g/pandoc-discuss/c/BaD8D5y7Nb8/m/SHjZk2rKAAAJ
> [5] https://github.com/zotero/citeproc-rs
> [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/8fd3ff8c-44e7-4abe-9c65-38fb5debbb3dn%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/ZXgBDc7RKdBbLAOZ%40localhost.


      parent reply	other threads:[~2023-12-12  6:43 UTC|newest]

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

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=ZXgBDc7RKdBbLAOZ@localhost \
    --to=bastien.dumont-vwifzpto/vqstnjn9+bgxg@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).