From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31294 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sandra Martin Newsgroups: gmane.text.pandoc Subject: Help with lua filter for docx to latex conversion Date: Fri, 26 Aug 2022 10:08:50 -0700 (PDT) Message-ID: <0df70b72-8e13-4e1c-986f-6a54ef352f6cn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1052_1972942754.1661533730083" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14053"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDPIH34NR4EBBI74UOMAMGQEH33ZL6I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 26 19:08:54 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qv1-f55.google.com ([209.85.219.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oRcpC-0003V0-4q for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 26 Aug 2022 19:08:54 +0200 Original-Received: by mail-qv1-f55.google.com with SMTP id o6-20020ad443c6000000b00495d04028a6sf1352537qvs.18 for ; Fri, 26 Aug 2022 10:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc; bh=oV8DOHlcDVYFZxGlBZumXmlaR8SB+qCwo49LzuPlUQo=; b=qSFNhVVh5zlq/KK/pO+Ixo449e2o8wQswAoaiaW334ATc6YNoZzgu5nDvbFopwh6wJ uqKAe2xKcbp2W51Nz73oP0yI8wldR+LbHAl2DlG0QYu5pOdWpul92CQwUvd81OY0BE7m RdPqlSbHDPzF3OJ2t+C3H1RgdvaLilGdnGVb8/DegcCleYiFk5l4tGPJUO0H7/hAXGbk ViUpjtuPyKgo2CdgS0aZ7TNB6oN2PHSl08FxHuBsCGxU5MLWdkrYNPmUxEhWggiJpaw9 +yVHwjZsMq7qYB8PQiNlzX62LOKEuxB9HFNEM5SUBFuVgxTfMcY/VLfR7PzTp2OA6BZe QLlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc; bh=oV8DOHlcDVYFZxGlBZumXmlaR8SB+qCwo49LzuPlUQo=; b=DHkAr5rIRIK+Su9+0Lw/yV0LRek0qaXppeV+vltEY1yTF+dAyffTiPf/AL5FlWcLn/ WV5DoNIjBA94FQohH/XrrJ2g8Bt7qRfRhTBjunOWCZnIv0hdYRVVm+n65lvM4qi91l82 1mFqK+TqPHiEsgnKwru4i1Gi/QpSNwdMr3VgcWM8Rf4pwvIi7/8lobP0ecpkj7s6hpYX 5Eo4AFh3UQJYhwsXWKxrKVUX5sTTGQ6DQXFsngfmCCqpcxa3mgX7jEbXgP9aTju9esfx Xxi37+TFLDOpj09tOPKajoe4MOL11KNvvjPjIUWO0bfFC80FTC+41pt7dJlRlAss9I31 0IFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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:message-id:to:from:date :x-gm-message-state:sender:from:to:cc; bh=oV8DOHlcDVYFZxGlBZumXmlaR8SB+qCwo49LzuPlUQo=; b=y6Ut82vDN/UKBPFPBEBWN8PW0nuAls8QiOoOvQMkINHWnepViVwcQ6q+r4O6Jaau9N py/LCmicq4yDOUfk3rHzgRF78SpRxSYjzK/P5oJ9p+zHelaMfIFJ4lGYafnFk/csUm1f K12eoG/+UTH1JUK08XRBRfXd7dZhlq2CydVbQQKu9SDgIhtSZ4txheo+fzUbQKEkVMfy xYm+aemN3hV4+ZY82R4v2Coc6psOjx5cfJB6s1nc/I5z6MpyBdCOfrOY3gQT2YQIPz8S DDpORHNsrsWkY+rim3GseHVrV+9TNnhLbAwH+GY4dottLvc0F53yR8hb9hG5QtJyRRwD AUcQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACgBeo20wyhcGZZ/57Bxo3A/ZpE2xHq8mDdRrpboxF4cGV2TLbfyKOdQ v0kLP+KCn/FSs2LobEygJIo= X-Google-Smtp-Source: AA6agR5rrwXGjZt2+LutZ422v91tuMHEVJ/gfET6nmFd7T9Ro2i7qL30Vu8PwliZHS/Ecmj0hqKXHg== X-Received: by 2002:ac8:5fd6:0:b0:343:4b4:1022 with SMTP id k22-20020ac85fd6000000b0034304b41022mr616733qta.616.1661533733147; Fri, 26 Aug 2022 10:08:53 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:620a:1666:b0:6ba:e67e:7dbd with SMTP id d6-20020a05620a166600b006bae67e7dbdls200583qko.11.-pod-prod-gmail; Fri, 26 Aug 2022 10:08:50 -0700 (PDT) X-Received: by 2002:a05:620a:2b98:b0:6bb:11fc:40b7 with SMTP id dz24-20020a05620a2b9800b006bb11fc40b7mr502481qkb.467.1661533730619; Fri, 26 Aug 2022 10:08:50 -0700 (PDT) X-Original-Sender: sandrushba-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:31294 Archived-At: ------=_Part_1052_1972942754.1661533730083 Content-Type: multipart/alternative; boundary="----=_Part_1053_403319542.1661533730083" ------=_Part_1053_403319542.1661533730083 Content-Type: text/plain; charset="UTF-8" Hello all, I have trouble writing the correct lua filter for my pandoc conversion of docx to latex. In short, I have citations in the format "\cite{reference}" (csl style from Better Bibtex) in my docx file, which I would like to preserve and keep unchanged during pandoc conversion. When calling "pandoc --to=native test.docx", I see that pandoc reads these entries as strings and I've tried writing filters with pandoc.RawInline to preserve these strings. However, using for instance this function keeps the reference keys but gets rid of all the latex formatting (the backslash and the curly brackets): function Str(el) local citekey = el.text:match("\\cite[{](%w+)[}]") if citekey then return pandoc.RawInline('latex', citekey) end end How do I keep my latex-styled reference strings as they are during pandoc conversion? Thanks in advance! Sandra -- 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/0df70b72-8e13-4e1c-986f-6a54ef352f6cn%40googlegroups.com. ------=_Part_1053_403319542.1661533730083 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello all,

I have trouble writing the co= rrect lua filter for my pandoc conversion of docx to latex.
=
In short, I have citations in the format "\cite{reference}" = (csl style from Better Bibtex) in my docx file, which I would like to prese= rve and keep unchanged during pandoc conversion.

W= hen calling "pandoc --to=3Dnative test.docx", I see that pandoc reads these= entries as strings and I've tried writing filters with pandoc.RawInline to= preserve these strings. However, using for instance this function keeps th= e reference keys but gets rid of all the latex formatting (the backslash an= d the curly brackets):
function Str(el)
  local citek= ey =3D el.text:match("\\cite[{](%w+)[}]")
  if citekey then
&nbs= p;   return pandoc.RawInline('latex', citekey)
  end
end

How do I keep my latex-styled reference strings as t= hey are during pandoc conversion?

Thanks in a= dvance!
Sandra

--
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/0df70b72-8e13-4e1c-986f-6a54ef352f6cn%40googlegroups.= com.
------=_Part_1053_403319542.1661533730083-- ------=_Part_1052_1972942754.1661533730083--