From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33501 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'lukeflo' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to change macro for figure caption md -> latex Date: Mon, 11 Dec 2023 02:33:21 -0800 (PST) Message-ID: References: <51ca8210-3d60-4d5d-9af2-04c85995deb6n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_37522_929693034.1702290801474" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25701"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD7NXUVXXUBBB46K3OVQMGQEMK54N3I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Dec 11 11:33:27 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f57.google.com ([209.85.161.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1rCdbL-0006QQ-1n for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 11 Dec 2023 11:33:27 +0100 Original-Received: by mail-oo1-f57.google.com with SMTP id 006d021491bc7-59070f0f0b5sf4922616eaf.2 for ; Mon, 11 Dec 2023 02:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1702290806; x=1702895606; 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=MyVgse0h9t+MKl6G9xHUatwJG2jlXBlZWAOC4g36lg8=; b=AKyU9Bw7qg/3R6Y3sPE6wHvkgVy2IhwGtaLp+gEeHU8F6wzWRtSBMhtLWv1IkEcEtk +xX0+MxxjNlIXku55ZqjzjWXo7woJfWMoO4qRDbLb7KcUE3cgazWXb0mAlADbD/W6kHk 5YFSK3Vk1usu35SRup8bb9CT0zE25lPAtEzlW6sRMpgHqjGlE+hEbiJQ6cAvo9JSlA5k 3z5Fq6rzIXo+qAM8RDXK6KpGKNTdM0mKQxK4E+U+NVWN9VCpdgdKEzMNsWObo8R/58BC rtgjTZ8vQJrTwdfwGrRxey1bYdFIzL4mfK3F9vnBM85n3DKksfseYWnZo/qTwqHQhoVB LShw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702290806; x=1702895606; 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:from:to:cc :subject:date:message-id:reply-to; bh=MyVgse0h9t+MKl6G9xHUatwJG2jlXBlZWAOC4g36lg8=; b=PxMRtAewSch2ScrBzPrbv67ofZLZU5xhyWgbskZ8bORRLtZIuhqsc9cmid+BN8Kz44 NJCEl6EqpTxxbMzqOEjDvGElmHYePI9E3mwN2Yc4qDjYWgUsdPyx8uFRFIJK7gXaTKvx OhotvcqPEqzytWLhiHgLrWs8NaW0qMntAF1UzWIAh0qAW5lx5PqNWI/wXI5lv6dDgPFw JnmGkEBmWMDZ+utpfUnWacNLyBf5ldclYPVWtng8zTVPBliD5QTmBUVuv1FNxQy92D/O CDqcdRhTiFV1QPxDbCl+Xqr7AMUn/ta5H2nNQDvcLWDLpVfwiyfdVxw/1 X-Gm-Message-State: AOJu0Yyghm/PDIzlJfR2cHFXNSrtJWM638Frfj/sQs3IvXkQT/S0ZzXg QtupH0r372QS6NAIb2zharg= X-Google-Smtp-Source: AGHT+IGWD8c/z2Kno+LcNVnUQJ5p5ALpe7Uicp/4+TnQMLWLJIP06K7ZIkYg9aQJU9BUUm0mpI5W2w== X-Received: by 2002:a4a:604:0:b0:58e:2815:6156 with SMTP id 4-20020a4a0604000000b0058e28156156mr1494549ooj.1.1702290805928; Mon, 11 Dec 2023 02:33:25 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6820:2224:b0:589:f90a:968d with SMTP id cj36-20020a056820222400b00589f90a968dls21684oob.2.-pod-prod-04-us; Mon, 11 Dec 2023 02:33:22 -0800 (PST) X-Received: by 2002:a05:6830:43a8:b0:6da:1910:4d13 with SMTP id s40-20020a05683043a800b006da19104d13mr1061260otv.2.1702290802301; Mon, 11 Dec 2023 02:33:22 -0800 (PST) In-Reply-To: X-Original-Sender: k.flo.west-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org X-Original-From: lukeflo 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:33501 Archived-At: ------=_Part_37522_929693034.1702290801474 Content-Type: multipart/alternative; boundary="----=_Part_37523_814185933.1702290801474" ------=_Part_37523_814185933.1702290801474 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable So far, I took the markdwon writer example from the pandoc docs=20 = =20 to try out the general function of writers. It works and I think that I=20 understand the general usage. But especially figures (in latex writer and presuambley in general) are=20 relativley complex. Here are two things I tried out so far but always got= =20 an error: ``` lua function Writer (doc, opts) local filter =3D { function Figure (caption, image, attr) local figcap =3D '\sidecaption{' .. caption .. '}' return '\\begin{figure}\n' .. image .. '\n' .. figcap .. '\n'=20 '\\end{figure}\n' end } return pandoc.write(doc:walk(filter), 'latex', opts) end ``` If I run this writer with my custom template from the CLI using *pandoc=20 --template=3D../custom.template -t test-writer.lua ast-test.txt -o=20 ast-test.tex* I get=20 *Error running Lua:test-writer.lua:27: '(' expected near 'Figure'*. Furthermore, I tried running the following code just to understand how=20 those writer work. Here I just wanted to replace {figure} with the starred= =20 version {figure*} (not sidecaption): ``` lua function Writer (doc, opts) local filter =3D { Figure =3D function (fig) local tester =3D '\\begin{figure*}\n' ..=20 fig.content[1].caption[1].attributes[1] .. '\\end{figure*}\n' return pandoc.RawBlock('latex', tester) end } return pandoc.write(doc:walk(filter), 'latex', opts) end ``` But also got an error: *Error running Lua:test-writer.lua:28: attempt to index a nil value (field= =20 'caption')stack traceback: [C]: in ? [C]: in method 'walk'=20 test-writer.lua:32: in function 'Writer'stack traceback:=20 test-writer.lua:32: in function 'Writer'* I'm aware that I might be missing something very basic and maybe even very= =20 simple. But I'm kind of getting lost a little bit inside all functions,=20 modules etc. as well as the general framework of such writers. Thus, any help explaining my errors and maybe suggesting some better code= =20 is very appreciated! The test file in both cases is very simple: ``` markdown --- title: A title --- # Headline Some text ![caption to an image](counter_plot_new_periods.png) ``` Thanks in advance! lukeflo schrieb am Freitag, 8. Dezember 2023 um 08:35:48 UTC+1: > Hello Julien, > > thanks for the reply. Unfortunatley, as mentioned in the stackoverflow=20 > post, your suggested LaTeX code won't work. > > The \caption macro is very complex in the backend and cannot be copied on= =20 > the fly via \let, \NewCommandCopy or something similar. Even after doing= =20 > so with e.g. \NewCommandCopy{\oldcaption}{\caption} and then setting \Ren= ewDocumentCommand{\caption}{o=20 > m}{\sidecaption[#1]{#2}} nothing changes and the definition of \caption,= =20 > checked with \meaning or something similar, stays the same as before=20 > (even \DeclareDocumentCommand doesn't work). > > In the end, it might be possible to somehow change the \caption macro=20 > itself. But the effort might not be worth the result (and its more of a= =20 > question for TeX.SE). > > Using a custom writer for building Latex figures and replace the \caption= =20 > string inside would be a great solution. I read through the writer manual= ,=20 > but didn't really understand how the AST works and which values have to b= e=20 > used in such a writer. Furthermore, I'm using a a custom Latex template f= or=20 > exporting (based on the default.template.latex) which has to be integrate= d=20 > with such a writer. > > Therefore, I really woud appreciate a Lua framework to understand which= =20 > functions have to be edited etc. to accomplish the substitution. > > Best > > Julien Dutant schrieb am Dienstag, 5. Dezember 2023 um 17:09:19 UTC+1: > >> Lua filters only change Pandoc's AST representation of your document,=20 >> i.e. before it is then converted to LaTeX. A Raw block filter will not a= ct=20 >> on Pandoc's LaTeX output, but only on Raw LaTeX blocks that are in the= =20 >> markdown itself. >> >> A Pandoc solution would be to write a custom Lua *writer*=20 >> . The writer would use=20 >> pandoc.write to generate Pandoc's own LaTeX output (body only) and modif= y=20 >> it with regular expressions or Lua patterns. To replace just a command n= ame=20 >> this is fairly easy, though longer than the third solution below. >> >> A LaTeX solution is to redefine \caption as \sidecaption: >> \renewcommand{\caption}{\sidecaption}=20 >> >> You can keep this enclosed in groups ({...}) to ensure that the=20 >> redefinition only applies locally. >> >> A hybrid Pandoc/LaTeX solution is a Lua filter that insert LaTeX code to= =20 >> redefine \caption around figures: >> >> ``` lua >> if FORMAT:match 'latex' then >> function Figure (elem) return {=20 >> pandoc.RawBlock('latex', >> '{\\renewcommand{\\caption}{\\subcaption}'),=20 >> elem,=20 >> pandoc.RawBlock('latex','}')=20 >> }=20 >> end=20 >> end >> >> ``` >> >> This replaces any 'Figure' block element by a list (succession) of three= =20 >> raw LaTeX blocks. The output should look like: >> {\renewcommand{\caption}{\subcaption}=20 >> ... Pandoc's LaTeX for the figure ...=20 >> }=20 >> >> Reposted from=20 >> https://stackoverflow.com/questions/77504584/pandoc-md-latex-write-lua-f= ilter-to-change-latex-macro-used-for-caption/77607636#77607636 >> >> On Monday, November 20, 2023 at 7:06:57=E2=80=AFAM UTC+11 lukeflo wrote: >> >>> Hi everybody, >>> >>> I have written a custom latex `.cls' file to establish a typesetting >>> workflow for the scientific journals of my research institute. The text= s >>> should be written in Markdown and then be processed with `pandoc' to >>> LaTeX. >>> >>> I already have an elaborated pandoc template to produce the LaTeX >>> preambel etc. So far its working great. >>> >>> But for the figures I need the caption from the Markdown file to be set >>> with `\sidecaption' instead of `\caption' in LaTeX, as well as with an >>> optional argument (short-caption) for the image attribution in the list >>> of figures. >>> >>> To get the latter working I use the following template from a GitHub >>> discussion in the [pandoc repo]: >>> >>> =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 >>> =E2=94=82 PANDOC_VERSION:must_be_at_least '3.1' >>> =E2=94=82 >>> =E2=94=82 if FORMAT:match 'latex' then >>> =E2=94=82 function Figure(f) >>> =E2=94=82 local short =3D f.content[1].content[1].attributes['short= -caption'] >>> =E2=94=82 if short and not f.caption.short then >>> =E2=94=82 f.caption.short =3D pandoc.Inlines(short) >>> =E2=94=82 end >>> =E2=94=82 return f >>> =E2=94=82 end >>> =E2=94=82 end >>> =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 >>> >>> That works without any flaws. >>> >>> But now I need to figure out how to change the LaTeX macro used for the >>> caption. The older [approach of pre pandoc version 3.0 posted] by tarle= b >>> is really intuitive and I could have easily adapted it to my needs. But >>> since pandoc 3.0 there is the new [/complex figures/] approach and, so >>> far, I couldn't figure out how to change the LaTeX macro used for the >>> captions with this new behaviour. >>> >>> I tried something like that (Adapted from [here]: >>> >>> =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 >>> =E2=94=82 if FORMAT:match 'latex' then >>> =E2=94=82 function RawBlock (raw) >>> =E2=94=82 local caption =3D raw.text:match('\\caption') >>> =E2=94=82 if caption then >>> =E2=94=82 raw:gsub('\\caption', '\\sidecaption') >>> =E2=94=82 end >>> =E2=94=82 return raw >>> =E2=94=82 end >>> =E2=94=82 end >>> =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 >>> >>> But nothing happened. >>> >>> The main challenge for me are my more-or-less non-existing lua skills. = I >>> just never had to use it for my daily tasks. I thought about using `awk= ' >>> or `sed' to edit the `.tex' file itself using a regex-substitution, but >>> that should remain an absolute stopgap, since it makes the whole >>> workflow less portable. >>> >>> Thus, I'm hoping for a hint/a solution in form of a pandoc-lua script >>> which 1. helps me to achieve the goal, and 2. improve my understanding >>> of lua and the /complex figures/ approach for similar future tasks. >>> >>> I appreciate any tipp! >>> >>> Best, >>> Lukeflo >>> >>> This question is also posted on StackOverFlow:=20 >>> https://stackoverflow.com/q/77504584/19647155 >>> >>> [pandoc repo] >>> >>> >>> [approach of pre pandoc version 3.0 posted] >>> >>> >>> [/complex figures/] >>> >>> [here] >>> >> --=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/b419ae83-de83-4035-97cd-fb41cb6be647n%40googlegroups.com. ------=_Part_37523_814185933.1702290801474 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
So far, I took the markdwon writer example from the pandoc do= cs to try out the general function of writers. It works and I think tha= t I understand the general usage.

