From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30910 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Changing colons to full-stops in titles Date: Sun, 3 Jul 2022 14:15:09 +0200 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="000000000000bd17e305e2e59249" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29000"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBWUQQ2LAMGQEFVHSZQY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jul 03 14:15:27 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f58.google.com ([209.85.218.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7yVa-0007Ny-7v for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 03 Jul 2022 14:15:26 +0200 Original-Received: by mail-ej1-f58.google.com with SMTP id kv9-20020a17090778c900b007262b461ecdsf1374387ejc.6 for ; Sun, 03 Jul 2022 05:15:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656850526; cv=pass; d=google.com; s=arc-20160816; b=dNkX5PwZaKUYico6Pt3Btl4ZSIxn+fpmUqhOgxj6mFFxpEU8IdrUL8CStNstKuNrnV PrqgpNb/pfTKi53Tm/wiTntfoE1KH7RBDY8f+VnPFiOY2n7OuMWSkB5aJ9EYA7gEqRbw q4cirjIJH3r97er+ZMzunmSQnnasBFyDejpHHhDNpHfwjWiKYHqRWqfkDryE1gO5O/KX k9B7E2t3dxplqTgeDUBEU82VNS2wYkG+/Xr/JaIL0411s3TCtqg/njF53AdlSZH3beB1 KsNZ6qd4tsFADz4xN3BQzBleP/fJpe6nwFaEDvT+6VykYG4jD/+9SaIHrISoRN44DDJ4 Jt7g== 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=8L7+PtSYGgVvWQktoGaFm4SabKZTJA8ivHkPlHj+Hmc=; b=b3VwnO/eXn4zmMUQ15cOPI1A5t9Wn9BiKQr4kzApdNb7hHFQ/nH2LwzSGQEXE9mPIt DsnLtLrKHvIBqWWsbKk0EGw8yEngU4ZGxJDAxZuSa/wzrt68TCWhy2sz4S/OQnOsrPgN q0nFDy+MUPQRIhibkR77mZFRuNY6GECfIV4pkvOhF+40i4+0sLCVhu7sXuYYdSDYXcyK Rz0VaMIXreIT22ecHHvFqujmx6VNPGOdlA2qIYYDCbRR/2mI8q9aYVmD47HLN4ksCe7e zV+/rdHQU9EB5mHxEZ5OIOoy5HBqLmvrjg18Zjrtv7Pk+bAJ94wKb7qaSiNK4O734kCK kntQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NOUu3R8J; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::632 as permitted sender) smtp.mailfrom=melroch-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=8L7+PtSYGgVvWQktoGaFm4SabKZTJA8ivHkPlHj+Hmc=; b=UBwxVXdKnRKXwgQGzxy5iAbUUziL4rMJNQV1OD7OwJSZ/fvPJEckXAC7f/eDqhd0V7 Ud/IIEe0w2EgTA84oDKstPgRQEVDwYMElr+mCWWKoIHRmMh3Uy4PSaUZ4ao7vWQwUOij keU8Ixnws6HHszLWOgcvd5FHRvE4wQ9t/00P3s5uLrX8IDPCJKoZQe/XyfpXdJlwDZ51 wytpI7gX1mQKmEFAqTEllqkCchksyTw6m6qk510boAiWQ3CIt91OVV1IylfWdikH3Keu tMkdUe5cCx2vIZvGtZsxVgKDgwhHBEXeOwNDOL15n9vWGtJThBwKFgWfqqn0ykDq9/hD cFzQ== 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=8L7+PtSYGgVvWQktoGaFm4SabKZTJA8ivHkPlHj+Hmc=; b=LgBU5rGP5ZYhG8uHv4FCncOb+M2TJcbzW3Dmdgj04UFGmbv/sXVauNCsLyX68FYVg3 CQvMEHYRZxmYMpjSyj2x6hebdaUWYnlQ7rFur8iyuHO+M051bv1zqkpbPfhQFXSyQnfq aOQG9s4BbGv2ELV8rKN7wiHY1NL85QbRVEgRipPSNZqiwCDwu2spggqkKsLhqzqDPMWX 8JlPuIj9Aibi1avLIGlEN0hELB6hvTyWBQq5USJiADjoShPUpMa9Qfjh5cu5p4LypFnN VJ6Zpj/unfWG3AK3j2ZXLZDNkjrllemUUNKznt4/IEW8+T8IbPP/2KQg0ZPD/Xr8VywR +YGg== 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=8L7+PtSYGgVvWQktoGaFm4SabKZTJA8ivHkPlHj+Hmc=; b=oLSsr24ceISKNZu6JS9Ov+QIODgm+RVDNccf6mnC+ivzLkHpgchSLKwIxw7bND0Gnn BB+TlSewYMIW8AWKGCuiILbtgvnTOodmqvkQueGYli8Xzu16rGTsASahcm+JDDQkhBTB FXN3ENy/DIeM37KcYoVqCBQf4mRnr4DHjI2klGo/2+T9JaO47/a0ZG294t7EFVOXyHWc sgRjQRi5dJo0y3V939xb0vGYctOBGL32PTVq4CMQuq90GeS0BjHvvyjAUDAAtxXDiMxO M5tRtgHBAY+GHSQ88SqHKR4aOpg2PnumuJbFilbDBVuX7XNX/e3TI0hGc2wq19QNEXN/ c2qg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora/xpAlkMhIRDdjEvOgY7kscKJyJ42p+lcK6oXI24zoWmiMFdK1i KNOHhyamjKXwXGAGU6JDndI= X-Google-Smtp-Source: AGRyM1vDqKMEB5lg+AfOZ22kaJSlD8doJ65JtC6N8IyNQJQ4PYmI5GnfOh5lEaea7jjnI/olB2dRpg== X-Received: by 2002:a17:906:730f:b0:726:ca34:e605 with SMTP id di15-20020a170906730f00b00726ca34e605mr23972876ejc.347.1656850525832; Sun, 03 Jul 2022 05:15:25 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6402:50cf:b0:435:9b77:f6e3 with SMTP id h15-20020a05640250cf00b004359b77f6e3ls4129154edb.0.gmail; Sun, 03 Jul 2022 05:15:21 -0700 (PDT) X-Received: by 2002:aa7:d7c4:0:b0:435:6a5b:b02f with SMTP id e4-20020aa7d7c4000000b004356a5bb02fmr31787168eds.365.1656850521512; Sun, 03 Jul 2022 05:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656850521; cv=none; d=google.com; s=arc-20160816; b=LClNvAp0wmC/taTEC2tZk1gULfO1ZApFlRWK40pxexz4ZUpdpV2ytnhIfPI27RCAPZ w8FI5AcGcoZ/HRRJYrxiqmWyKdcf6ELKUB1nINH66+RgsJA4Tlsu2yTgI6kGAOGQmpt4 ahiZqdxdJbaSIgmHXlmtGoAmGkK+MSgONAdmak6Fc2mOiBNX1BXZx7WoddMbSnG5fCHS l3tG9GmYBHiGGYDEiRa3Cpod5MJF/qym+BhH/rxwmtKsbWLZTuGU3gNUQ7GvD2R/YWHH VUfzzE2pytlUpiwu5eZn9ZVb8lUQH/ueLiXmgObhTm0ASFz/fvZfVfz8M2S4AzBfMwoh miIg== 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=E+Bt+5cP/f9IpXvarARJNiZiQ9jHnr/mCR2t2BAtjW0=; b=wT9GuBKLBdsLj7QM8mZ1czGwmlcZBSBozP5zEisngFr6FD3IPQAtEdJWXSBJNaIZCh vITaCJe7E0A5Suk/X6t5yn7a6lOSI6LJ8bmBmR7RDZ0pUjAhfAUcbvat/X85esI1Td4A K+z8RaZT6BrspFvk4tonaovGAPw5Csl+wVtGDhiye+gtNjclOu1CIQ2FLzt01y0XNl7N 3xJz3L4fDJa8iEF8QKxyHyvtYbYDPAGnSmQmmAmPy8YHeqr+LMCAouZOtym3dBocB0hc nFrHg6JAK+8PoDjWPuLGiIPzmeRtpIavMjlT81nAL2GHVZGXZw2hfGua+XWUp41TuM3G RK1A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NOUu3R8J; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::632 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com. [2a00:1450:4864:20::632]) by gmr-mx.google.com with ESMTPS id jx1-20020a170907760100b0072a6696083bsi504028ejc.2.2022.07.03.05.15.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Jul 2022 05:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::632 as permitted sender) client-ip=2a00:1450:4864:20::632; Original-Received: by mail-ej1-x632.google.com with SMTP id mf9so12163170ejb.0 for ; Sun, 03 Jul 2022 05:15:21 -0700 (PDT) X-Received: by 2002:a17:907:7f22:b0:726:8962:d5a6 with SMTP id qf34-20020a1709077f2200b007268962d5a6mr23957392ejc.717.1656850520806; Sun, 03 Jul 2022 05:15:20 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NOUu3R8J; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::632 as permitted sender) smtp.mailfrom=melroch-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:30910 Archived-At: --000000000000bd17e305e2e59249 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It's an upstream bug in LaTeX::ToUnicode. 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 than `\"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?) Den s=C3=B6n 3 juli 2022 07:42Paulo Ney de Souza skrev= : > 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, or > that it processes \c{e}, but not the comma-accent any of the other vowels= ... > > 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 that >>>> 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 i= n >>>> the coming days. >>>> >>>> I have thought about this issue of false positives while thinking abou= t >>>> the option of some kind of filter. But...I think they would be very ra= re. 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 anythi= ng 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 fi= lter. >>>> 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 positive= s. >>>> >>>> >>>> >>>> >>>> >>>> *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 m= y >>>> 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 perspective= s 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 th= e >>>> relevant punctuation in the title field. However, I want to continue s= aving >>>> my bibliographic entries with a colon (because that's the most standar= d one >>>> for me), but have the option of automatically converting them to a per= iod >>>> 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 st= range >>>> archival references I have to make in my field, and JSON seemed to wor= k >>>> 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 lik= e >>>> I would here have to create a separate bibliography file from my Zoter= o >>>> 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 : >>>> >>>> >>>> >>>> 1. use biblatex databases and patch pandoc so it will concat title and >>>> subtitle fields using periods. (line 667 >>>> https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Citeproc/Bib= TeX.hs >>>> ) >>>> >>>> >>>> >>>> 2. I think pandoc=E2=80=99s citeproc will just treat every unknown var= iable as >>>> a string variable (see >>>> https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b= 614f43e/src/Citeproc/Types.hs#L1054 >>>> and >>>> https://github.com/jgm/citeproc/blob/3f94424db469c804cf2dac2d22dc7a18b= 614f43e/src/Citeproc/Types.hs#L901), >>>> so you should be able to use =C2=ABsubtitle=C2=BB in styles. (This wil= l give you >>>> warnings when using the style with Zotero and it won=E2=80=99t work re= liably 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 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, 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/p= eriod >>>> *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 t= o >>>> 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-an= d-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 ar= ound? >>>> 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 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-b0= b8-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 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-ae= d5-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 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-83= ac-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-b9f= 3-1ecfbe68d457n%40googlegroups.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/CADAJKhAU66TxJKMZdDM-KV= abJpmKUVo5xyuAAN03F2b89jv9Ow%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/CAFVhNZMyj_GZ%3DAo_1qR2r= wnAAYAaQ%3DMaf880cGLRv7yD_ianpQ%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/CADAJKhBjTdgbY-xDouhDGfnE%2BJ%2BV5c3v0FUA2Hn00z59%3D%3DWeLw%= 40mail.gmail.com. --000000000000bd17e305e2e59249 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It's an upstream bug in LaTeX= ::ToUnicode. 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 `\&quo= t;{a}` rather than `\"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?)

Den s=C3=B6n 3 juli 2022 07:42Paulo = Ney de Souza <pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
I got interested in another=C2=A0aspect of= the posting -- the program "cleanbib.pl" by Benct.
<= br>
I installed=C2=A0it in Ubuntu, and found out it does not proc= ess perfectly valid TeX code like characters that end or have a space in th= e middle, or that it processes \c{e}, but not the comma-accent any of the o= ther vowels...

I prepared the torture test bel= ow to show the problems:

@Book{hobbit,
=C2=A0 t= itle =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 does this c= ompare to:


Paulo Ney
=

On Sat, Jul 2, 2022 at 1:03 PM BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org&= gt; wrote:
string.gsub() optionally takes the maximum number of substitut= ions as a fourth argument, and you can reinsert capture groups in the repla= cement, so this should be fairly robust:

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


Den fre 1 juli 2022 18:44John Carter Wood <woodj= o@uni-mainz.de> 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 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 pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https:/= /groups.google.com/d/msgid/pandoc-discuss/CADAJKhBjTdgbY-xDouhDGfnE%2BJ%2BV= 5c3v0FUA2Hn00z59%3D%3DWeLw%40mail.gmail.com.
--000000000000bd17e305e2e59249--