From: Ioan Muntean <imuntean-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
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) [thread overview]
Message-ID: <fe97c8d4-be89-4dad-94f1-6de3de0e08d5n@googlegroups.com> (raw)
In-Reply-To: <bdaeff69-16cc-4498-b678-84b6e19f0454n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4785 bytes --]
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 AM UTC-5 Sandra Martin wrote:
> Hi Ioan, I'm currently trying to do exactly the same thing: docx to tex
> with BBT references (I'm using their CSL script
> https://gist.githubusercontent.com/01baftb/dc769574b29891263588a89c62bc2476/raw/67035b0efef81c8633d99e0ddbf4f493c5f79af6/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
>> Thanks! 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 Bibtex from a docx file. I managed to recreate the right entries by
>> using \citetext and \citeapl for complex references.
>> Thanks. I can post my filter for those interested. There is still some
>> major differences between the docx filter and the md conversions to latex.
>> 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
>>> 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 à 10:01:53AM, Ioan Muntean a écrit :
>>> > Hello all,
>>> >
>>> > 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" in a
>>> Latex output
>>> > .
>>> > This is the function:
>>> > return pandoc.Str([[\cite{]]..latex_citekey.."}")
>>> >
>>> > The output is: \textbackslash cite\{
>>> > How do I escape the converter if I want to get an output like "\cite"?
>>> I think
>>> > it has something to do with inline characters, but I do not know how
>>> to use
>>> > them.
>>> >
>>> > Here is the bigger picture:
>>> >
>>> > I am trying to convert with Pandoc DOCX files to Latex. I use Zotero
>>> references
>>> > and a Better than Bibtex style in docx to create references for
>>> pandoc.
>>> > The --citedoc --natlib --bibliography=<.bib file> options works with
>>> single
>>> > reference in DOCX
>>> > The entry: [@parker2009computinguncomputablediscrete]
>>> > is converted to \cite{parker2009computinguncomputablediscrete}
>>> >
>>> > [@cartwright2006wellorderedscience; @cichy2019deepneuralnetworks;
>>> > @parker2009computinguncomputablediscrete]
>>> >
>>> > 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 or
>>> 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
>>> converter works.
>>> >
>>> >
>>> > I am currently almost done with writing a Lua filter and the intention
>>> is to
>>> > generate the correct output
>>> >
>>> > \cite{cartwright2006wellorderedscience, cichy2019deepneuralnetworks,
>>> > parker2009computinguncomputablediscrete}
>>> >
>>> > Thanks in advance!
>>> >
>>> > Ioan
>>> >
>>> >
>>> >
>>> > --
>>> > 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/3e06a866-8075-4031-886e-8c45cc4ab8bdn%
>>> 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/fe97c8d4-be89-4dad-94f1-6de3de0e08d5n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 6840 bytes --]
prev parent reply other threads:[~2023-10-27 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 17:01 Ioan Muntean
[not found] ` <3e06a866-8075-4031-886e-8c45cc4ab8bdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-06-04 21:43 ` Bastien DUMONT
2021-06-06 1:40 ` Ioan Muntean
[not found] ` <805aa20b-322e-4420-9f4c-33b5c9adf109n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-08-23 9:56 ` Sandra Martin
[not found] ` <bdaeff69-16cc-4498-b678-84b6e19f0454n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-10-27 20:36 ` Ioan Muntean [this message]
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=fe97c8d4-be89-4dad-94f1-6de3de0e08d5n@googlegroups.com \
--to=imuntean-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).