But especially= figures (in latex writer and presuambley in general) are relativley comple= x. Here are two things I tried out so far but always got an error:

``` lua
function Writer (doc, opts)
=C2=A0 =C2=A0local filter =3D {
=C2=A0 =C2=A0 =C2=A0 function Figure = (caption, image, attr)
=C2= =A0local figcap =3D '\sidecaption{' .. caption .. '}'
=C2=A0return '\\begin{figure}\n' .. image .. '\n'= .. figcap .. '\n' '\\end{figure}\n'
=C2=A0 =C2=A0 =C2=A0 end
=C2= =A0 =C2=A0}
=C2=A0 =C2=A0return pandoc.write(doc:walk(filter), 'latex'= , opts)
end
```
If I run this writer with my= custom template from the CLI using=C2=A0pandoc --template=3D../custom.t= emplate -t test-writer.lua ast-test.txt -o ast-test.tex I get Error = running Lua:
test-writer.lua:27: '(' expected near 'Figure'
.
=

Furthermore, I tried running the following code just = to understand how those writer work. Here I just wanted to replace {figure}= with the starred version {figure*} (not sidecaption):

``` lua
function Writer (doc, opts)
=C2=A0 local filt= er =3D {
=C2=A0 =C2=A0 =C2=A0Figure =3D function (fig)
local tester =3D '\\begin{figure*}\n' .. fi= g.content[1].caption[1].attributes[1] .. '\\end{figure*}\n'
return pandoc.RawBlock('latex', tester)
=C2=A0 =C2=A0 end
=C2=A0 }
=C2=A0 return pandoc.write(doc:walk(= filter), 'latex', opts)
end
```
But also got an er= ror:

