From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30901 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.text.pandoc Subject: AW: Changing colons to full-stops in titles Date: Fri, 1 Jul 2022 16:40:56 +0000 Message-ID: <2a8d940b3675472fb4b50ead406f6fc7@unibe.ch> References: <78df697a-50f5-46d0-b0b8-29a2cbc9509an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_2a8d940b3675472fb4b50ead406f6fc7unibech_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37696"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: pandoc-discuss+bncBCZ27W53TUFBBG6H7SKQMGQEZM6GOQI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jul 01 18:41:03 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f56.google.com ([209.85.128.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7JhW-0009dH-Du for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 01 Jul 2022 18:41:02 +0200 Original-Received: by mail-wm1-f56.google.com with SMTP id 130-20020a1c0288000000b003a18127d11asf210786wmc.6 for ; Fri, 01 Jul 2022 09:41:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656693662; cv=pass; d=google.com; s=arc-20160816; b=qs5PGcdJKdmGjpHI6RS7IOfEjZnK74uoaWWxgn5eFbN+1BtG3vQ7oV/pXE8dnhXb/U C/X2v4sdpfpxZlmpeQVzykinyb111IkmiKDBtctVOcUNz4+mAU/2xfTrDiaSCFxLsvEH cs3Jn6hzQt815aIjEKWF5tfwFBBdOuMaLmn+5EeUpU/XqrhfMMWU24m12oVusdBercRk J2d5toMSc6D03RPehvtx11BdsY2XzF5jK9ly8aNBQt/N16eYLnAAzSsYXaLoOCka84Ve X0o6Vtio3bJwY3XPVmXB3IornE8knKi51sr3XkDDpdtknRMR9fQxNKcepf+ma3DSNl9P upqA== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:sender :dkim-signature; bh=Vy7S0CBlQH2t3rDTx4GMHzqtR/WL1ecDm75oXNBRhxs=; b=sP+1EelvNK2Jf8lK/QI/Q4CmMfRFSYYrMc12WB+55oFOWM0CN2zovKOrG01sGJ+w+s oaEmK2rMi0lYDO3MXTyKQIqVBRcugwi7YAuznOGDLz7Gt4K8ikOdXNGT396C39FwwHHo kueJc+2BI4RPpLP1JErpVfoWchgp/uLTcIhwGikljr4zH1dWVcVfi7oAbJ3ZG3BGFvtJ Kg0USFO0zvUoOXvtyRvoipTOuTQm46K6GzgDEKL8W+yC6b3iIuVthsWQ2LV47XCJjh4R U1sBPROEqPNuhDmYOUaE9Q6VUO8Tdc+kXDecKvRsVtT/hZKvII3IFWdzc9dBFqQ5EMfM HxCg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :mime-version: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=Vy7S0CBlQH2t3rDTx4GMHzqtR/WL1ecDm75oXNBRhxs=; b=RlsyjoFWhR5xdihHR56sh+58aGLk1nxcN3FR8G9ynIFOf7P4vMZyjfzugvt9VXXdhE loZMkDoZXcre/muy8PtXTdJLXzQRaxQZvGlm1SVSBzD+lEqvHRc9yLHj1cknWZD4Qd/v 5Olp9IJD0C4w+ega/Sw+o/iCplwfON+qCFy1EDUbvijaM2zrjp+S4yU/V86P6QkYpzch KopGMB8EDvoP7b8Bya+QhQ/NljtCQU5Rv+wGZB7/CfJBQWcSg69jORX77c1S5r7caNas Ha0gVR1FS0LY1xKTgGDuTJspADtqPWsWJ2lWeMM/A3eVWUlFG3ryHDFCvlpaPSL8FgE6 jwGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language :content-language:mime-version: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=Vy7S0CBlQH2t3rDTx4GMHzqtR/WL1ecDm75oXNBRhxs=; b=xNtFSKVtn8MEA7sLJy7MmSi/GdkA1UPGtuznPLGZHUxKnwaVx9nPY6pnl3ZQOF9Ucp mBAPg6VWg0YfeurYET79SWBeGqgjpugGD7GoFczwgShUTP2KgUoSAd4/Z0pDWJZIljNy YAG+1wqlE2GZGvZimq/ScpT9Vp1pOjl3agDSylLZhxO52Dw85mR6aaCEUOJDg1lPjiCJ UPZShM5i4/fzXMAxqtGEhwhmmtFxPSXXayvE6OoC/spUs2L/EC6Nl4puJ6YxdRK7JxjO hJjrVxdO/LUw+HG4XEg5wsjjsZQoZlu Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora/b6Pt/nLZvIyJJh+NmXDWTDPKrthcwO9+mfooHn7lykcvRDTGU KRBm+FBI9dwDmVe1p2Sl6vM= X-Google-Smtp-Source: AGRyM1tYLyL+eFHo4pDYUvcmnydef2F6znCpQfnaHVBrUW5XpXpRjMTxwhct+iaSqWjl+JDEZAYnzg== X-Received: by 2002:a5d:4f07:0:b0:21b:8ea0:ef0 with SMTP id c7-20020a5d4f07000000b0021b8ea00ef0mr14832484wru.329.1656693662045; Fri, 01 Jul 2022 09:41:02 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:4ec7:b0:39c:871d:313f with SMTP id g7-20020a05600c4ec700b0039c871d313fls3662593wmq.2.canary-gmail; Fri, 01 Jul 2022 09:40:58 -0700 (PDT) X-Received: by 2002:a05:600c:3d18:b0:3a1:8f1e:cc05 with SMTP id bh24-20020a05600c3d1800b003a18f1ecc05mr3285188wmb.78.1656693658579; Fri, 01 Jul 2022 09:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656693658; cv=none; d=google.com; s=arc-20160816; b=jInCn9xPIO/EVLk7uXMzUf7Xh2Fda2CFqWYf25gBkdTq0FfPGbyskjdWe2mfgc3pAf sZzt4gRy17cG57ubGk4tvP7CSMNXtLoeAXSK5Xtlv1nhi3Z8HB6XXC5vNEZUVl6VsZ8P F/jx6TN8FLMr1DdS7pKUw0sGUaHmuCO3Q6AHn6K5qxl4KViJbUg0zNS1UIajxBCw1Yfo yIzT9yeE7/0yJODLt/RRZsyjZi1mTBHzC2cuIcfgb0HmD6pV6WhLgmHc7gqQs/7rDVEa PvlgNeTjnyrJh65tkidKYouOKoWLoKkNHHv1zJH8pENhZEgSW+DBPsZdFzWKisv0Kyo/ Lk4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:to :from; bh=3m5FS8WPnUmAzwFi7ocVQCTtJvFAZ2krMQaPmgY3eyI=; b=y2wKxnbZ32DJ61PFFZ8N8dTQywQ8NuD7/uI5KeXv8I0FvF79i0g0cKjP8A/8rYqofp aDdOzyhGNaD41QR0jIY99mQXPt9Rh8FOojuWmq7JonmXROU7M9gd9k1JyM7VJUjfbA62 EfBAFhpCJn18mLCnUUGrZebmvILmnhPkDLJal8NhpXX+0wXq8y+32i+OF/y1xHnRLdsp VewIyoabNNRyGqHN0JhCBtlS3n09O2Rz+7N+gYxpUs87SKUvepIYH4/GdOsdnaoj9+Q3 LAa+YjFMz0qJ+Fv4bRNHRr+xInXGlgqq/pnF/N0gZo4G2B5m3MSxsLHGs3/z+48aTDWK 2neg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch Original-Received: from mailhub-lb1.unibe.ch (mailhub-lb1.unibe.ch. [130.92.0.82]) by gmr-mx.google.com with ESMTPS id az26-20020a05600c601a00b003a033946319si354537wmb.0.2022.07.01.09.40.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 09:40:58 -0700 (PDT) Received-SPF: pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) client-ip=130.92.0.82; X-Virus-Scanned: By University of Bern - MGW Original-Received: from mail.campus.unibe.ch (aai-edge-02.campus.unibe.ch [130.92.13.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailhub-lb1.unibe.ch (Postfix) with ESMTPS id E0072500069 for ; Fri, 1 Jul 2022 18:40:56 +0200 (CEST) Original-Received: from aai-mail-03.campus.unibe.ch (130.92.13.41) by AAI-EDGE-02.campus.unibe.ch (130.92.13.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.1.2507.9; Fri, 1 Jul 2022 18:40:51 +0200 Original-Received: from aai-mail-03.campus.unibe.ch (130.92.13.41) by aai-mail-03.campus.unibe.ch (130.92.13.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.1.2507.9; Fri, 1 Jul 2022 18:40:56 +0200 Original-Received: from aai-mail-03.campus.unibe.ch ([172.18.73.17]) by aai-mail-03.campus.unibe.ch ([172.18.73.17]) with mapi id 15.01.2507.009; Fri, 1 Jul 2022 18:40:56 +0200 Thread-Topic: Changing colons to full-stops in titles Thread-Index: AQHYjVhIsMIE8s9IhE2lBYWP9lHO8a1pnTTw///rpoCAACWJYP//4zWAgAAjbfA= In-Reply-To: Accept-Language: de-CH, en-US Content-Language: de-DE x-originating-ip: [172.18.72.2] X-Original-Sender: denis.maier-NSENcxR/0n0@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch 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:30901 Archived-At: --_000_2a8d940b3675472fb4b50ead406f6fc7unibech_ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable A slightly more reliable version: ``` local stringify =3D pandoc.utils.stringify function Meta(m) if m.references ~=3D nil then for _, el in ipairs (m.references) do -- print(stringify(el.title)) el.title =3D pandoc.Str(string.gsub(stringify(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 : ```markdown --- references: - type: book id: doe author: - family: Doe given: Jane issued: date-parts: - - 2022 title: 'A book: with a subtitle and a reference to Gen 1:1, but that is n= ot a problem' publisher: 'Whatever press' lang: de-De ... test [@doe] ``` 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. Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im A= uftrag 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 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 ha= ve 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 i= s capitalised? Or does that open a new series of problems? :-) denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 1. Juli 202= 2 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) if m.references ~=3D nil then for _, el in ipairs (m.references) do print(stringify(el.title)) el.title =3D pandoc.Str(string.gsub(stringify(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 v= on 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 kno= wledge 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 s= olely interested in either one, I could choose and just enter the relevant = punctuation in the title field. However, I want to continue saving my bibli= ographic 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 thos= e 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 seem= ed to offer more flexibility (I was running into issue with the strange arc= hival 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 w= ould here have to create a separate bibliography file from my Zotero databa= se for those publishers/styles that require the dot. This is not *too* oner= ous, 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 solu= tion. I don't know lua, but if this is one possible way, then I could use i= t 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 : 1. use biblatex databases and patch pandoc so it will concat title and subt= itle fields using periods. (line 667 https://github.com/jgm/pandoc/blob/mas= ter/src/Text/Pandoc/Citeproc/BibTeX.hs) 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/3f94424db46= 9c804cf2dac2d22dc7a18b614f43e/src/Citeproc/Types.hs#L1054 and https://githu= b.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b614f43e/src/Citepr= oc/Types.hs#L901), so you should be able to use =C2=ABsubtitle=C2=BB in sty= les. (This will give you warnings when using the style with Zotero and it w= on=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 po= stscript feature to manipulate the JSON after exporting. E.g., this one : if (Translator.BetterCSL && item.title) { reference.title =3D reference.title.replace(/ : /g, '. ') } Not bullet-proof, but simple. You will want to choose a better separator, m= aybe 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 v= on 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 w= ith 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 thou= ght 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 standa= rd 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 ver= sion of Zotero). So it doesn't seem like it is possible to control what del= imiter 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-sub= title/ ...and CSL: https://discourse.citationstyles.org/t/handling-main-sub-title-splits-citep= roc-js/1563/11 However, these were in part discussions among developers about possible cha= nges, 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 v= ia 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...) -- 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-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-46d0-b0b8-29a2cbc9509an%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 e= mail 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. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/f0f222ef-e60e-4397-83ac-bec1a6ac2d08n%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/2a8d940b3675472fb4b50ead406f6fc7%40unibe.ch. --_000_2a8d940b3675472fb4b50ead406f6fc7unibech_ Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

