public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Frank Wisniewski <infokaminbausatz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Convert Plain Element to Latex Code in LUA Filter
Date: Tue, 31 Jan 2023 23:12:02 -0800 (PST)	[thread overview]
Message-ID: <9c6c56a7-4b45-4d8f-8152-c85822932b6cn@googlegroups.com> (raw)
In-Reply-To: <Y9kgd69R5X9ac7Mc@localhost>


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

I don't want to use longtabular, so I need to translate the table element 
to plain latex to create a PDF.

Examples:

Before Filter
[CODE]
\begin{longtable}[]{@{}ll@{}}
\caption{\textbf{Adress}}\tabularnewline
\toprule\noalign{}
\textbf{Name} & \textbf{City} \\
\midrule\noalign{}
\endfirsthead
\toprule\noalign{}
\textbf{Name} & \textbf{City} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
NameOne & Bonn \\
NameTwo & Munich \\
NameThre & Cologne \\
\end{longtable}
[/CODE]

After LUA Filter
[CODE]
\begin{longtblr}[
  theme=captionlinksbuendig,
  caption = \textbf{Adress},
]{
colspec = {X[l]X[l]},
width = 1\linewidth,
rowhead = 1,
rowfoot = 0,
row{odd} = {shadecolor},
row{1} = {white},
}
\hline 
\textbf{Name} & \textbf{City}\\
\hline 
NameOne & Bonn\\
NameTwo & Munich\\
NameThre & Cologne\\
\hline
\end{longtblr}
[/CODE]

The captions are passed as inline elements which I have to convert to the 
appropriate latex format.

EXAMPLE

[CODE]
Plain [Strong [Emph [Str "A"]],Str "dre",Emph [Str "ssen"]]
[/CODE]

must be convert to the Plain latex Code

[CODE]
\textbf{\emph{A....
[/CODE]

Bastien Dumont schrieb am Dienstag, 31. Januar 2023 um 15:06:56 UTC+1:

> Doesn't Pandoc do the conversion? What do you want, what do you do and 
> what do you get?
>
> Le Tuesday 31 January 2023 à 04:51:01AM, Frank Wisniewski a écrit :
> > I have the following Plain Element fron caption
> > Plain [Strong [Emph [Str "A"]],Str "dre",Emph [Str "ssen"],Space,Str
> > "Sa",Strong [Str "mm"],Str "lung"]
> > i would convert this to Latex Code:
> > '{\textbf{\emph{A}}dre\emph{ssen}'
> > 
> > Is there a function for this?
> > 
> > --
> > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [2]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/76501da2-0d17-4aaa-9dfd-c236abd93de8n%40googlegroups.com.
> > 
> > References:
> > 
> > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [2] 
> https://groups.google.com/d/msgid/pandoc-discuss/76501da2-0d17-4aaa-9dfd-c236abd93de8n%40googlegroups.com?utm_medium=email&utm_source=footer
>
>

-- 
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/9c6c56a7-4b45-4d8f-8152-c85822932b6cn%40googlegroups.com.

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

      reply	other threads:[~2023-02-01  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 12:51 Frank Wisniewski
     [not found] ` <76501da2-0d17-4aaa-9dfd-c236abd93de8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-31 14:06   ` Bastien DUMONT
2023-02-01  7:12     ` Frank Wisniewski [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=9c6c56a7-4b45-4d8f-8152-c85822932b6cn@googlegroups.com \
    --to=infokaminbausatz-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).