From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30903 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 18:54:54 +0200 Message-ID: <6621a84d-37f3-6741-bb0a-d4bfd6dac4bf@gmail.com> References: <78df697a-50f5-46d0-b0b8-29a2cbc9509an@googlegroups.com> <2a8d940b3675472fb4b50ead406f6fc7@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------ayqZNdH4CFozPiXe5z8SlkCj" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26167"; 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDIN5YV3SMDBBYON7SKQMGQERC4ST7Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jul 01 18:55:03 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f61.google.com ([209.85.167.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7Jv4-0006dk-SQ for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 01 Jul 2022 18:55:02 +0200 Original-Received: by mail-lf1-f61.google.com with SMTP id z13-20020a056512308d00b004811694f893sf1335123lfd.6 for ; Fri, 01 Jul 2022 09:55:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656694502; cv=pass; d=google.com; s=arc-20160816; b=0mDuuGmJLthEl5YkgaUzLW2OGNkbLSrIfwLihMa0Cj/piJA6c0G32biW2eg/IL3oZP n9BJDoIMq/oAvkhSiMJOlnzC+6hmmvy2n3VigXEwTZxFQOg+LpcOdP9/7tH8o2twV2gU pThM+vG3wt/8Zt07UhtB4Lp/sW7SyNo5QnFSa5U4eM7xKX7HrLzwezU87TfLit6TwLIj mK90T5KUHQTE3xNKQzpu5SgV9/Ph/QlQ8cVMphqmyHms8JtlREKFQxMOxqF9auRvShgH 5bu3r5DbmXjZhc2nFNGEb+B5bCXeSO9Jy2jSKF0ZdhpA0YJP4yQebqo2+oa+0J29ZaX+ ht7Q== 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 :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:dkim-signature:dkim-signature; bh=+1RzqXV1i/PD4D2XHarYBG8/8lDKGgXbvKsaT0JlxW8=; b=DYJg3q/LUkaPdrF4YggQ5c/WbZx79b0qVnW8C3G4daIDA1G2zUfU15nPUJAcVFHYnj 0kVaxkdtriTdvXF209qg8yAo4zGcxulm9oxfd/KSeJ3e06Y52U9V2tNt+XhYf367Tgt+ St9ElAFxg3j3uCqeiolByKAExtPqMNal81aFB2Qs9ftbd69F2Zn0lJ6Ahjas4qae+puT KQ7gbi1lai+ym1TWx0MiKlTG48ZEKhynTFE+GCqvwJFO/XbyBzmDxBcA2EsnNAmwYfXg dBiJbDZMESoy8Qv11tRMwa0VIQjNR64hMNk8O1RktrWtpKbH0qfZsmMgIAJa5qr+HCUV bJSg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F7l5CCYs; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::431 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:to:references: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=+1RzqXV1i/PD4D2XHarYBG8/8lDKGgXbvKsaT0JlxW8=; b=s+belfu/T5jSuXBs3wCmyBvd4Q3jFBFeOUVqGR8+Wk+yyFamG/QyHnFBJr7PP6pv3U N0fR/hVyFZ8LtBtHrk2ts1btat66LszOwyL3+3XRzuAouMUBYhCThmsL61KnOPEaXpEX tcfJ2VJImsuow92Vm8UwVgBAmcPr4/+ZHrbbVdcNjMZHIkXfxlvzgXTjHJqWFTTnNVz1 7tVKWWRW8/d6mAwOF99kcBMqwElgBmWF9VvYamosY0w/yWcA6AgtGUSYNrjrxGo2o0Xn 73y9eJxZRewZW2T21N307mq5XthJka1aH733cA7pTxhhv8cvj+Khd07ExiOz8HFrfWZp UEtQ== 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:to :references: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=+1RzqXV1i/PD4D2XHarYBG8/8lDKGgXbvKsaT0JlxW8=; b=TGtWSOA3/EuHO1yc+z4aJX5gw6po46Wkke1w82Liw2E6Pd1WvWW9phrO4Iv5QH23X+ zSxbxeKNHDmNSAXGqSQZr1lw6xxINSte/zOXfR2MKvVoaw5ZiYSrmzCDYyKx2Id5SOys ptz1/LtU+J7/W2J6mR3UVFO2LsApvugg52H576exl7atTkVoaNRk9MSL5H4gve17EzPp aDsphFS9ob/+B9nF8CsCHCEG6MCfeUeSAxeq6QsSk0kQ8WjKvc5F4vdLM//QlNJSkNpt QAP56sZPXj/wDEAVLFkMxsQJUd1SLmkTXs732ITQcUvvJVnjZSEoDeS004OyoCqPJPSQ pL5A== 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:to:references: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=+1RzqXV1i/PD4D2XHarYBG8/8lDKGgXbvKsaT0JlxW8=; b=rcug+rWEjb73+Iwh0Hti+b9O9WfVhHy6CTh++jNE8jA2vtmS6k3lzUdJixaLzQhUGc aLzNQytdjKYxKuaxLNMHhp2dvbegyUYXFCohOs4sA7hcGDoSIog+quaRyUahp1Yb1W+7 qhU8rG8SNEFkVZ+F4scfIf9r45ObZhxjvHfsh4cQgPCyWLz9ibkGvaQuCxsSs3sHeIRM 2OSuSfKqgLYRF8MP1X2Ry2WiYB0w/uxY3NZWD8bWoniw5BCrCtZ1Ld17DDw8qw/5VTE4 zS1iPabGzN2DFr6gZyeN00+y4aDhtjIGb1o8FcCbfTzWZbsqKQyfo66NBnp24p5dVK2D Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora/APzqtES1JBVINQn7noftJ4K+lJaVkTc+aZVBJEey5Y7AQC6KU 8EToDa+oxgwn0h090bfZS/0= X-Google-Smtp-Source: AGRyM1tbbwLFVq03jq35abj3yG5Gz8abiDlozVjmYJyoIGOnKOO1Zq65LFJiswu9s4QdCCRKWZbI5A== X-Received: by 2002:a2e:a309:0:b0:25a:70f8:f0a9 with SMTP id l9-20020a2ea309000000b0025a70f8f0a9mr8852282lje.444.1656694502219; Fri, 01 Jul 2022 09:55:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:1693:b0:448:3742:2320 with SMTP id bu19-20020a056512169300b0044837422320ls368322lfb.1.gmail; Fri, 01 Jul 2022 09:54:56 -0700 (PDT) X-Received: by 2002:a05:6512:1587:b0:481:1946:8e1c with SMTP id bp7-20020a056512158700b0048119468e1cmr10310207lfb.163.1656694496754; Fri, 01 Jul 2022 09:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656694496; cv=none; d=google.com; s=arc-20160816; b=T5fEaGPHuWV9ms+M2t6D09Q2VjZWPuoGL8+FZ4RqGbu90xyEDSyFmuY2j5qzX8MNpw zROQannRe8DfeC5EWKhIcsiiwSqWWJQ351B1z4sSMi9kSNIJ7WnFGquOf5O9IP8xYTGB SVB16WXZXfhpCXMkjUw2CrP17x95XZ0itOrA55e0i5xcvPRn8U08xsSXuTU2yCVfgqwY fjbFYc2i+kP77B9j69mHcVTidnEIY3lZ0/QxXjByT3T4rkqVoLaCMud2E/t7PStFj4dF eE/b/Mpju/L4tWj/ICcNowte1iU5iY+hQP1Y3OHInVCuMHvmND6Cy5xFMlNmzmRV/mtY XS7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=QPD2Uz1Smarhck9xE+TnFvLTUAIpDepGdPuBJb4JpQw=; b=EOuJsUJqX4aWedqrx1zDT+shjynW230gRGt2c1Alf4MZ2Z+99cLla+J+L0RtwPXSmz baJfl/tZ2khDDmBvW6WYYkG2da5nSTEsgGS7poVnesEAfVOXtoEh9uJE7/K3BIvqLhd2 gTY3spS+uMSXhsPOwRTCYYmnWmli6iypkQd+ee7335OYDM2/bt9Q4FysxCVwySs4kZN7 EynL0pG3xRebUDqW8HpHQnl9t+T0Kzjd/0jwu2VohWOPKQWWQVj3uvFYUVLViltfQuO8 44v5xgDulA6uSPGOq7ptmvsKUpKfkbiqCLfqnM5bAlHaroBi+prHBK+2+5nkHPV8jMFc 0e2w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=F7l5CCYs; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::431 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-wr1-x431.google.com (mail-wr1-x431.google.com. [2a00:1450:4864:20::431]) by gmr-mx.google.com with ESMTPS id h24-20020a2ea498000000b0025a70508721si931799lji.7.2022.07.01.09.54.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 09:54:56 -0700 (PDT) Received-SPF: pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::431 as permitted sender) client-ip=2a00:1450:4864:20::431; Original-Received: by mail-wr1-x431.google.com with SMTP id s1so4048449wra.9 for ; Fri, 01 Jul 2022 09:54:56 -0700 (PDT) X-Received: by 2002:a5d:4382:0:b0:21b:8c03:639f with SMTP id i2-20020a5d4382000000b0021b8c03639fmr14808493wrq.406.1656694495944; Fri, 01 Jul 2022 09:54:55 -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 m2-20020a05600c3b0200b0039c63f4bce0sm7369591wms.12.2022.07.01.09.54.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 09:54:55 -0700 (PDT) Content-Language: es-ES In-Reply-To: <2a8d940b3675472fb4b50ead406f6fc7-NSENcxR/0n0@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=F7l5CCYs; spf=pass (google.com: domain of sukiletxe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::431 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:30903 Archived-At: This is a multi-part message in MIME format. --------------ayqZNdH4CFozPiXe5z8SlkCj Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable 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(stringi= fy(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(stringi= fy(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(string= ify(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 th= at=20 > 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=99= t=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, I=20 > don't have anything in my 1,200 references where I can see that that=20 > 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(st= ringify(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/Citepro= c/BibTeX.hs > ) > > 2. I think pandoc=E2=80=99s citeproc will just treat every unknow= n > variable as a string variable (see > https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc= 7a18b614f43e/src/Citeproc/Types.hs#L1054 > > and > https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc= 7a18b614f43e/src/Citeproc/Types.hs#L901), > so you should be able to use =C2=ABsubtitle=C2=BB in styles. (Thi= s 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-tit= le-and-subtitle/ > > ...and CSL: > > https://discourse.citationstyles.org/t/handling-main-sub-title-sp= lits-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-46= d0-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-a= ed5-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, send=20 > 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, send=20 > 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/2a8d940b3675472fb4b50ead= 406f6fc7%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/6621a84d-37f3-6741-bb0a-d4bfd6dac4bf%40gmail.com. --------------ayqZNdH4CFozPiXe5z8SlkCj Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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(s= tringify(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(s= tringify(el.title), ': (%l)', '. %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:

=C2=A0

`= ``

local stringify =3D pandoc.utils.stringify<= /o:p>

function Meta(m)

=C2=A0 if m.references ~=3D nil then<= /span>

=C2=A0=C2=A0=C2=A0 for _, el in ipairs (m.refere= nces) do

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

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

= =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

e= nd```

=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:

=C2=A0

```markdown

-= --

r= eferences:

- 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

=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'

=C2=A0 lang: de-De

...

=C2=A0

test [@doe]

```

=C2=A0

T= he 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.

=C2=A0

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org= <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 18:24
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
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:

Here=E2=80=99s a very simple and absol= utely 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 ipairs (m.references) do

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

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 el.titl= e =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-...@= googlegroups.com <pandoc-= ...@googlegroups.com> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 17:52 An: pandoc-discuss <pandoc-...@goog= legroups.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

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:=

=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/p= andoc/blob/master/src/Text/Pandoc/Citeproc/BibTeX.hs)

=C2=A0

2. I think pandoc=E2=80=99s citeproc will just t= reat every unknown variable as a string variable (see https://github.com/jgm/c= iteproc/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 Z= otero, you can leverage Zotero BBT=E2=80=99s posts= cript feature to manipulate the JSON after exporting.

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

if (Translator.BetterCSL && item.title) {<= /p>

=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: p= andoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 16:39
An: pandoc-discuss <pando= c-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
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/<= /a>

...and CSL:

https:/= /discourse.citationstyles.org/t/handling-main-sub-title-splits-citeproc-js/= 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 p= andoc-discus...-/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-disc= us...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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 pand= oc-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-dis= cuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-d= iscuss/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/6621a84d-37f3-6741-bb0a-d4bfd6dac4bf%40gmail.com.
--------------ayqZNdH4CFozPiXe5z8SlkCj--