From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30899 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Carter Wood Newsgroups: gmane.text.pandoc Subject: Re: Changing colons to full-stops in titles Date: Fri, 1 Jul 2022 09:23:33 -0700 (PDT) Message-ID: References: <78df697a-50f5-46d0-b0b8-29a2cbc9509an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2158_1934772164.1656692613814" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20089"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCYPBGVKTEEBBB577SKQMGQE4RHMKLQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jul 01 18:23:38 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yb1-f183.google.com ([209.85.219.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7JQg-0004yx-Jw for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 01 Jul 2022 18:23:38 +0200 Original-Received: by mail-yb1-f183.google.com with SMTP id b7-20020a256707000000b00669b4b2c5dasf2328246ybc.1 for ; Fri, 01 Jul 2022 09:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=bRo2ckKDdA+Q9wX3iv0ZqYPCvNjncs7v6qxyl6H0nLQ=; b=AQmj2sQpgFOeDQYaMbjCI/Il1zlOqo+LWeFyenI3Cz9j82NE2PiVHNvo8+gfOb/0Oh VW0/pbbZIT/rAyz6TGfSxuglnzSw/LInIobaAbMC42sS9xefRBFHksPhxA12o49hFe6X VmTb4YYKo/3PC/vKuTcto1Qzt8MoE3/fGK3+22dbRxjZWD5b9YUCG/RWb9527pSt9jEc 2OK44kX1Gi2BjUzrrrgWCC1UJccAK0MdiqN/KtSE1Wixag/4VKXqmRqcLjdmN1xDKFng 4RiN438L/fHpfHDdwMMPgvNxFmtjAJQ2Pod+KODYIwKSJuCDwF6wyM+054DrcHiBmDx5 NDcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=bRo2ckKDdA+Q9wX3iv0ZqYPCvNjncs7v6qxyl6H0nLQ=; b=UQ9WR+PwKiVoHAt0s+qWFT7P1ttIoqv3NN7AHdoJnXOyHCDS11SBw0FCYE8Q71qTHB 0Jm6AD/kNGmdkFTEQXPdpPjTzU8J94wANAJwhEfTDpAU2LGTksmfYSE0LVAyyziyzB+M a1pgWkE8sIA1RVZIRjtmOlsQoTSyzwQ9uyBlrWJdtZ9WEBtbBjlZzf5pmZBZ4uvXqt6G K39AUnKqK8Dj7V+hxPbjTqa1yOHsfn2EfVJiTFQWJ0QQI70mRB+XdnPBGTkcz6syyBcn h0APzSCYLN90yyrHYHm3K6J4goa/v8Pet/ukiRg6713Ryk6FkD23+cVtQ1Oi7UkykDYq ymhw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora94c14QUhnT3suDOAtEc5BLuHPNzZTGT1o/vHibEON2iMDVHCji /Y70I6hYTYYkLWF/QMEB9rQ= X-Google-Smtp-Source: AGRyM1uE6igpK8IB+84QxSzoPifSodot39LC452KMvh29xUBFOafMdUKOFeqSMTqPlLtxv1eL8AYzQ== X-Received: by 2002:a0d:fe03:0:b0:31c:71c8:9cbc with SMTP id o3-20020a0dfe03000000b0031c71c89cbcmr794752ywf.164.1656692617592; Fri, 01 Jul 2022 09:23:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a25:fc06:0:b0:66d:1f4d:e941 with SMTP id v6-20020a25fc06000000b0066d1f4de941ls8227128ybd.6.gmail; Fri, 01 Jul 2022 09:23:34 -0700 (PDT) X-Received: by 2002:a25:d80d:0:b0:66c:8e4b:dea6 with SMTP id p13-20020a25d80d000000b0066c8e4bdea6mr15504377ybg.401.1656692614620; Fri, 01 Jul 2022 09:23:34 -0700 (PDT) In-Reply-To: X-Original-Sender: woodjo-ZOsAvrTRSvuEhhMi0yms2Q@public.gmane.org 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:30899 Archived-At: ------=_Part_2158_1934772164.1656692613814 Content-Type: multipart/alternative; boundary="----=_Part_2159_1702014733.1656692613814" ------=_Part_2159_1702014733.1656692613814 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That's very interesting, thanks! I'll try it out when I get a chance in the= =20 coming days.=20 I have thought about this issue of false positives while thinking about the= =20 option of some kind of filter. But...I think they would be very rare. I=20 have a hard time thinking of a title with a colon in it that shouldn't be= =20 -- in this case -- be turned into a dot. At least, I don't have anything in= =20 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= =20 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 filte= r. This=20 > will replace every colon in a title with a period. > > =20 > > ```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 > > ``` > > =20 > > Question is how this can be made robust enough to avoid false positives. > > =20 > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *John Carter Wood > *Gesendet:* Freitag, 1. Juli 2022 17:52 > *An:* pandoc-discuss > *Betreff:* Re: Changing colons to full-stops in titles > > =20 > > Thanks for the suggestions, a couple of which are kind of stretching my= =20 > knowledge of these things, but I see where they're going.=20 > > As to JGM's question: I am using a CSL json bibliography, so my titles ar= e=20 > in a single field. ("title":"Science and religion: new perspectives on th= e=20 > dialogue") > > The issue is that *most* of the journals / publishers I publish in use, a= s=20 > here, the colon. *Some* (mainly German) styles want the period. If I were= =20 > solely interested in either one, I could choose and just enter the releva= nt=20 > punctuation in the title field. However, I want to continue saving my=20 > bibliographic entries with a colon (because that's the most standard one= =20 > for me), but have the option of automatically converting them to a period= =20 > for those cases where I need to. If that makes sense.=20 > > Thus: going through denis's options:=20 > > 1. I have switched to json bibliographies from bibtex/biblatex as they=20 > seemed to offer more flexibility (I was running into issue with the stran= ge=20 > archival references I have to make in my field, and JSON seemed to work= =20 > better in that regard). So this seems to not apply.=20 > > 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= =20 > would here have to create a separate bibliography file from my Zotero=20 > database for those publishers/styles that require the dot. This is not=20 > *too* onerous, as it would at least be automated.=20 > > 4. Having a filter that I could simply apply (as part of a pandoc command= ,=20 > say) or not apply as relevant seems like the most flexible / efficient=20 > solution. I don't know lua, but if this is one possible way, then I could= =20 > use it as a (hopefully fairly simple?) way into learning it.=20 > > =20 > > Does this help to clarify my situation? > > =20 > > 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 : > > =20 > > 1. use biblatex databases and patch pandoc so it will concat title and=20 > subtitle fields using periods. (line 667=20 > https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Citeproc/BibTeX= .hs > ) > > =20 > > 2. I think pandoc=E2=80=99s citeproc will just treat every unknown variab= le as a=20 > string variable (see=20 > https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b614= f43e/src/Citeproc/Types.hs#L1054=20 > and=20 > https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b614= f43e/src/Citeproc/Types.hs#L901),=20 > so you should be able to use =C2=ABsubtitle=C2=BB in styles. (This will g= ive you=20 > warnings when using the style with Zotero and it won=E2=80=99t work relia= bly across=20 > implementations, but anyway ...) > > =20 > > 3. if you=E2=80=99re using Zotero, you can leverage Zotero BBT=E2=80=99s = postscript=20 > 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,= =20 > maybe a double-bar or so. > > =20 > > 4. Doing the with lua should also be possible... > > =20 > > The question is: do you have the subtitle in a distinct field or is it=20 > just in the title field? > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > Auftrag von *John Carter Wood > *Gesendet:* Freitag, 1. Juli 2022 16:39 > *An:* pandoc-discuss > *Betreff:* Changing colons to full-stops in titles > > =20 > > I have one final (for now...) issue in setting up a CSL file (which I use= =20 > with pandoc/citeproc and references in a json file).=20 > > =20 > > I'm not sure whether this is a CSL issue or whether it's an issue that ca= n=20 > be solved via using a filter (or some other solution) in pandoc, but I=20 > thought there might be some people here who might have faced a similar=20 > issue.=20 > > =20 > > The house style for here (German-based publisher) wants a *full-stop/peri= od=20 > *between main title and subtitle in citations / bibliographies; US/UK=20 > standard is a *colon* between main title and subtitle. And reference=20 > managers like Zotero -- IIUC -- save titles as single fields (at least th= ey=20 > are in my version of Zotero). So it doesn't seem like it is possible to= =20 > control what delimiter is used between them via CSL.=20 > > > I have found various discussions of relevant title/subtitle division=20 > issues -- some going back quite a few years -- in forums on Zotero:=20 > > > https://forums.zotero.org/discussion/8077/separate-fields-for-title-and-s= ubtitle/ > > ...and CSL: > > > https://discourse.citationstyles.org/t/handling-main-sub-title-splits-cit= eproc-js/1563/11 > > =20 > > However, these were in part discussions among developers about *possible*= =20 > changes, and I'm not sure of the current status of this issue or whether= =20 > there is a way to handle it.=20 > > Would it be possible to automate turning colons in titles into full-stops= =20 > via using a filter? If so is there such a filter already around? Can this= =20 > be done via CSL? > > =20 > > Or is this, as of now, impossible? > > (Or is there a real simple solution that I have, as usual, overlooked...)= =20 > > --=20 > > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/78df697a-50f5-46d0-b0b8-= 29a2cbc9509an%40googlegroups.com=20 > > . > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/a2d540a6-a435-4285-aed5-= 018007d155cfn%40googlegroups.com=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/f0f222ef-e60e-4397-83ac-bec1a6ac2d08n%40googlegroups.com. ------=_Part_2159_1702014733.1656692613814 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 wh= ile thinking about the option of some kind of filter. But...I think they wo= uld 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 d= ot is capitalised? Or does that open a new series of problems? :-)

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

Here=E2=80=99s a very simple an= d absolutely unreliable version of a filter. This will replace every colon = in a title with a period.

=C2=A0

```lua

local stringify =3D pandoc.util= s.stringify

function Meta(m)<= /span>

=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(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 mad= e robust enough to avoid false positives.

=C2=A0

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.c= om> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 17:52
An: pandoc-discuss <pa= ndoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Changing colons to full-stops in titles

=C2=A0

Thanks for the sugges= tions, a couple of which are kind of stretching my knowledge of these thing= s, 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 p= erspectives 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 au= tomatically 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 bibte= x/biblatex as they seemed to offer more flexibility (I was running into iss= ue with the strange archival references I have to make in my field, and JSO= N seemed to work better in that regard). So this seems to not apply.

2. Seems to not apply, as I have a single title fiel= d

3. Sounds really interesting, and I use BBT, though = it also sounds like I would here have to create a separate bibliography fil= e 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 par= t of a pandoc command, say) or not apply as relevant seems like the most fl= exible / efficient solution. I don't know lua, but if this is one possi= ble way, then I could use it as a (hopefully fairly simple?) way into learning it.

=C2=A0

Does this help to cla= rify my situation?

=C2=A0

denis...@= unibe.ch schrieb am Freitag, 1. Juli 2022 um 17:34:55 UTC+2:<= /u>

Yes, that=E2=80=99s a known iss= ue...

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

=C2=A0

1. use biblatex databases and p= atch 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)<= /p>

=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/3f94424db469c804cf2dac2d22dc7a18= b614f43e/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 ...)

=C2=A0

3. if you=E2=80=99re using Zote= ro, 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 &&= amp; item.title) {

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

}

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

=C2=A0

4. Doing the with lua should also be possible...<= /u>

=C2=A0

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

=C2=A0

Von: pandoc-...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m <pandoc-..= .@googlegroups.com> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 16:39
An: pandoc-discuss <pandoc-...-/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 whet= her 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) wa= nts 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 = 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://fo= rums.zotero.org/discussion/8077/separate-fields-for-title-and-subtitle/=

...and CSL:

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

=C2=A0

However, these were i= n 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 t= itles into full-stops via using a filter? If so is there such a filter alre= ady 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...) <= u>

--

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...@googlegro= ups.com.
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...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.

--
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/f0f222ef-e60e-4397-83ac-bec1a6ac2d08n%40googlegroups.= com.
------=_Part_2159_1702014733.1656692613814-- ------=_Part_2158_1934772164.1656692613814--