From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30911 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paulo Ney de Souza Newsgroups: gmane.text.pandoc Subject: Re: Changing colons to full-stops in titles Date: Sun, 3 Jul 2022 09:53:59 -0700 Message-ID: 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="000000000000e66cd805e2e977fe" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9452"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDYKBT675MKBBM4TQ6LAMGQEZRKPTIY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jul 03 18:54:17 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f183.google.com ([209.85.128.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o82rP-0002GG-KR for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 03 Jul 2022 18:54:15 +0200 Original-Received: by mail-yw1-f183.google.com with SMTP id 00721157ae682-31c85bf7ec3sf16853947b3.10 for ; Sun, 03 Jul 2022 09:54:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656867254; cv=pass; d=google.com; s=arc-20160816; b=ph3GGZmhe9f5apZf/GVzlTCE41j7NtLLBhVajw9KWsHBnPbFbh2VwBDn5e6dd+kOnX OneW/WFgiDdX0eDn4oRFfMFxsUU6tm5S7PMzSdSArVANUrLre07pzeo2F/IAu8yH2FQ1 h+y+UkGMb70EeMUUB43laR4zMJYZeaIC+0BY/XweIig8XMCn/wcW1UxksjGcV7CxHRQg MQ8bD4Sz7UJB2V8nHPtRxEiJS3o+TuxhFuRNBYaxSnV00jiDMDtKyAIhu+znKMyQMro/ n4OARqrZYC1llYRoZqZ0ZQ2lJu6rYGOLiIKyR4wfkcsXUkb0rPCyVk5SY7oC7v6sTphR NkUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=e10/rutt5ogHQaq5H28Ybs8cwOxUTJIuVh5ZN7I3KM8=; b=itg6ELZpCFddSd6x54iOKM7fiIx+fp8C2I58AS0h5JlE5qdsaKImnDmo8togp6LPJs 23NPGMKflFe1XHhUbzCV5w2W2Mo6o6CxCCsrds8kDVJChJTeeSIEvNluY+xLG/FCIVMt EYkUMVrMUTpfZ3ddv22bcz2YZ4bpxh4pzURl7ljpxMWHL/CR/WMus27oZ4ycBoQi2QMR Mz8Bl6EKC87lcqVqYmosGCvzc+B3GGe+eVT53ayMrCRCNwihvm5/o37mzaOTtDfi51uv HrTp2MActkN+D25O7jndrs9vJxJkncKkIzxCjwSX03NepIRUnJsYCtT/CEaq1zqD4+GB TjIA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eC+7+6lS; spf=pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2001:4860:4864:20::2d as permitted sender) smtp.mailfrom=pauloney-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:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=e10/rutt5ogHQaq5H28Ybs8cwOxUTJIuVh5ZN7I3KM8=; b=rTZeFIGabh50lVQiXDAMoR2921KlKc1GkX09boFjf8kdxMb2fJvQShSEzatJBSkidh 326qjo4fDrbYAGwcx5KoRkw3Njo6KmK0VEOi/IzcuzTE8fnDcqtfS8Ri9ZOgTt8H6HIk nQ3uVkpAt8Fj2dFqlcKP9O+eEQViZaQxI1kPND2yRzfr/jsCNYMKJn/j5ljMh7YVEARY QwXGyS6uRRDdpocoZQoaeZ7fB8EdoxdHgjauapaRMnSLEzbnQBxA0Wj8k+BMqAgftH7K BIU+TWWuVhLsOQ55BnCeEBgJeWo96LIOVP4YbE2aPr5D+tHhCEVbMHrFK4nYR2KdhbxB 6eBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=e10/rutt5ogHQaq5H28Ybs8cwOxUTJIuVh5ZN7I3KM8=; b=QWrQMNb1dbWSAxa6VS5lNav/vxwsdFjR/b4I2oUAxd0BXmWBpUw9dS1vWcxipa9kcv +C8aSUaSu1bfIJVSOyHOOwhVNQgQ+scmQrSpBaybNGkyhze4ariylAAE7ZcLDebVydZ/ T4IBgLSLVRTEn2vk4ak0E8rj4bhBse/UyulB4ng4h1IzpGj5fhloqHihhKgr7hkPyf0v jAfceLG3oi+J8dLvvwZjVaX/zll7HE2RU9tsiR0yV2pXbiD61Ch8q+WXR3BC0RO6owPh vzAsL3nChezZgDTsfNFEYLyWFv45zxbn3KYtlMkdBPkk8T386w5SZOsqP3F/9fhj26iM RKMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=e10/rutt5ogHQaq5H28Ybs8cwOxUTJIuVh5ZN7I3KM8=; b=yfST0chdiJlERK+K7pG918F8ZDVV0acAUVWpRZhoD+DrALiiY5VOMpwKuLcCYZ0ygM wBm97neUs6Iw+ov7QPasnoq1by5By6V0wSNoDGPJ9hYaQ43J/xWyfuvbwWYM3Uwm+C7S nHteif9tFinQ7Crt4G5Tgjc8HgCSG7OjIK9Dp4RL40frhXXUabCXUXQmBlw2d+BMmBgx i8JakWIXZjm626fXnEmQ+T8wS3hPAuU/F8B5dJS3mjMdv2D6XFYfJXRCizIe6s2cTcd8 lFubFMPu9ZgB8FbVG7He1eKLwFVPpvm6rgqSE9W+5dDCMFA3bVnPZZFcVxmvRWDzFvJE 9eQg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora87Q/2B7yMpM3iWZhjbkUQirA3G7/4J9j+Dsh+V7hPLQ1RWbGzS wcAKF0RXiKL9bN2HynodwFM= X-Google-Smtp-Source: AGRyM1vme8ivH9d26zZPdC83//pQ11xtcvxfQYd6DabfzZbx3VVUBouagyliXv/XdMQAByIBsPl8yw== X-Received: by 2002:a05:6902:684:b0:66d:d662:a66e with SMTP id i4-20020a056902068400b0066dd662a66emr16532908ybt.539.1656867254480; Sun, 03 Jul 2022 09:54:14 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a81:4fd3:0:b0:31c:8915:f41c with SMTP id d202-20020a814fd3000000b0031c8915f41cls676046ywb.8.gmail; Sun, 03 Jul 2022 09:54:11 -0700 (PDT) X-Received: by 2002:a81:7996:0:b0:31c:96d1:746 with SMTP id u144-20020a817996000000b0031c96d10746mr1701876ywc.467.1656867251241; Sun, 03 Jul 2022 09:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656867251; cv=none; d=google.com; s=arc-20160816; b=ryRl7tVlCGtJ1mOH7HtE75VcDPYBaQRvpRKDzMJt5N6Y/gmX584eB+AHwi8MKm262i 9UpGfNFMxTKNIlY3kI87OvKaza7brJ/68vQMYmQt0GX590pv+eRAzyKVvur5TLCGB/DF DEpufrjEcsSBqzNoB41zZ8RKlJTg3uijLUddo1D0m3U6TkGV8k09Q+L3Thk1rhDiQxoK lgXiWmGcMSvfVdZJIY3fAjzjVtuPSqLJeSONLn9Z4MhadTIDttmS1n0+E7Z5kvMgbRoO +OKgJd8B4MgQVWyaqUwtrlZYFqbXYPGVKHqdRM6TF0NawPzeBxsYe/oHd3EI2Pp3Eg9h YApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vN9jKGBd9dC4e4I1p82MObqLjSw0NXWhmwVPsSYC+Ek=; b=uDFRzqjYN2rkgIqnINAECatCAXklMjDDBwT9VXmMzwjfWQM9bchv4eeeAuF6biEWJn qu6rboyXbVtQiQUTXWR4gx/w5W7bAPXX1uUZ+MSDiarWNxM2U+aQUxCpvq2ZT6bjz+hL 5smBBEuV3JyFDv9jEdWdNMmCeBPCAQFqHahSAVUrBDrso3pYMrQR+wWVvI+oamZRstsz dznXJNVbqf0PXTJDz/UJpHQYZf4TF5CfrwoamRJNCzNRItQFxqRUa+qzmlrN9S/AJxJj nVDcplnXuf/45WlyRNXvxG1AyQDNrVzY2D8rl3Ddz6bxuUw1TBw4d/Q6RIf0cWlOt9qr LKyw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eC+7+6lS; spf=pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2001:4860:4864:20::2d as permitted sender) smtp.mailfrom=pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com. [2001:4860:4864:20::2d]) by gmr-mx.google.com with ESMTPS id h71-20020a25d04a000000b0066e2082cd84si194038ybg.1.2022.07.03.09.54.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Jul 2022 09:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2001:4860:4864:20::2d as permitted sender) client-ip=2001:4860:4864:20::2d; Original-Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-fe023ab520so10197433fac.10 for ; Sun, 03 Jul 2022 09:54:11 -0700 (PDT) X-Received: by 2002:a05:6870:bf0f:b0:108:7537:cf34 with SMTP id qh15-20020a056870bf0f00b001087537cf34mr15694614oab.283.1656867250399; Sun, 03 Jul 2022 09:54:10 -0700 (PDT) In-Reply-To: X-Original-Sender: pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eC+7+6lS; spf=pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2001:4860:4864:20::2d as permitted sender) smtp.mailfrom=pauloney-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:30911 Archived-At: --000000000000e66cd805e2e977fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jul 3, 2022 at 5:15 AM BPJ wrote: > It's an upstream bug in LaTeX::ToUnicode. > On LaTeX::ToUnicode ? I thought you only used BibTeX::Parser. I just had never run into it AFAIK because all the .bib files I had written > myself or downloaded from the libraries I use had used `\"{a}` rather tha= n > `\"a` which doesn't hit the bug. I have located the bug and am working on= a > patch. Thanks for discovering this! (There are a lot of unattended bugs > though. Do you want me to send you the patch when it is ready?) > I know of some bugs on BibTeX::Parser (and none on LaTeX::ToUnicode). It would be nice to have all of them listed o the issues of the project page: https://github.com/borisveytsman/BibTeXPerlLibs/issues especially if you are producing a patch. Paulo Ney > Den s=C3=B6n 3 juli 2022 07:42Paulo Ney de Souza skr= ev: > >> I got interested in another aspect of the posting -- the program " >> cleanbib.pl" by Benct. >> >> I installed it in Ubuntu, and found out it does not process perfectly >> valid TeX code like characters that end or have a space in the middle, o= r >> that it processes \c{e}, but not the comma-accent any of the other vowel= s... >> >> I prepared the torture test below to show the problems: >> >> @Book{hobbit, >> title =3D {Les \oe uf de la serpente}, >> address =3D {Bla\v zi\'c}, >> publisher =3D {\c{a} \c{e} \c{i} \c{o} \c{u}}, >> } >> >> and above all, how does this compare to: >> >> https://ctan.org/tex-archive/support/bibtexperllibs/LaTeX-ToUnicode >> >> Paulo Ney >> >> >> On Sat, Jul 2, 2022 at 1:03 PM BPJ wrote: >> >>> string.gsub() optionally takes the maximum number of substitutions as a >>> fourth argument, and you can reinsert capture groups in the replacement= , so >>> this should be fairly robust: >>> >>> ``````lua >>> string.gsub(title, '%:(%s)', '.%1', 1) >>> `````` >>> >>> >>> Den fre 1 juli 2022 18:44John Carter Wood skrev: >>> >>>> Ah, of course, biblical references. Religious history is one of my >>>> fields, how could I miss that? >>>> >>>> Looking forward to trying this out! >>>> >>>> denis...-NSENcxR/0n0@public.gmane.org schrieb am Freitag, 1. Juli 2022 um 18:41:02 UTC+2: >>>> >>>>> 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 tha= t >>>>> is not 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *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 >>>>> 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 absolutely unreliable version of a f= ilter. >>>>> 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 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 title= s >>>>> are in a single field. ("title":"Science and religion: new perspectiv= es 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 perio= d. 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 standa= rd one >>>>> for me), but have the option of automatically converting them to a pe= riod >>>>> 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 the= y >>>>> seemed to offer more flexibility (I was running into issue with the s= trange >>>>> archival references I have to make in my field, and JSON seemed to wo= rk >>>>> 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. Thi= s 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 : >>>>> >>>>> >>>>> >>>>> 1. use biblatex databases and patch pandoc so it will concat title an= d >>>>> subtitle fields using periods. (line 667 >>>>> https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Citeproc/Bi= bTeX.hs >>>>> ) >>>>> >>>>> >>>>> >>>>> 2. I think pandoc=E2=80=99s citeproc will just treat every unknown va= riable 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/3f94424db469c804cf2dac2d22dc7a18= b614f43e/src/Citeproc/Types.hs#L901), >>>>> so you should be able to use =C2=ABsubtitle=C2=BB in styles. (This wi= ll give you >>>>> warnings when using the style with Zotero and it won=E2=80=99t work r= eliably 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 : >>>>> >>>>> 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, 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 i= t >>>>> 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 tha= t >>>>> 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 simila= r >>>>> 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 leas= t 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-a= nd-subtitle/ >>>>> >>>>> ...and CSL: >>>>> >>>>> >>>>> https://discourse.citationstyles.org/t/handling-main-sub-title-splits= -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 a= round? >>>>> 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, sen= d >>>>> 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-46d0-b= 0b8-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, sen= d >>>>> 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 >>>>> >>>>> . >>>>> >>>>> -- >>>>> 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, sen= d >>>>> 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/f0f222ef-e60e-4397-8= 3ac-bec1a6ac2d08n%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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/pandoc-discuss/b3deb0de-8ba0-4159-b9= f3-1ecfbe68d457n%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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAU66TxJKMZdDM-K= VabJpmKUVo5xyuAAN03F2b89jv9Ow%40mail.gmail.com >>> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/CAFVhNZMyj_GZ%3DAo_1qR2= rwnAAYAaQ%3DMaf880cGLRv7yD_ianpQ%40mail.gmail.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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBjTdgbY-xDouhDGfn= E%2BJ%2BV5c3v0FUA2Hn00z59%3D%3DWeLw%40mail.gmail.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/CAFVhNZNNsfQs_Lt8agoaseyrNfdhrVOC9GTusMEdfecJFCBnug%40mail.g= mail.com. --000000000000e66cd805e2e977fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sun, Jul 3, 2022 at 5:15 AM BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
It's an upstream bug in LaTeX::ToUnicode.

On=C2=A0 LaTeX::ToUnicode ? I thought you only = used BibTeX::Parser.

I just had never run into it AFAIK becaus= e all the .bib files I had written myself or downloaded from the libraries = I use had used `\"{a}` rather than `\"a` which doesn't hit th= e bug. I have located the bug and am working on a patch. Thanks for discove= ring this! (There are a lot of unattended bugs though. Do you want me to se= nd you the patch when it is ready?)

I= know of some bugs on BibTeX::Parser (and none on LaTeX::ToUnicode). It wou= ld be nice to have all of them listed o the=C2=A0issues of the project page= :


especially if you are produc= ing a patch.

Paulo Ney


Den s=C3=B6n 3 juli 2022 07:42Paulo Ney de Souza = <pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
I got interested in another=C2=A0asp= ect of the posting -- the program "cleanbib.pl" by Benct= .

I installed=C2=A0it in Ubuntu, and found out it does n= ot process perfectly valid TeX code like characters that end or have a spac= e in the middle, or that it processes \c{e}, but not the comma-accent any o= f the other vowels...

I prepared the torture t= est below to show the problems:

@Book{hobbit,
= =C2=A0 title =C2=A0 =C2=A0=3D {Les \oe uf =C2=A0de la serpente},
=C2=A0 = address =3D {Bla\v zi\'c},
=C2=A0 publisher =3D {\c{a} \c{e} \c{i} \= c{o} \c{u}},
}=C2=A0

and above all, how doe= s this compare to:


Paulo Ney


On Sat, Jul 2, 2022 at 1:03 PM BPJ <bpj@melroch= .se> wrote:
string.gsub() optionally takes the maximum number of s= ubstitutions as a fourth argument, and you can reinsert capture groups in t= he replacement, so this should be fairly robust:

``````lua
string.gsub(title, '= ;%:(%s)', '.%1', 1)
``````


Den fre 1 juli 2022 18:44John Carter Wood <woodjo-ZOsAvrTRSvuEhhMi0yms2Q@public.gmane.org> skrev:
Ah, of course, biblical references. Religious histo= ry is one of my fields, how could I miss that?

Looking forward to t= rying this out!

denis...-NSENcxR/0n0@public.gmane.org schrieb am Freit= ag, 1. Juli 2022 um 18:41:02 UTC+2:

A slightly more reliable versio= n:

=C2=A0

```

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

(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

---

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

=C2=A0=C2=A0=C2=A0 date-parts:<= u>

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

=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

The filter itself does not cover capitalizatio= n. For some reason, pandoc or citeproc applies tit= le-case transformation here. I don=E2=80=99t think it should though.=

=C2=A0

Von: pandoc-...@googlegr= oups.com <pando= c-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 18:24
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Changing colons to full-stops in titles

=C2=A0

That's very interes= ting, 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 ca= n 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 2022 um 18:17:02 UTC+2:<= u>

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

=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-...@googl= egroups.com <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Freitag, 1. Juli 2022 17:52
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Changing colons to full-stops in titles

=C2=A0

Thanks for the suggesti= ons, 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 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 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 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 a= utomated.

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 possible way, then I could use it as a (hopefully fairly si= mple?) way into learning it.

=C2=A0

Does this help to clari= fy 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 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://g= ithub.com/jgm/pandoc/blob/master/src/Text/Pandoc/Citeproc/BibTeX.hs<= /a>)

=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/3f94424db469c804cf2dac2d22dc7a18b61= 4f43e/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-...@googl= egroups.com <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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://forums.zotero.org/discussion/8077/separate-fields-for-t= itle-and-subtitle/

...and CSL:

https://discourse.citationstyles.org/t/handling-main-su= b-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 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...= @googlegroups.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...= @googlegroups.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...@googl= egroups.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-discuss+unsu= bscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pando= c-discuss/b3deb0de-8ba0-4159-b9f3-1ecfbe68d457n%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-discuss+unsubscribe@goo= glegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pand= oc-discuss/CADAJKhAU66TxJKMZdDM-KVabJpmKUVo5xyuAAN03F2b89jv9Ow%40mail.gmail= .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-discuss+unsubscribe@goo= glegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAFVhNZMyj_GZ%3DAo_1qR2rwnAAYAaQ%3DMaf880cGLRv7yD_ianpQ%40ma= il.gmail.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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBjTd= gbY-xDouhDGfnE%2BJ%2BV5c3v0FUA2Hn00z59%3D%3DWeLw%40mail.gmail.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/CAFVhNZNNsfQs_Lt8agoaseyrNfdhrVOC9GTusMEd= fecJFCBnug%40mail.gmail.com.
--000000000000e66cd805e2e977fe--