From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30904 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sukil Etxenike arizaleta Newsgroups: gmane.text.pandoc Subject: Re: AW: Changing colons to full-stops in titles Date: Fri, 1 Jul 2022 19:28:48 +0200 Message-ID: References: <78df697a-50f5-46d0-b0b8-29a2cbc9509an@googlegroups.com> <2a8d940b3675472fb4b50ead406f6fc7@unibe.ch> <6621a84d-37f3-6741-bb0a-d4bfd6dac4bf@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------Ujs0ydNzGAWfcwIIhOI9bcoI" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30693"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0 To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDIN5YV3SMDBBU657SKQMGQETBE3BZI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jul 01 19:28:56 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f64.google.com ([209.85.167.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7KRs-0007kk-0k for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 01 Jul 2022 19:28:56 +0200 Original-Received: by mail-lf1-f64.google.com with SMTP id e8-20020ac24e08000000b0047fad5770d2sf1365229lfr.17 for ; Fri, 01 Jul 2022 10:28:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656696535; cv=pass; d=google.com; s=arc-20160816; b=o+LW2C4wTV/gnRqF99TLDWZeLbi20XpJuXA6TDV8lUQ2+M5gTVuTEaVVd7eMb331Q7 oNlUnOO6MyJlnlMX63mY9VoDbVhT/BJ5s5qRY9gspV8Dwrt6Cl9XeZdPz3Q7Kv1MUYFw EYtUALKPOKCePl05cQFgqYjVP0ACHecAxUphRIwSd4uzBZRvpnKnY9KL3L+Ggyk5VN5E bapgSX0oxWCeXIaUtrhyfEUxMKAw4YuNepwgr8iWVhJmSLgjOAlstF6QMzAuc23NVatN OW9XnDCySP9uwFrMXzCleytRqeuL/4BXk83fIhhhNhydxcAzVmGWSzzDaCd9/741YZkP aETw== 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:in-reply-to:from:to :references:content-language:subject:user-agent:mime-version:date :message-id:sender:dkim-signature:dkim-signature; bh=JX3jCHnaGaGtciDJ5DVouZr8s68d4y2M+FWS+rlmJ+w=; b=d5wAzqFORjG0XMAQs+lqest/EHeBBld8eXMG3Fj6FfS7WC4xLHM8JFuiRLx3rqQWD9 lbwnDuIjuJTRAtOgQ1DJ93AWfqu1/gzWBrGquMMxD6wTIO6me+6lkdUSpXBxaJMf0bKR V8g5fXFvdLrMHNfV0FynBXr4AOkt9SksRF/asdkGvTFyx5pjT9f4vsL1H5ZGy83BeNwV csXV6FZNEp/+W8eHqqHzUR3RUgsDcKI7mqgxzwlxKlchUsHrfS7yw0+RULSDdm8yCadS 5c7d5yr+i9gm3nNcZj3QkQAzReMIMeDaL9Rb4q4t5hJU+jVhvKGO1RuJ5Rt3GXPqyizX caVw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlrtfneZ; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=sukiletxe-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=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:references:to:from:in-reply-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=JX3jCHnaGaGtciDJ5DVouZr8s68d4y2M+FWS+rlmJ+w=; b=NCUmU+KTsNhv+rkqGU+9nYCTF4XHpLfFRjlMckgYiYKZkr7ZVM6HnfH5GzEmLHD+d/ gmeyRyOsPBpa7jC0bkRn0AsbPYTeOfkrzpa/MtwHBJ9IXJFMkPJfpWHkN3nSjQmF131m bQqoC8rfDPtuwpmsZ6Ngzm4WxP4bC2vgafyUSTB7rjwvUFU9soJ584OROWKnbqJSsf9m VA7/NQbmtbDI5UrMeM5WVK7r3OxQw/ra7XjXYc6pqFYN3B13mU4CbjmzsJO39bwU9zmH QvWzhpm8lmTZKpsT9h9QOYhPkPMCbowGuR7tBcDrXHTBqh5hV6zDv21fKQK0/p0+o8vF 0eCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :references:to:from:in-reply-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=JX3jCHnaGaGtciDJ5DVouZr8s68d4y2M+FWS+rlmJ+w=; b=Vaie1q9LNunuM+ZbPzIfGZbQZxkY8qx6egbLD+mfnM1wikg3phDBDnkyASCHwDONvQ eT7Sqky9tWla7Keqz5+rNCjILQ4VM7yRCW+ic5F51sD6rw4KXej//iOnH9rrpxNvqOGJ XOvswv1Fmdj8h0BDCfNd4LI6k4T3hWFPuXqWlUqDMSvsETMMtMBfx5XtGmcwXuD7LKik 9TE+ikjtdsHZb13uVLtFCcPgBhrC0zp2okoOVOfsCnbziXXrzhYv+0SByI9eWvVmCr7G E1K5Z3XJd8wyPLYxVB/sXYqYoAOtITy6UzKxICNRZWTLzIOVIhs5ZCtX1ALWuY5pgbkI 4kfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:message-id:date:mime-version:user-agent :subject:content-language:references:to:from:in-reply-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=JX3jCHnaGaGtciDJ5DVouZr8s68d4y2M+FWS+rlmJ+w=; b=lTbJyQ+TXqisQ049dQrV4Cdfe4aBEgN6yjqTjJWyVED5AImD931mSUUKdgygMrogLs /Qxqay7gN3+bywlxekYPBUaqnE/t79aZRj7RPvpgvKBHdHsgEZ0sn61NT1eDWKogOIOa YtYETU+ifDddhBzghRmQOjM5mpMhFRWoviIl2Xp68kgE4erItA/uw5AJp1i7uOt7Aoxe 5vFZFZg8sdiQZmUbrpfSKrGfj4zzEGmrOSUVFcESTfl1Kx6/f5O9f6kzw0opWJnaGTIi Cwunt2Hr/5o7Ukz4y6edzAdnJD7jgzwxyThmlQjNH3/uQcm7Vs2HtgC0fo4FRtSTZ8Zw Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora8uc41AkaYb3gCNYON1YhZC6ewo/NHDgJMDw1wQPuMZNtdyZR45 9Wp2eeNkBIedaov7XibZRxI= X-Google-Smtp-Source: AGRyM1vVPMHzYWl3ZzRdvdL/6iOBG7TeiGMnojNNuwHJChjwxVxBkTYxWV2ZiscGrk3PKzMNBEE63w== X-Received: by 2002:a05:6512:3b2c:b0:47f:6fc2:a9de with SMTP id f44-20020a0565123b2c00b0047f6fc2a9demr10871165lfv.352.1656696535319; Fri, 01 Jul 2022 10:28:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:651c:97:b0:25b:be22:345d with SMTP id 23-20020a05651c009700b0025bbe22345dls2950180ljq.8.gmail; Fri, 01 Jul 2022 10:28:50 -0700 (PDT) X-Received: by 2002:a2e:87da:0:b0:25a:6883:d6aa with SMTP id v26-20020a2e87da000000b0025a6883d6aamr9026530ljj.196.1656696530387; Fri, 01 Jul 2022 10:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656696530; cv=none; d=google.com; s=arc-20160816; b=TVn6obcGEw4pg6Lw6wDULghsA9Lxz3BNf+uoWq0AX6fKzCVs5sxj2hftBK8MEXOTza 1XfnzTyxnN0eNYrZs8vBp2pcbBtbSEam4yFC9avcqzgPY1U5UoEr9ZN/xiozw0NmAfn/ E+t5eUd2I/9a7AwS5g7EM4fyl/v4ka9GxYM+nSLZeaktZEDOnObU162qElrSq8791WYq YXBOvGCp1UjHcWPyecXaWVyiakuyW/FyQqFmQ09qq9SkBxv0Y376eRau9HLv3dC87fKY 0rRcWFjvm2gRMXnp395OZ0F48x+X6t2hknvxyNl5x5JNgfCXz7yhnzni22IcDV1PTe76 r/vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:from:to:references:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=ZTKVi26JCN/x7pWztZ2djCMbq5xPEbcl3KEj6LCflbg=; b=G1vkSDoR9zfjUiwX2BkeY082f634y6dKNGD//D3Pic1nW72qDxEdijNLlfOvcsIMDS M6rgmcLm6iYDHa8uQEmtGIOdLWqUzeWq4BGl5sJxQNlvBvYMMP/Jt83wGQ1MsD9GidC4 bLWkzBjWFn9m3pcZPeLRs8HARsSyZhDPjl4K73a45Ssp42zK0jsxVfuReaegNhivnW0l HUDpzkZaSRdVi2KbimpdpN29k3ufdp5gCfY2oxDc8GxITkAV7iawflC1odgCeGH3b0DQ i1YoG7KHUu/3gR2807hGDcmlUIL7jcXUkyssQ9qp9i3Qyf5PbPb5knHmmwBaM4Fxn904 +1gQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlrtfneZ; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com. [2a00:1450:4864:20::32e]) by gmr-mx.google.com with ESMTPS id g14-20020a0565123b8e00b004810be25317si729077lfv.4.2022.07.01.10.28.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 10:28:50 -0700 (PDT) Received-SPF: pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) client-ip=2a00:1450:4864:20::32e; Original-Received: by mail-wm1-x32e.google.com with SMTP id j7so1711653wmp.2 for ; Fri, 01 Jul 2022 10:28:50 -0700 (PDT) X-Received: by 2002:a05:600c:4282:b0:3a0:2ddf:4df3 with SMTP id v2-20020a05600c428200b003a02ddf4df3mr17546146wmc.45.1656696529601; Fri, 01 Jul 2022 10:28:49 -0700 (PDT) Original-Received: from [192.168.1.23] (139.red-2-141-190.dynamicip.rima-tde.net. [2.141.190.139]) by smtp.gmail.com with ESMTPSA id i1-20020adffc01000000b0021b5861eaf7sm23402619wrr.3.2022.07.01.10.28.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 10:28:49 -0700 (PDT) Content-Language: es-ES In-Reply-To: <6621a84d-37f3-6741-bb0a-d4bfd6dac4bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: Sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlrtfneZ; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=sukiletxe-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.io gmane.text.pandoc:30904 Archived-At: This is a multi-part message in MIME format. --------------Ujs0ydNzGAWfcwIIhOI9bcoI Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Woops, I mean this one (upper, not lower), and I needed a colon right=20 before it, not a period): =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(stringi= fy(el.title), ': (%l)',=20 '. %1':upper())) Hth, Sukil El 01/07/2022 a las 18:54, Sukil Etxenike arizaleta escribi=C3=B3: > > Denis, you beat me to it (I forgot about stringify and I ws not making=20 > progress). > > El 01/07/2022 a las 18:23, John Carter Wood escribi=C3=B3: > >> would this also ensure that the first word after the dot is capitalised?= =20 > > No, it won't ensure that the first character after the full stop is a=20 > capital. For that, you can change this line: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(string= ify(el.title), ':', '.')) > > With this one (haven't tested it but I think it should work): > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(string= ify(el.title), ': (%l)',=20 > '. %1'.lower())) > > Hth, > > Sukil > > > El 01/07/2022 a las 18:40, denis.maier-NSENcxR/0n0@public.gmane.org escribi=C3=B3: >> >> A slightly more reliable version: >> >> ``` >> >> local stringify =3D pandoc.utils.stringify >> >> function Meta(m) >> >> =C2=A0 if m.references ~=3D nil then >> >> =C2=A0=C2=A0=C2=A0 for _, el in ipairs (m.references) do >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -- print(stringify(el.title)) >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(strin= gify(el.title), ': ', '. ')) >> >> -- print(el.title) >> >> end >> >> end >> >> return m >> >> end``` >> >> (This won=E2=80=99t replace colons in biblical references, e.g. Gen 1:1) >> >> You can test with this file=C2=A0: >> >> ```markdown >> >> --- >> >> references: >> >> - type: book >> >> id: doe >> >> author: >> >> - family: Doe >> >> given: Jane >> >> issued: >> >> =C2=A0=C2=A0=C2=A0 date-parts: >> >> =C2=A0=C2=A0=C2=A0 - - 2022 >> >> =C2=A0 title: 'A book: with a subtitle and a reference to Gen 1:1, but= =20 >> that is not a problem' >> >> =C2=A0 publisher: 'Whatever press' >> >> =C2=A0 lang: de-De >> >> ... >> >> test [@doe] >> >> ``` >> >> The filter itself does not cover capitalization. For some reason,=20 >> pandoc or citeproc applies title-case transformation here. I don=E2=80= =99t=20 >> think it should though. >> >> *Von:*pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 >> *Im Auftrag von *John Carter Wood >> *Gesendet:* Freitag, 1. Juli 2022 18:24 >> *An:* pandoc-discuss >> *Betreff:* Re: Changing colons to full-stops in titles >> >> That's very interesting, thanks! I'll try it out when I get a chance=20 >> in the coming days. >> >> I have thought about this issue of false positives while thinking=20 >> about the option of some kind of filter. But...I think they would be=20 >> very rare. I have a hard time thinking of a title with a colon in it=20 >> that shouldn't be -- in this case -- be turned into a dot. At least,=20 >> I don't have anything in my 1,200 references where I can see that=20 >> that wouldn't apply. >> >> Although, of course, I'm sure there are some out there... >> >> Just a question: would this also ensure that the first word after the=20 >> dot is capitalised? Or does that open a new series of problems? :-) >> >> >> denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 1. Juli 2022 um 18:17:02 UTC+2: >> >> Here=E2=80=99s a very simple and absolutely unreliable version of a >> filter. This will replace every colon in a title with a period. >> >> ```lua >> >> local stringify =3D pandoc.utils.stringify >> >> function Meta(m) >> >> =C2=A0 if m.references ~=3D nil then >> >> =C2=A0=C2=A0=C2=A0 for _, el in ipairs (m.references) do >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print(stringify(el.title)) >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(s= tringify(el.title), ':', >> '.')) >> >> print(el.title) >> >> end >> >> end >> >> return m >> >> end >> >> ``` >> >> Question is how this can be made robust enough to avoid false >> positives. >> >> *Von:*pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> *Im Auftrag von *John Carter Wood >> *Gesendet:* Freitag, 1. Juli 2022 17:52 >> *An:* pandoc-discuss >> *Betreff:* Re: Changing colons to full-stops in titles >> >> Thanks for the suggestions, a couple of which are kind of >> stretching my knowledge of these things, but I see where they're >> going. >> >> As to JGM's question: I am using a CSL json bibliography, so my >> titles are in a single field. ("title":"Science and religion: new >> perspectives on the dialogue") >> >> The issue is that *most* of the journals / publishers I publish >> in use, as here, the colon. *Some* (mainly German) styles want >> the period. If I were solely interested in either one, I could >> choose and just enter the relevant punctuation in the title >> field. However, I want to continue saving my bibliographic >> entries with a colon (because that's the most standard one for >> me), but have the option of automatically converting them to a >> period for those cases where I need to. If that makes sense. >> >> Thus: going through denis's options: >> >> 1. I have switched to json bibliographies from bibtex/biblatex as >> they seemed to offer more flexibility (I was running into issue >> with the strange archival references I have to make in my field, >> and JSON seemed to work better in that regard). So this seems to >> not apply. >> >> 2. Seems to not apply, as I have a single title field >> >> 3. Sounds really interesting, and I use BBT, though it also >> sounds like I would here have to create a separate bibliography >> file from my Zotero database for those publishers/styles that >> require the dot. This is not *too* onerous, as it would at least >> be automated. >> >> 4. Having a filter that I could simply apply (as part of a pandoc >> command, say) or not apply as relevant seems like the most >> flexible / efficient solution. I don't know lua, but if this is >> one possible way, then I could use it as a (hopefully fairly >> simple?) way into learning it. >> >> Does this help to clarify my situation? >> >> denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 1. Juli 2022 um 17:34:55 UTC+2= : >> >> Yes, that=E2=80=99s a known issue... >> >> There are a couple of possible solutions=C2=A0: >> >> 1. use biblatex databases and patch pandoc so it will concat >> title and subtitle fields using periods. (line 667 >> https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Citepr= oc/BibTeX.hs >> ) >> >> 2. I think pandoc=E2=80=99s citeproc will just treat every unkno= wn >> variable as a string variable (see >> https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22d= c7a18b614f43e/src/Citeproc/Types.hs#L1054 >> >> and >> https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22d= c7a18b614f43e/src/Citeproc/Types.hs#L901), >> so you should be able to use =C2=ABsubtitle=C2=BB in styles. (Th= is will >> give you warnings when using the style with Zotero and it >> won=E2=80=99t work reliably across implementations, but anyway .= ..) >> >> 3. if you=E2=80=99re using Zotero, you can leverage Zotero BBT= =E2=80=99s >> postscript feature to manipulate the JSON after exporting. >> >> E.g., this one=C2=A0: >> >> if (Translator.BetterCSL && item.title) { >> >> =C2=A0 reference.title =3D reference.title.replace(/ : /g, '. ') >> >> } >> >> Not bullet-proof, but simple. You will want to choose a >> better separator, maybe a double-bar or so. >> >> 4. Doing the with lua should also be possible... >> >> The question is: do you have the subtitle in a distinct field >> or is it just in the title field? >> >> *Von:*pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> *Im Auftrag von *John Carter Wood >> *Gesendet:* Freitag, 1. Juli 2022 16:39 >> *An:* pandoc-discuss >> *Betreff:* Changing colons to full-stops in titles >> >> I have one final (for now...) issue in setting up a CSL file >> (which I use with pandoc/citeproc and references in a json >> file). >> >> I'm not sure whether this is a CSL issue or whether it's an >> issue that can be solved via using a filter (or some other >> solution) in pandoc, but I thought there might be some people >> here who might have faced a similar issue. >> >> The house style for here (German-based publisher) wants a >> *full-stop/period *between main title and subtitle in >> citations / bibliographies; US/UK standard is a *colon* >> between main title and subtitle. And reference managers like >> Zotero -- IIUC -- save titles as single fields (at least they >> are in my version of Zotero). So it doesn't seem like it is >> possible to control what delimiter is used between them via CSL. >> >> >> I have found various discussions of relevant title/subtitle >> division issues -- some going back quite a few years -- in >> forums on Zotero: >> >> https://forums.zotero.org/discussion/8077/separate-fields-for-ti= tle-and-subtitle/ >> >> ...and CSL: >> >> https://discourse.citationstyles.org/t/handling-main-sub-title-s= plits-citeproc-js/1563/11 >> >> However, these were in part discussions among developers >> about /possible/ changes, and I'm not sure of the current >> status of this issue or whether there is a way to handle it. >> >> Would it be possible to automate turning colons in titles >> into full-stops via using a filter? If so is there such a >> filter already around? Can this be done via CSL? >> >> Or is this, as of now, impossible? >> >> (Or is there a real simple solution that I have, as usual, >> overlooked...) >> >> --=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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/78df697a-50f5-4= 6d0-b0b8-29a2cbc9509an%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 email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/a2d540a6-a435-4285-= aed5-018007d155cfn%40googlegroups.com >> . >> >> --=20 >> 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,=20 >> send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/f0f222ef-e60e-4397-83ac= -bec1a6ac2d08n%40googlegroups.com=20 >> . >> >> --=20 >> 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,=20 >> send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/2a8d940b3675472fb4b50ea= d406f6fc7%40unibe.ch=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/b77d6ecf-8648-d6bc-3818-5a44cadd8a48%40gmail.com. --------------Ujs0ydNzGAWfcwIIhOI9bcoI Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Woops, I mean this one (upper, not lower), and I needed a colon right before it, not a period):

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(s= tringify(el.title), ': (%l)', '. %1':upper()))


Hth,
Sukil

El 01/07/2022 a las 18:54, Sukil Etxenike arizaleta escribi=C3=B3:

Denis, you beat me to it (I forgot about stringify and I ws not making progress).

El 01/07/2022 a las 18:23, John Carter Wood escribi=C3=B3:

would this also ensure that the first word after the dot is capitalised?=C2=A0

No, it won't ensure that the first character after the full stop is a capital. For that, you can change this line:

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub= (stringify(el.title), ':', '.'))