A slightly more reliable version:

 

```<= /o:p>

local stringify =3D pandoc.utils.stringify

function Meta(m)

  if m.references ~=3D nil then

    for _, el in ipairs (m.references) do

      -- print(stringify(el.title))

      el.title =3D pandoc.Str(string.gsub(st= ringify(el.title), ': ', '. '))

 &nb= sp;    -- print(el.title)

 &nb= sp;  end

  en= d

  re= turn m

end```

 

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

 

You can test with this file :

 

```markdown

---<= /o:p>

reference= s:

- type: b= ook

  id= : doe

  au= thor:

  - = family: Doe

 &nb= sp;  given: Jane

  issued:=

    date-parts:

    - - 2022

  title: 'A book: with a subtitle and a reference to Gen 1:1, bu= t that is not a problem'

  publisher: 'Whatever press'

  lang: de-De

...

 

test [@doe]

```

 

The filte= r itself does not cover capitalization. For some r= eason, pandoc or citeproc applies title-case transformation here. I don=E2= =80=99t think it should though.

 

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

 

That's very interesti= ng, 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 ha= ve 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 se= e 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 i= s capitalised? Or does that open a new series of problems? :-)


denis...@unibe.= ch schrieb am Freitag, 1. Juli 2022 um 18:17:02 UTC+2:

