From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33244 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ioan Muntean Newsgroups: gmane.text.pandoc Subject: Re: Escape sequence in LUA filters, problems multiple citations conversion of docx to Latex Date: Fri, 27 Oct 2023 13:36:24 -0700 (PDT) Message-ID: References: <3e06a866-8075-4031-886e-8c45cc4ab8bdn@googlegroups.com> <805aa20b-322e-4420-9f4c-33b5c9adf109n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_16352_1955927274.1698438984267" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25355"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDFZBUNSQQLBBSN66CUQMGQEUVYSWNI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 27 22:36:30 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f56.google.com ([209.85.161.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qwTZF-0006OA-S6 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 27 Oct 2023 22:36:29 +0200 Original-Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-581d755f1afsf2901259eaf.3 for ; Fri, 27 Oct 2023 13:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1698438988; x=1699043788; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=w14VNReOIWvw40qR3HYHpyEdh6xrxQeWGgYei6M2PiE=; b=OyDAQUkNlGGZkDmMmnQRLuxwZcPVLYR37A/NiVHj9zL1kv8Pbu3FUxT6fp1AeV5bHa i62muf1z3YewlsaDnuMzpH93SW2Xwve28GBOxqbA/I20gpeKzBl5fGHRcFHuYnF1rC6/ F/22ACK8rTsv+TrJ/vadKf27UM4nKNHRauCWhDCcEM1Mx+JK9hiveu5hecySrz7JjxRI 2f+e1L4seoMQSZ87pHJAo8j8HQs96moJy8qBfxJjrOSq0OBL7Pww7PVDVKBXiYb1FIPf 67KZTw9iusBBkvdHsNnpW8zd4FsrCm2IRCcJpUtJFOh076pZa05hPohjWgp0NxRSml/W EjiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698438988; x=1699043788; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=w14VNReOIWvw40qR3HYHpyEdh6xrxQeWGgYei6M2PiE=; b=dNuAK2p3swNBaHt12KNRQpPbDuFzqhpHawXWBxL3HDga3+9tnup0ZGWjZQDMbjkjNk ndul6Msre3fhtCVN+BZyc5BlyIaQbVn/g7eYXSwHO0Pbb9RyoYr+gYvgwMB2RyeP/Yp0 yig2HhaOY+GBpeD3aHiWrcX1w/qsR696NGGO4b5xVzHIkVRHG9QWclhL+HIvlyAJiUKA rVqpCErhP+GJZD4tqW09TNqm5MlvTN+c0B5evCx/lDSrLDTI8pqniN9nmH4z+jqf5x31 Y4PNQZn7ocY0MGnjWjpvP+d2ow3gQhItQ04VLzuWR1YA+Oy+uaoCQpfZNRw0v+PiVWu1 cGLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698438988; x=1699043788; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=w14VNReOIWvw40qR3HYHpyEdh6xrxQeWGgYei6M2PiE=; b=omaTIeVekc+/pXzqC7/tYqh+M2ZMAp8zRc5dR3k3qKX5mObcDjT2hdjciigGvB/erb 4Zv+gsTVZ+c7L7JhebS8T2vxZMsWuUnjiENJSw0LPdwnkN2xQ8Ogn1G9bpvgZmUAxpkf RMCWiNCaI0BazH+l0XVSIrLP/hvD7rZG6GtvgYiEAwS5DoEjuMBerGWbFZP6r2sz6cfs FtY8QMkjgg0Uo5PCl1skZ7ykazaqI4qB3iOaf37xuFyF95uSZP9j1XIjQAjWC5rC2hP5 re464jY0BBM3E3SJTNVp+IpZhwsuzqYjxmhDNepeHK0PkYaYub Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0Yz20rQeEumUafNWyua71kNaBY0mZ7u0eZ3rMCGahX7tM7RY1CQ+ TwVa75eTjZ0dUZqqjsoUdLk= X-Google-Smtp-Source: AGHT+IFSORkh/W9AlB7zYyiTEmRnd01AYYb5AjOr9kcHTwbKUwlmHYIn35bH6Epa1Px4ltRn9qBhiA== X-Received: by 2002:a05:6820:1686:b0:581:ec87:edc0 with SMTP id bc6-20020a056820168600b00581ec87edc0mr4815831oob.9.1698438988673; Fri, 27 Oct 2023 13:36:28 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:45c5:0:b0:581:d755:f05f with SMTP id y188-20020a4a45c5000000b00581d755f05fls756629ooa.2.-pod-prod-05-us; Fri, 27 Oct 2023 13:36:25 -0700 (PDT) X-Received: by 2002:a05:6808:1b24:b0:39c:a74b:81d6 with SMTP id bx36-20020a0568081b2400b0039ca74b81d6mr1212116oib.7.1698438985045; Fri, 27 Oct 2023 13:36:25 -0700 (PDT) In-Reply-To: X-Original-Sender: imuntean-Re5JQEeQqe8AvxtiuMwx3w@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:33244 Archived-At: ------=_Part_16352_1955927274.1698438984267 Content-Type: multipart/alternative; boundary="----=_Part_16353_2030419335.1698438984267" ------=_Part_16353_2030419335.1698438984267 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sandra Thanks for the question. I do have a workable code I adapted to my needs=20 and I will post it here. I plan to comment it heavily such that it can be= =20 used for different purposes. Thansk for your patience. I can send also a number of samples. My code converts everything into latex= =20 not tex. Ioan On Tuesday, August 23, 2022 at 4:56:47=E2=80=AFAM UTC-5 Sandra Martin wrote= : > Hi Ioan, I'm currently trying to do exactly the same thing: docx to tex= =20 > with BBT references (I'm using their CSL script=20 > https://gist.githubusercontent.com/01baftb/dc769574b29891263588a89c62bc24= 76/raw/67035b0efef81c8633d99e0ddbf4f493c5f79af6/better-bibtex-citekeys-modd= ed-to-use-cite-latex-command.csl).=20 > However, I'm failing with the Pandoc conversion steps since it also=20 > converts raw latex. Would you be willing to post your filter and Pandoc= =20 > command? That would be immensely helpful!=20 > Best, Sandra > > Ioan Muntean schrieb am Sonntag, 6. Juni 2021 um 03:40:13 UTC+2: > >> Dear Bastien >> Thanks! I checked your idea and it is working perfectly fine! Thanks! I= =20 >> managed to create the exact filter I need to generate the right citation= =20 >> for Bibtex from a docx file. I managed to recreate the right entries by= =20 >> using \citetext and \citeapl for complex references. >> Thanks. I can post my filter for those interested. There is still some= =20 >> major differences between the docx filter and the md conversions to late= x. >> Best >> Ioan >> >> On Friday, June 4, 2021 at 5:44:32 PM UTC-4 Bastien Dumont wrote: >> >>> Your problem doesn't have anything to do with Lua escaping rules, but= =20 >>> with Pandoc conversion of strings to LaTeX. What you tell Pandoc to do= =20 >>> is to convert a string beginning with a backslash to LaTeX, so it uses= =20 >>> (rightly) \textbackslash. Instead, what you would like to pass is raw= =20 >>> LaTeX code: to that end, use pandoc.RawInline.=20 >>> >>> Le Friday 04 June 2021 =C3=A0 10:01:53AM, Ioan Muntean a =C3=A9crit := =20 >>> > Hello all,=20 >>> >=20 >>> > I have some troubles with escaping sequence in a Lua filter. I am=20 >>> using the=20 >>> > function Str() and I simply want to generate the text "\cite" in a=20 >>> Latex output=20 >>> > .=20 >>> > This is the function:=20 >>> > return pandoc.Str([[\cite{]]..latex_citekey.."}")=20 >>> >=20 >>> > The output is: \textbackslash cite\{=20 >>> > How do I escape the converter if I want to get an output like "\cite"= ?=20 >>> I think=20 >>> > it has something to do with inline characters, but I do not know how= =20 >>> to use=20 >>> > them.=20 >>> >=20 >>> > Here is the bigger picture:=20 >>> >=20 >>> > I am trying to convert with Pandoc DOCX files to Latex. I use Zotero= =20 >>> references=20 >>> > and a Better than Bibtex style in docx to create references for=20 >>> pandoc.=20 >>> > The --citedoc --natlib --bibliography=3D<.bib file> options works wit= h=20 >>> single=20 >>> > reference in DOCX=20 >>> > The entry: [@parker2009computinguncomputablediscrete]=20 >>> > is converted to \cite{parker2009computinguncomputablediscrete}=20 >>> >=20 >>> > [@cartwright2006wellorderedscience; @cichy2019deepneuralnetworks;=20 >>> > @parker2009computinguncomputablediscrete]=20 >>> >=20 >>> > is not converted but kept exactly like that in the Latex file. But th= e=20 >>> Docx=20 >>> > conversion does not work for multiple references or for prefixes or= =20 >>> suffixes of=20 >>> > citations. But the same pandoc command for a markdown input works=20 >>> fine. I=20 >>> > suspect there is some difference on how the docx and markdown=20 >>> converter works.=20 >>> >=20 >>> >=20 >>> > I am currently almost done with writing a Lua filter and the intentio= n=20 >>> is to=20 >>> > generate the correct output=20 >>> >=20 >>> > \cite{cartwright2006wellorderedscience, cichy2019deepneuralnetworks,= =20 >>> > parker2009computinguncomputablediscrete}=20 >>> >=20 >>> > Thanks in advance!=20 >>> >=20 >>> > Ioan=20 >>> >=20 >>> >=20 >>> >=20 >>> > --=20 >>> > You received this message because you are subscribed to the Google=20 >>> Groups=20 >>> > "pandoc-discuss" group.=20 >>> > To unsubscribe from this group and stop receiving emails from it, sen= d=20 >>> an email=20 >>> > to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >>> > To view this discussion on the web visit=20 >>> https://groups.google.com/d/msgid/=20 >>> > pandoc-discuss/3e06a866-8075-4031-886e-8c45cc4ab8bdn% >>> 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/fe97c8d4-be89-4dad-94f1-6de3de0e08d5n%40googlegroups.com. ------=_Part_16353_2030419335.1698438984267 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sandra
Thanks for the question. I do have a workable code I adapted = to my needs and I will post it here. I plan to comment it heavily such that= it can be used for different purposes.
Thansk for your patience.=
I can send also a number of samples. My code converts everything= into latex not tex.
Ioan

On Tuesday, August 23, 2022 at = 4:56:47=E2=80=AFAM UTC-5 Sandra Martin wrote:
Hi Ioan, I'm currently trying t= o do exactly the same thing: docx to tex with BBT references (I'm using= their CSL script https://gist.github= usercontent.com/01baftb/dc769574b29891263588a89c62bc2476/raw/67035b0efef81c= 8633d99e0ddbf4f493c5f79af6/better-bibtex-citekeys-modded-to-use-cite-latex-= command.csl). However, I'm failing with the Pandoc conversion steps= since it also converts raw latex. Would you be willing to post your filter= and Pandoc command? That would be immensely helpful!
Best, = Sandra

Ioan Muntean schrieb am Sonntag, 6. Juni 2021 um 03:40:13 UTC+2:=
Dear Bastien
Than= ks! I checked your idea and it is working perfectly fine! Thanks! I managed= to create the exact filter I need to generate the right citation for Bibte= x from a docx file. I managed to recreate the right entries by using \citet= ext and \citeapl for complex references.
Thanks. I can post my fi= lter for those interested. There is still some major differences between th= e docx filter and the md conversions to latex.
Best
Ioa= n

On Friday, June 4, 2021 at 5:44:32 PM UTC-4 Bastien Dumont wrote:
=
Your problem doesn't = have anything to do with Lua escaping rules, but
with Pandoc conversion of strings to LaTeX. What you tell Pandoc to do
is to convert a string beginning with a backslash to LaTeX, so it uses
(rightly) \textbackslash. Instead, what you would like to pass is raw
LaTeX code: to that end, use pandoc.RawInline.

Le Friday 04 June 2021 =C3=A0 10:01:53AM, Ioan Muntean a =C3=A9crit :
> Hello all,
>=20
> I have some troubles with escaping sequence in a Lua filter. I am = using the
> function Str() and I simply want to generate the text "\cite&= quot; in a Latex output
> .=20
> This is the function:
> return pandoc.Str([[\cite{]]..latex_citekey.."}")
>=20
> The output is: \textbackslash cite\{
> How do I escape the converter if I want to get an output like &quo= t;\cite"? I think
> it has something to do with inline characters, but I do not know h= ow to use
> them.
>=20
> Here is the bigger picture:=20
>=20
> I am trying to convert with Pandoc DOCX files to Latex. I use Zote= ro references
> and a Better than Bibtex style in docx to create references for pa= ndoc.
> The --citedoc --natlib --bibliography=3D<.bib file> options = works with single
> reference in DOCX=20
> The entry: [@parker2009computinguncomputablediscrete]
> is converted to \cite{parker2009computinguncomputablediscrete}
>=20
> [@cartwright2006wellorderedscience; @cichy2019deepneuralnetworks;
> @parker2009computinguncomputablediscrete]
>=20
> is not converted but kept exactly like that in the Latex file. But= the Docx
> conversion does not work for multiple references or for prefixes o= r suffixes of
> citations. But the same pandoc command for a markdown input works = fine. I
> suspect there is some difference on how the docx and markdown conv= erter works.
>=20
>=20
> I am currently almost done with writing a Lua filter and the inten= tion is to
> generate the correct output
>=20
> \cite{cartwright2006wellorderedscience, cichy2019deepneuralnetwork= s,
> parker2009computinguncomputablediscrete}
>=20
> Thanks in advance!
>=20
> Ioan
>=20
>=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 email
> to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/
> pandoc-discuss/3e06a866-8075-4031-886e-8c45cc4ab8bdn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/fe97c8d4-be89-4dad-94f1-6de3de0e08d5n%40googlegroups.= com.
------=_Part_16353_2030419335.1698438984267-- ------=_Part_16352_1955927274.1698438984267--