With this one (haven't tested it but I think it should work):

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub= (stringify(el.title), ': (%l)', '. %1'.lower()))

Hth,

Sukil


El 01/07/2022 a las 18:40, den= is.maier-NSENcxR/0n0@public.gmane.org escribi=C3=B3:

A slightly more reliable version:

=C2=A0

```

local stringify =3D pandoc.utils.stringify

function Meta(m)

=C2=A0 if m.references ~=3D nil then

=C2=A0=C2=A0=C2=A0 for _, el in ipairs (m.refe= rences) do

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -- print(string= ify(el.title))

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.title =3D pandoc.Str(string.gsub(stringify(el.title), ': ', '. <= span style=3D"mso-fareast-language:EN-US">'))

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -- print(el.title)

=C2=A0=C2=A0=C2=A0 end

=C2=A0 end

=C2=A0 return m

end```<= /o:p>

=C2=A0

(This won=E2=80=99t replace colons in biblical references, e.g. Gen 1:1)

=C2=A0

You can test with this file=C2=A0:<= /span>

=C2=A0

```markdown

---

references:

- type: book

=C2=A0 id: doe

=C2=A0 author:

=C2=A0 - family: Doe

=C2=A0=C2=A0=C2=A0 given: Jane

=C2=A0 issued:

=C2=A0=C2=A0=C2=A0 date-parts:

=C2=A0=C2=A0=C2=A0 - - 2022<= /p>

=C2=A0 title: 'A book: with a subtitle and a reference to Gen 1:1, but that is not a problem'

=C2=A0 publisher: 'Whatever press'<= /span>

=C2=A0 lang: de-De

...

=C2=A0

test [@doe]

```