Here=E2=80=99s a very simple and absolutely u= nreliable version of a filter. This will replace every colon in a title wit= h a period.

 

```lua

local stringify =3D pandoc.utils.stringify

function Meta(m)

  if m.references ~=3D nil then

    for _, el in ipairs (m.ref= erences) do

      print(stringif= y(el.title))

      el.title =3D p= andoc.Str(string.gsub(stringify(el.title), ':', '.'))

      print(el.title)

    end

  end

  return m

end

```

 

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

 

 

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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

 

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 persp= ectives 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 s= olely 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 automa= tically converting them to a period for those cases where I need to. If tha= t 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 st= range 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 Zote= ro database for those publishers/styles that require the dot. This is not *too* onerous, as it would at least be a= utomated.

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 / effic= ient solution. I don't know lua, but if this is one possible way, then I could use it as a (hopefully fairly si= mple?) way into learning it.

 

Does this help to clarify my situation?

 

denis...-NSENcxR/0n0@public.gmane.org schrieb am F= reitag, 1. Juli 2022 um 17:34:55 UTC+2:

Yes, that=E2=80=99s a known issue...

There are a couple of possible solutions = ;:

 

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/C= iteproc/BibTeX.hs)

 

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/3f94424db4= 69c804cf2dac2d22dc7a18b614f43e/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=ABsubt= itle=C2=BB in styles. (This will give you warnings when using the style wit= h Zotero and it won=E2=80=99t work reliably across implementations, but anyway ...)

 

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

E.g., this one :

if (Translator.BetterCSL && item.titl= e) {

  reference.title =3D reference.title.re= place(/ : /g, '. ')

}

Not bullet-proof, but simple. You will want t= o 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 i= s it just in the title field?

 

Von: pandoc-...-/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 <pandoc-...@googl= egroups.com>
Betreff: Changing colons to full-stops in titles

 

I have one final (for now...) issue in setting up a CSL file (whic= h 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, b= ut 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 / bibl= iographies; US/UK standard is a colon between main title and subtitle. And reference managers like Z= otero -- IIUC -- save titles as single fields (at least they are in my vers= ion of Zotero). So it doesn't seem like it is possible to control what deli= miter 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/8= 077/separate-fields-for-title-and-subtitle/

...and CSL:

https://discourse.citationstyl= es.org/t/handling-main-sub-title-splits-citeproc-js/1563/11<= /p>

 

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

Would it be possible to automate turning colons in titles into ful= l-stops via using a filter? If so is there such a filter already around? Ca= n 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...) <= o:p>

--

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-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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.=

--
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-d= iscuss+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 &= 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/2a8d940b3675472fb4b50ead406f6fc7%40unibe.ch.
--_000_2a8d940b3675472fb4b50ead406f6fc7unibech_--