public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Sandra Martin <sandrushba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Help with lua filter for docx to latex conversion
Date: Fri, 26 Aug 2022 10:08:50 -0700 (PDT)	[thread overview]
Message-ID: <0df70b72-8e13-4e1c-986f-6a54ef352f6cn@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 1777 bytes --]

             reply	other threads:[~2022-08-26 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 17:08 Sandra Martin [this message]
     [not found] ` <0df70b72-8e13-4e1c-986f-6a54ef352f6cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-08-26 17:40   ` Bastien DUMONT
2022-08-26 19:23     ` Sandra Martin
     [not found]       ` <7fc77e34-86e4-48a2-8642-e226d1ae08ben-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-08-26 20:09         ` Albert Krewinkel
     [not found]           ` <36B1ABBF-804C-4785-BB14-E29AEE6423E4-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-08-26 21:37             ` Bastien DUMONT
2022-08-27  8:49               ` Sandra Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0df70b72-8e13-4e1c-986f-6a54ef352f6cn@googlegroups.com \
    --to=sandrushba-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).