=C2=A0

The filter itself does not cover capitalization. For some reason, pandoc or citeproc applies title-case transformation here. I don=E2=80=99t think it should though.<= o:p>

=C2=A0

Von:= pandoc-discuss@googlegroups.= com <pandoc-discuss@googlegro= ups.com> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 18:24
An: pandoc-discuss <pandoc-discuss@googlegro= ups.com>
Betreff: Re: Changing colons to full-stops in titles

=C2=A0

That's very interesting, thanks! I'll try it out when I get a chance in the coming days.

I have thought about this issue of false positives while thinking about the option of some kind of filter. But...I think they would be very rare. I have a hard time thinking of a title with a colon in it that shouldn't be -- in this case -- be turned into a dot. At least, I don't have anything in my 1,200 references where I can see that that wouldn't apply.

Although, of course, I'm sure there are some out there...

Just a question: would this also ensure that the first word after the dot is capitalised? Or does that open a new series of problems? :-)


denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 1. Juli 2022 um 18:17:02 UTC+2:<= /o:p>

Here=E2=80=99s a very simple and abs= olutely unreliable version of a filter. This will replace every colon in a title with a period.

=C2=A0

```lua

local stringify =3D pandoc.utils.stringify

function Meta(m)

=C2=A0 if m.references ~=3D nil then=

=C2=A0=C2=A0=C2=A0 for _, el in ipai= rs (m.references) do

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print= (stringify(el.title))

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.ti= tle =3D pandoc.Str(string.gsub(stringify(el.title), ':', '.'))

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print(el.title)

=C2=A0=C2=A0=C2=A0 end

=C2=A0 end

=C2=A0 return m

end

```