Error running Lua:
test-writer.lua:= 28: attempt to index a nil value (field 'caption')
stack traceback: [C]: in ?
[C]: in method 'walk'
test-writer.lua:32: in function 'Writer'
stack tr= aceback:
test-writer.lua:32:= in function 'Writer'

I'm aware that I might= be missing something very basic and maybe even very simple. But I'm kind o= f getting lost a little bit inside all functions, modules etc. as well as t= he general framework of such writers.

Thus, any = help explaining my errors and maybe suggesting some better code is very app= reciated!

The test file in both cases is very si= mple:

``` markdown
---
titl= e: A title
---

# Headline

Some text

!= [caption to an image](counter_plot_new_periods.png)
```

Thanks in advance!
lukeflo schrieb am Freitag, 8.= Dezember 2023 um 08:35:48 UTC+1:
Hello Julien,

thanks for= the reply. Unfortunatley, as mentioned in the stackoverflow post, your sug= gested LaTeX code won't work.

The \capti= on macro is very complex in the backend and cannot be copied on the = fly via \let, \NewCommandCopy or something simila= r. Even after doing so with e.g. \NewCommandCopy{\oldcaption}{\captio= n} and then setting \RenewDocumentCommand{\caption}{o m}{\side= caption[#1]{#2}} nothing changes and the definition of \captio= n, checked with \meaning or something similar, stays th= e same as before (even \DeclareDocumentCommand doesn't wor= k).

In the end, it might be possible to somehow change the \caption macro itself. But the effort might not be worth the result (and its mo= re of a question for TeX.SE).

Using a custom writer for building Latex figures and replace the \captio= n string inside would be a great solution. I read through the writer manual= , but didn't really understand how the AST works and which values have = to be used in such a writer. Furthermore, I'm using a a custom Latex te= mplate for exporting (based on the default.template.latex) which has to be = integrated with such a writer.

Therefore, I really woud appreciate a = Lua framework to understand which functions have to be edited etc. to accom= plish the substitution.

Best


Julien Dutant schrieb am Diensta= g, 5. Dezember 2023 um 17:09:19 UTC+1:

Lua filters only change Pandoc's AST representation of your document= , i.e. before it is then converted to LaTeX. A Raw block filter will not=20 act on Pandoc's LaTeX output, but only on Raw LaTeX blocks that are in= =20 the markdown itself.

A Pandoc solution would be to write a custom Lua writer. The writer would use pandoc.write to generate Pandoc's own LaTeX outpu= t (body only) and modify it with regular expressions or Lua patterns. To=20 replace just a command name this is fairly easy, though longer than the=20 third solution below.

A LaTeX solution is to redefine \caption as \sidecaption:

\renewcommand{\caption}{\sidecaption}

You can keep this enclosed in groups ({...}) to ensure that the redefini= tion only applies locally.

A hybrid Pandoc/LaTeX solution is a Lua filter that insert LaTeX code to= redefine \caption around figures:

``` lua

if FORMAT:match 'latex'= then
= =C2=A0=C2=A0=C2=A0 function Figure (e= lem) return {=C2=A0
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pandoc.RawBlock('latex= 9;,'{\\renewcommand{\\caption}{\\subcaption}'),= =C2=A0
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 elem,=C2=A0
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pandoc.RawBlock('latex= ','}')=C2=A0
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
<= span>=C2=A0=C2=A0 end
end

```

This replaces any 'Figure' block element by a list (succession) = of three raw LaTeX blocks. The output should look like:

{\renewcommand{\caption}{\subcaption}=C2=A0
=
... Pandoc's LaTeX for the figure ...=C2=A0
}


On Monday, November= 20, 2023 at 7:06:57=E2=80=AFAM UTC+11 lukeflo wrote:
Hi everybody,

I have written a custo= m latex `.cls' file to establish a typesetting
workflow for the scie= ntific journals of my research institute. The texts
should be written in= Markdown and then be processed with `pandoc' to
LaTeX.

I alr= eady have an elaborated pandoc template to produce the LaTeX
preambel et= c. So far its working great.

But for the figures I need the caption = from the Markdown file to be set
with `\sidecaption' instead of `\ca= ption' in LaTeX, as well as with an
optional argument (short-caption= ) for the image attribution in the list
of figures.

To get the la= tter working I use the following template from a GitHub
discussion in th= e [pandoc repo]:

=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80
= =E2=94=82 PANDOC_VERSION:must_be_at_least '3.1'
=E2=94=82
=E2= =94=82 if FORMAT:match 'latex' then
=E2=94=82 =C2=A0 function Fi= gure(f)
=E2=94=82 =C2=A0 =C2=A0 local short =3D f.content[1].content[1].= attributes['short-caption']
=E2=94=82 =C2=A0 =C2=A0 if short and= not f.caption.short then
=E2=94=82 =C2=A0 =C2=A0 =C2=A0 f.caption.short= =3D pandoc.Inlines(short)
=E2=94=82 =C2=A0 =C2=A0 end
=E2=94=82 =C2= =A0 =C2=A0 return f
=E2=94=82 =C2=A0 end
=E2=94=82 end
=E2=94=94= =E2=94=80=E2=94=80=E2=94=80=E2=94=80

That works without any flaws.
But now I need to figure out how to change the LaTeX macro used for t= he
caption. The older [approach of pre pandoc version 3.0 posted] by tar= leb
is really intuitive and I could have easily adapted it to my needs. = But
since pandoc 3.0 there is the new [/complex figures/] approach and, = so
far, I couldn't figure out how to change the LaTeX macro used for= the
captions with this new behaviour.

I tried something like tha= t (Adapted from [here]:

=E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94= =80
=E2=94=82 if FORMAT:match 'latex' then
=E2=94=82 =C2=A0 f= unction RawBlock (raw)
=E2=94=82 =C2=A0 =C2=A0 local caption =3D raw.tex= t:match('\\caption')
=E2=94=82 =C2=A0 =C2=A0 if caption then
= =E2=94=82 =C2=A0 =C2=A0 =C2=A0 =C2=A0raw:gsub('\\caption', '\\s= idecaption')
=E2=94=82 =C2=A0 =C2=A0 end
=E2=94=82 =C2=A0 =C2=A0 = return raw
=E2=94=82 =C2=A0 end
=E2=94=82 end
=E2=94=94=E2=94=80= =E2=94=80=E2=94=80=E2=94=80

But nothing happened.

The main ch= allenge for me are my more-or-less non-existing lua skills. I
just never= had to use it for my daily tasks. I thought about using `awk'
or `s= ed' to edit the `.tex' file itself using a regex-substitution, but<= br>that should remain an absolute stopgap, since it makes the whole
work= flow less portable.

Thus, I'm hoping for a hint/a solution in fo= rm of a pandoc-lua script
which 1. helps me to achieve the goal, and 2. = improve my understanding
of lua and the /complex figures/ approach for s= imilar future tasks.

I appreciate any tipp!

Best,
Lukeflo<= br>
This question is also posted on StackOverFlow: https://stackoverflow.com/q/7= 7504584/19647155

[pandoc repo]
<https://github.com/jgm/pandoc/issues/7915#issuecomment-1427113349>

[approach of pre pandoc version 3.0 posted]
<
https://github.com/jgm/pandoc/issues/7915#issuecomm= ent-1039370851>

[/complex figures/] <https://github.com/jgm/pa= ndoc/releases?page=3D2>

[here] <https://stackoverflow.com/a/712965= 95/19647155>
<= /div>

--
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/b419ae83-de83-4035-97cd-fb41cb6be647n%40googlegroups.= com.
------=_Part_37523_814185933.1702290801474-- ------=_Part_37522_929693034.1702290801474--