From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23398 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Transliterated and original titles/names in citations Date: Sat, 7 Sep 2019 10:59:31 +0200 Message-ID: References: <0c05fcec-fbb7-aed6-c1ec-e84610bcdd96@gmail.com> <38609be6-0edc-4755-b2e7-6448795c907c@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009b7ef80591f2c6e7" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218490"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBAPDZXVQKGQEA6ASEGA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Sep 07 10:59:48 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf1-f185.google.com ([209.85.210.185]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i6WZP-000uhJ-JF for gtp-pandoc-discuss@m.gmane.org; Sat, 07 Sep 2019 10:59:47 +0200 Original-Received: by mail-pf1-f185.google.com with SMTP id t24sf6321342pfe.23 for ; Sat, 07 Sep 2019 01:59:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567846785; cv=pass; d=google.com; s=arc-20160816; b=zX8nTJVmFImxq4Ns+LrQ1yD/3/b/PYfxGd23m2ER3WX83oBu914mZK7akP6ewSeVDd tmiZPG4fnSisWNmWOJj/wyuO44JibQHGLqM46pqX0FEFX/ICEIbvB+IU1ZZvd0PsLRmP jbR4aSaB/NyT29QYyPEcm5LLgccIq5ZfHWbszDJ6+rP1IVxgoeZ4HPYnHJ0tS2aSQU/F To++PYJVCElz2YSW0wDxHbYLpvjrvYsdMI+2//BBYAKu+LNAOW1ZtgtiJan+8r9W7pLI FvaMm/U7AN3XwRcQDv6B7o/zL2GeWiHaDejdPwY3dwgNSnxSyNAOkzopbglEw4PbYz8w C4jQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=eHcnLWJvMhSQ3diZUmhJbyBmdrBfdA9F0MF9yQhxJ9Q=; b=MEfCcvzuf7LbwzNOSB+k1MUGgtdbU8fyxWK/zg4tkLFcjxhaeDKWVIYESk0PQUd/hH +ypxSEd57j4QyOkhzE/D7awZcKVRDjzUof5XAWjqiXvwCnFxMwnxSCXdz46ItRRNr+sj RkWG4Pl3wf3o/JaasR4BXPA5SoAVnToe/6PmLjbATtkmOcA3tBbjwZZRcH7vKRS7Ul9a 2oZdQUU9P65ayuaka2PJGPER4CEbTMUMubyr2m4j02kUnevZbneN8RzjZ2Q607b20+Ex nQ83NaZfwNrsBBhiecNdPyGnmCtFUiPzTgBhWyJergnu2PCxvJc1z/Eg57Ca3ez6mdDf EblQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XuZ4SMSl; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::330 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=eHcnLWJvMhSQ3diZUmhJbyBmdrBfdA9F0MF9yQhxJ9Q=; b=NcF7xs+ymBSsigKsT0Np1yCiQ9miwqfY1MNMo9ZyHmdgG0Yi7hJ+DwhMl2g7IpCMq6 xmcXZya6LqVnFho8b52WAiBRQ7+pPtblAExFrEq5TllH5MX0TZfocklDSpVIXV1j8cy4 yv0GgeUrnBfWths01IHYpCUXZp9Vz56gPXK2GkgVaRPEUmhkwxZqEfVYeJaFjTkhy7yK UNr/3jVgaHXN1EBoc9HldNdREi4neKpKX9ZbmoIV9Jq3SIhXXRmsKUlo9gXTSDCHhsOA jOHy+yyCzh36wsm+vvTSWzbceofisLIJ+vrFPr3XbF98dbxL4YEELkjwmenQsty5VAl1 T9SQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=eHcnLWJvMhSQ3diZUmhJbyBmdrBfdA9F0MF9yQhxJ9Q=; b=GaY4xNPjgA2xa3YaQl0S9FL+VDqGN5gUK/R1850KlIk+GrwqtqAm0IMv/+romvsrQL MmElTJ/qzZBpMcqN0upC7LOCHalWn+WMhB3SwX0rZPssQV4IIIa5AGtkGSvDZDzz0x3g 3Forbfaw9gkUJMmMPT8Ksv+ceVTNn0WWLnv4Vf3NCMKKrdp6JFepraNeX4itjZEjjz0H ddawAjmb1oWUj9vUA6YfC9MynxT1zOLo3Vy7nnVaRiI6VQPn7WUko9b8tiLepMnHdwQ1 FBj+Sl0CSxYOuj8wTbh+KO5SvxsTa6uCahBgRhkOw1/FRHBktOSl4+nMOAii+2Hd1ETH 5UDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=eHcnLWJvMhSQ3diZUmhJbyBmdrBfdA9F0MF9yQhxJ9Q=; b=VEudur8YL/sH4JELa5u0AV7JAuyE0ln4r4XwGS1fxXoUu8NzOp4sU6RNArFBZnE6XJ ImmCMAdVkxQyWHcpT8TJA4RBTtuLhWWKG4CP9hK25lEKMSE3iVy/ACPx2Xbh8KDg42iy uu1XSsMeHbFi3UlosKyD5hCggpYC11LjK8MctwnYjYXnXLpVDFHx6BiNCMzWUwgAewiw vhMVeCRmZMrO3U+C90x9FDV4lz/fuIaQ3O5fy8CB8mim9NGok6VFnp+CKmnOmux6yqmY 0VqNIxW8BrTLjPxz4C8CLvdZFPxbSeOBgSre0udUaVLZeALPaByT5dOakZq+CE/rbAez uiIA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWyXnLXxhqshY96ONVSnTCd+QQagG7B0tfYzj5FLwlk6zQ+HcR+ 357qQBK2KHbaCZsGWC+QlUQ= X-Google-Smtp-Source: APXvYqw3pIeMVHL4O/I8kB0d8psuG3+rclIukOAxeN9+tBhMYGjdaUt36lv6KlFsw7VhpLvEzg9a/Q== X-Received: by 2002:a17:90b:308:: with SMTP id ay8mr14163524pjb.7.1567846785756; Sat, 07 Sep 2019 01:59:45 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a62:ce4e:: with SMTP id y75ls2357816pfg.11.gmail; Sat, 07 Sep 2019 01:59:44 -0700 (PDT) X-Received: by 2002:a63:f118:: with SMTP id f24mr11927809pgi.322.1567846784680; Sat, 07 Sep 2019 01:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567846784; cv=none; d=google.com; s=arc-20160816; b=ioqMz8umV6ezQ2Clu4WRfDRAQ+5QPuea7vtfg05eXYME/EO6Q+zCh94kXjJPuysR77 UhBNSbbjQtAvpsb00IhNSlwosqp45W58v5yLDv3Xo4WrCs1hUQdXSf3XnQFgulnQ+20c 9MyPTvUv/prGdB/rrervrkl2eW7AfS3x91n9EVMSGYvzmk8/4x5wS5VG1pgcQnimHFhY IXv/1H6KMHM7rGohmHg/i6uUEIia2hRKpQQkYSsbdDGD4RkHcwoZFODgLjQWoMpMOxYL s6PLyDzIqfNsSduCBYuFYVgwQwOT/UBHPfVurB5eveOQ1T4SO3DZ3Fz05yE0B39+OiI3 HsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=A+cQvv2W5yx868YT29flPhdITSisHgH/N3aQWd8D3ro=; b=G7G+/WcyYyZG338c2txmK3agIRolFMWc9L8XIu/OqX1CdWBHiXGvnb2M4mT/ISIoFN SNLPifRkBYXbDsyZf4f2JOTZwS5t/YUBPmgyxc7VgLhd4KHX5x9o/C+t4dmNwjaAkeMW 0r04TGra7UlB9zfaZkmE/QXQRx3LmUJsQDQL9cPrMjU17DLZX11th/+iIbEpAcypnx5l LIOIUJKxg3gjlEv+tVWiFWuYZCnAqvYSnpKKNMMi8gTti7MJu3M68+FURAX1YjE72ULv jIcyKsfAxk0TmqodlZ83e8VKEKAqIEchaO0seubjPixuDe5sH1Bq/3DUMMg82/p+qUED J8rQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XuZ4SMSl; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::330 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com. [2607:f8b0:4864:20::330]) by gmr-mx.google.com with ESMTPS id n11si26658pjp.0.2019.09.07.01.59.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2019 01:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::330 as permitted sender) client-ip=2607:f8b0:4864:20::330; Original-Received: by mail-ot1-x330.google.com with SMTP id h17so4208637otn.5 for ; Sat, 07 Sep 2019 01:59:44 -0700 (PDT) X-Received: by 2002:a9d:4711:: with SMTP id a17mr4784568otf.218.1567846783744; Sat, 07 Sep 2019 01:59:43 -0700 (PDT) In-Reply-To: <38609be6-0edc-4755-b2e7-6448795c907c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XuZ4SMSl; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::330 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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.org gmane.text.pandoc:23398 Archived-At: --0000000000009b7ef80591f2c6e7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, something like that, although mine is written in Perl and uses YAML::PP to parse both YAML and JSON which works just fine. :-) Den l=C3=B6r 7 sep. 2019 00:05Denis Maier skrev: > 1. I am almost sure that Pandoc will just ignore unknown fields, at least > that's what happened (unfortunately and to my disappointment) the last ti= me > I have tried to use non-standard fields in a style. > > 2. If you don't want to hardcode the transliteration into one of the > existing fields, the easiest solution might be to use something along the > lines of this script. > > ``` > import json > import argparse > > parser =3D argparse.ArgumentParser(description=3D'Merge title and subtitl= e > fields in CSL JSON with custom separator') > > parser.add_argument('-f', '--from', action=3D"store", dest=3D"from_file") > parser.add_argument('-t', '--to', action=3D"store", dest=3D"to_file") > parser.add_argument('-s', '--separator', action=3D"store", dest=3D"separa= tor", > default=3D": ") > > args =3D parser.parse_args() > > # Load JSON File > > with open(args.from_file, 'r') as from_file: > references =3D json.load(from_file) > > # Merge Title and Subtitle Fields > > for reference in references: > try: > reference['title'] =3D reference['title'] + args.separator + > reference['subtitle'] > reference.pop('subtitle', None) > except: > pass > > # Write results back to File > > with open(args.to_file, "w") as to_file: > json.dump(references, to_file, indent=3D2,ensure_ascii=3DFalse) > > ``` > > This will merge title and subtitle fields, but you can of course adapt > this to merge `title` and `title:transliteration`. (You'll need to you ha= ve > your reference data available in CSL JSON.) > > Best, > Denis > > Am Freitag, 6. September 2019 21:49:16 UTC+2 schrieb BP: >> >> Thanks everyone, especially Denis for the interesting information. Not >> what I had hoped for but kind of what I had expected. Usability with >> Pandoc=E2=86=92LaTeX is a must for me. I guess I could write my own code= to locate >> references, look up the data, invoke something which produces a >> bibliography in HTML, then massage that HTML into something Pandoc will >> convert into LaTeX appropriately. Sounds like a lot of work though =E2= =80=94 >> although not as much as implementing a whole citation processor! >> >> Another question is whether pandoc-citeproc will ignore unknown fields o= r >> throw an error? If the former I can have custom fields with the separate >> original and transliterated fields, as I need for my searching purposes = and >> automatically update the combined version in the official fields. If the >> latter I'll need to produce a special version for Pandoc's consumption w= ith >> the custom fields removed, which complicates things considerably. >> >> Den ons 4 sep. 2019 09:33BPJ skrev: >> >>> Does anyone know how to handle transliterated titles and names in >>> citations, when you want to include both the transliteration and the >>> original? Does CSL have any fields for that? >>> >>> TIA, >>> >>> /bpj >>> >> -- > 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/38609be6-0edc-4755-b2e7-= 6448795c907c%40googlegroups.com > > . > --=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/CADAJKhD1Yk6diC3RVC4SnSyEx9avVOto0nX3ZzbOXqxmmzDHHA%40mail.g= mail.com. --0000000000009b7ef80591f2c6e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, something like that, although mine is written in Per= l and uses YAML::PP to parse both YAML and JSON which works just fine. :-)<= /div>
D= en l=C3=B6r 7 sep. 2019 00:05Denis Maier <maier.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
1. I am almost sure that Pandoc will just igno= re unknown fields, at least that's what happened (unfortunately and to = my disappointment) the last time I have tried to use non-standard fields in= a style.

2. If you don't want to hardcode the= transliteration into one of the existing fields, the easiest solution migh= t be to use something along the lines of this script.

<= div>```
import json
import argparse

=
parser =3D argparse.ArgumentParser(description=3D'Merge titl= e and subtitle fields in CSL JSON with custom separator')
parser.add_argument('-f', '--from', action=3D&q= uot;store", dest=3D"from_file")
parser.add_argumen= t('-t', '--to', action=3D"store", dest=3D"to= _file")
parser.add_argument('-s', '--separator&#= 39;, action=3D"store", dest=3D"separator", default=3D&q= uot;: ")

args =3D parser.parse_args()

# Load JSON File

with open(a= rgs.from_file, 'r') as from_file:
=C2=A0 =C2=A0 reference= s =3D json.load(from_file)

# Merge Title and Subti= tle Fields

for reference in references:
= =C2=A0 =C2=A0 try:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 reference['tit= le'] =3D reference['title'] + args.separator + reference['s= ubtitle']
=C2=A0 =C2=A0 =C2=A0 =C2=A0 reference.pop('subt= itle', None)
=C2=A0 =C2=A0 except:
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 pass

# Write results back to File

with open(args.to_file, "w") as to_file:
=C2=A0 =C2=A0 json.dump(references, to_file, indent=3D2,ensure_asc= ii=3DFalse)

```

This will merge title and subtitle fields, but you can of course adapt thi= s to merge `title` and `title:transliteration`. (You'll need to you hav= e your reference data available in CSL JSON.)

= Best,
Denis

Am Freitag, 6. September 2019 21:49:16 UTC+2= schrieb BP:
Thank= s everyone, especially Denis for the interesting information. Not what I ha= d hoped for but kind of what I had expected. Usability with Pandoc=E2=86=92= LaTeX is a must for me. I guess I could write my own code to locate referen= ces, look up the data, invoke something which produces a bibliography in HT= ML, then massage that HTML into something Pandoc will convert into LaTeX ap= propriately. Sounds like a lot of work though =E2=80=94 although not as muc= h as implementing a whole citation processor!

Another question is whether pandoc-citeproc will ignore unk= nown fields or throw an error? If the former I can have custom fields with = the separate original and transliterated fields, as I need for my searching= purposes and automatically update the combined version in the official fie= lds. If the latter I'll need to produce a special version for Pandoc= 9;s consumption with the custom fields removed, which complicates things co= nsiderably.

Den = ons 4 sep. 2019 09:33BPJ <mel...-Re5JQEeQqe8@public.gmane.org= m> skrev:
Does anyone know h= ow to handle transliterated titles and names in
citations, when you want to include both the transliteration and the
original? Does CSL have any fields for that?

TIA,

/bpj

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/38609be6-0edc= -4755-b2e7-6448795c907c%40googlegroups.com.

--
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/CADAJKhD1Yk6diC3RVC4SnSyEx9avVOto0nX3ZzbO= XqxmmzDHHA%40mail.gmail.com.
--0000000000009b7ef80591f2c6e7--