=C2=A0

Question is how this can be made robust enough to avoid false positives.=

=C2=A0

=C2=A0

Von: pandoc-...@googl= egroups.com <pandoc-...@googl= egroups.com> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 17:52
An: pandoc-discuss <pandoc-...@googl= egroups.com>
Betreff: Re: Changing colons to full-stops in titles

=C2=A0

Thanks for the suggestions, a couple of which are kind of stretching my knowledge of these things, but I see where they're going.

As to JGM's question: I am using a CSL json bibliography, so my titles are in a single field. ("title":"Science and religion: new perspectives on the dialogue")

The issue is that *most* of the journals / publishers I publish in use, as here, the colon. *Some* (mainly German) styles want the period. If I were solely interested in either one, I could choose and just enter the relevant punctuation in the title field. However, I want to continue saving my bibliographic entries with a colon (because that's the most standard one for me), but have the option of automatically converting them to a period for those cases where I need to. If that makes sense.

Thus: going through denis's options:

1. I have switched to json bibliographies from bibtex/biblatex as they seemed to offer more flexibility (I was running into issue with the strange archival references I have to make in my field, and JSON seemed to work better in that regard). So this seems to not apply.

2. Seems to not apply, as I have a single title field

3. Sounds really interesting, and I use BBT, though it also sounds like I would here have to create a separate bibliography file from my Zotero database for those publishers/styles that require the dot. This is not *too* onerous, as it would at least be automated. =

4. Having a filter that I could simply apply (as part of a pandoc command, say) or not apply as relevant seems like the most flexible / efficient solution. I don't know lua, but if this is one possible way, then I could use it as a (hopefully fairly simple?) way into learning it.

=C2=A0

Does this help to clarify my situation?

=C2=A0

Yes, that=E2=80=99s a know= n issue...

There are a couple of possible solutions=C2=A0:

=C2=A0

1. use biblatex databases and patch pandoc so it will concat title and subtitle fields using periods. (line 667 https://github.com/jgm= /pandoc/blob/master/src/Text/Pandoc/Citeproc/BibTeX.hs)

=C2=A0

2. I think pandoc=E2=80=99s citeproc will just treat every unknown variable as a string variable (see https://github.com/jgm= /citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b614f43e/src/Citeproc/Types.= hs#L1054 and https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b614f4= 3e/src/Citeproc/Types.hs#L901), so you should be able to use =C2=ABsubtitle= =C2=BB in styles. (This will give you warnings when using the style with Zotero and it won=E2=80=99t work reliably across implementations, but anyway ...)=

=C2=A0

3. if you=E2=80=99re using Zotero, you can leverage Zotero BBT=E2=80= =99s postscript feature to manipulate the JSON after exporting.

E.g., this one=C2=A0:

if (Translator.BetterCSL && item.title) {

=C2=A0 reference.title =3D reference.title.replace(/ : /g, '. ')

}

Not bullet-proof, but simple. You will want to choose a better separator, maybe a double-bar or so.

=C2=A0

4. Doing the with lua should also be possible...

=C2=A0

The question is: do you have the subtitle in a distinct field or is it just in the title field?

=C2=A0

Von: pandoc= -...@googlegroups.com <pandoc= -...@googlegroups.com> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 16:39
An: pandoc-discuss <pandoc= -...@googlegroups.com>
Betreff: Changing colons to full-stops in titles
=

=C2=A0

I have one final (for now...) issue in setting up a CSL file (which I use with pandoc/citeproc and references in a json file).

=C2=A0

I'm not sure whether this is a CSL issue or whether it's an issue that can be solved via using a filter (or some other solution) in pandoc, but I thought there might be some people here who might have faced a similar issue.

=C2=A0

The house style for here (German-based publisher) wants a full-stop/period between main title and subtitle in citations / bibliographies; US/UK standard is a colon between main title and subtitle. And reference managers like Zotero -- IIUC -- save titles as single fields (at least they are in my version of Zotero). So it doesn't seem like it is possible to control what delimiter is used between them via CSL.


I have found various discussions of relevant title/subtitle division issues -- some going back quite a few years -- in forums on Zotero:

https= ://forums.zotero.org/discussion/8077/separate-fields-for-title-and-subtitle= /

...and CSL:

https= ://discourse.citationstyles.org/t/handling-main-sub-title-splits-citeproc-j= s/1563/11

=C2=A0

However, these were in part discussions among developers about possible changes, and I'm not sure of the current status of this issue or whether there is a way to handle it.

Would it be possible to automate turning colons in titles into full-stops via using a filter? If so is there such a filter already around? Can this be done via CSL?

=C2=A0

Or is this, as of now, impossible?

(Or is there a real simple solution that I have, as usual, overlooked...)

--

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-discu= s...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/78df697a-50f5-46d0-b0b8-29= a2cbc9509an%40googlegroups.com.

--
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-discus...@googl= egroups.com.

--
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 pa= ndoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f0f222ef-e60e-4397-83ac-be= c1a6ac2d08n%40googlegroups.com.

--
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-d= iscuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc= -discuss/2a8d940b3675472fb4b50ead406f6fc7%40unibe.ch.

--
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/p= andoc-discuss/b77d6ecf-8648-d6bc-3818-5a44cadd8a48%40gmail.com.
--------------Ujs0ydNzGAWfcwIIhOI9bcoI--