From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31073 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=27Kriszti=C3=A1n_Hofst=C3=A4dter=27_via_pandoc=2Ddiscuss?= Newsgroups: gmane.text.pandoc Subject: Re: How can I use figure placement specifiers with Markdown, e.g. [p] for special place? Date: Sun, 24 Jul 2022 08:17:48 -0700 (PDT) Message-ID: <0a6a41d3-fb62-43e9-a85e-edb09e53dc79n@googlegroups.com> References: <87czdud1v5.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1818_491523661.1658675868622" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1447"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCLPH74HTUARBHOF6WLAMGQEXNK4PRQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jul 24 17:17:53 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f185.google.com ([209.85.128.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oFdMf-00009r-6L for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 24 Jul 2022 17:17:53 +0200 Original-Received: by mail-yw1-f185.google.com with SMTP id 00721157ae682-31e6ffb03f6sf71687767b3.2 for ; Sun, 24 Jul 2022 08:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=la4yf7kwpAOTeSvcL/Q33fmmV9gWfaBYOtS2IgR2CMM=; b=NzwTQjwgfEv3wq6gtMj3LSuILkIiDpEq/0+/8MXXixWfmPS0AY6pd9NYf5krKnNViX XUFkfMmiBy7UsLiIb97RQN33R5A4U/DRNGiyJaFF8UY52+D37rRQnXvLYvAX8vMSne12 9wx7hKrDhUUUI16J3XXU05qtDh0Mt+FiMOo5tQz5cNhggucLa7LKC4o2vZpbJATwPOaH /2yzxWSuBMTVVpJTsSK3rJs1dODK80rJSsQlGeiYMjzWEc+aEDR32EDQa/a4Kk+PscBt zi1KvZ/a+C++HUmlialAKzMDQuFtewkSKAAlgKu8uV9QpMosk+QxQDh70ng8jvC4FdWQ wXlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:x-original-sender:reply-to:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=la4yf7kwpAOTeSvcL/Q33fmmV9gWfaBYOtS2IgR2CMM=; b=qnyA+ufpPN5Ji26EhxfQiXscoXT0Ux64ZvFad3jkTvuM7qMpt1yw88Ssvkrl723rKG 6QO81ZPOezSNTnpnw20rd4vspCr08gOXHRSM6k8Z63l3n+381h5yR+MKjI2lAAOfITHZ ASO51jlJNjyGOozQT7gPbqI/0yBUhFaJHDaKd82S96gJ0gTibHapkF0DRTscE3aYrswZ kdCjVCXvIrxeX0Hg4nqcQaCg9AvuSobF5eSRuiPVwEkePd5qMa09VanxRb9ubAMmGH1U /B5t81lWTRU1wsf0SEgdSfyNVj6ehM3bjy3CWmhzXk74GhE4WPyoqcgySZp3gRJP0PAl odBA== X-Gm-Message-State: AJIora/jy5qqdtNOxr5ARLWrCmEaHQSU5UY2p2BKhU3p2y8UudJoTo9L iPftNynI+mTwnKSXw6gZEfY= X-Google-Smtp-Source: AGRyM1slHYHa+PKvz0tg0Zj5AAnNqSmG9JSK7HtYGuVLLQBbT02uYoZ4KfnayHg/UmLISNFTmOlZJQ== X-Received: by 2002:a25:5006:0:b0:670:9834:8767 with SMTP id e6-20020a255006000000b0067098348767mr6102823ybb.147.1658675872072; Sun, 24 Jul 2022 08:17:52 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:690c:448:b0:2fe:dfec:f7d8 with SMTP id bj8-20020a05690c044800b002fedfecf7d8ls1136176ywb.5.-pod-prod-gmail; Sun, 24 Jul 2022 08:17:49 -0700 (PDT) X-Received: by 2002:a81:b04:0:b0:31e:594e:4e4e with SMTP id 4-20020a810b04000000b0031e594e4e4emr7342492ywl.370.1658675869273; Sun, 24 Jul 2022 08:17:49 -0700 (PDT) In-Reply-To: <87czdud1v5.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: tedor2-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org X-Original-From: =?UTF-8?Q?Kriszti=C3=A1n_Hofst=C3=A4dter?= 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:31073 Archived-At: ------=_Part_1818_491523661.1658675868622 Content-Type: multipart/alternative; boundary="----=_Part_1819_1613458793.1658675868622" ------=_Part_1819_1613458793.1658675868622 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Albert,=20 You recommendations added the figure, but the cross referencing didn't come= =20 through: 1. there is no figure number before the figure's caption=20 2. there is no reference in the text to the figure either, only : "(Fig.=20 *=C2=BFfig:nf-alert?*)" As the Terminal still says:=20 Undefined cross-reference: fig:nf-alert , this has probably something to do with using pandoc-crossref. This is my line of code for making the file:=20 % pandoc -F pandoc-crossref myOutput.md -o myOutput.docx=20 --resource-path=3D../assets/img/ --citeproc --number-sections=20 --lua-filter=3Dparse-latex.lua Thanks!=20 // I can live with changing the the figure's Latex code to Markdown when I= =20 export to Word (it does not happen that often)=20 On Sunday, July 24, 2022 at 3:25:27 PM UTC+1 Albert Krewinkel wrote: > > 'Kriszti=C3=A1n Hofst=C3=A4dter' via pandoc-discuss =20 > writes: > > > How can I use figure placement specifiers with Markdown, e.g. [p] for > > special place? > > > > When converting from Markdown to PDF the figure with the code below is > > rendered properly, however it is missing when converting to Word > > (docx). > > The easiest way is probably to use the LaTeX code in combination with a > Lua filter that parses the LaTeX when converting to a different output > format: > > ``` lua > if FORMAT:match 'latex' then return {} end > > function RawBlock (raw) > if raw.format:match 'tex' then > return pandoc.read(raw.text, 'latex').blocks > end > end > ``` > > Save the above to a file `parse-latex.lua` and pass it to pandoc via > `--lua-filter=3Dparse-latex.lua`. > > --=20 > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > --=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/0a6a41d3-fb62-43e9-a85e-edb09e53dc79n%40googlegroups.com. ------=_Part_1819_1613458793.1658675868622 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Albert, 

You recommendations added the figur= e, but the cross referencing didn't come through:

1. there is no fig= ure number before the figure's caption 
2. there is no refer= ence in the text to the figure either, only : "(Fig. =C2=BFfig:nf-a= lert?)"

As the Terminal still says: 

Undefined cross-reference: fig:nf-alert
=
, this has probably something to do with using pandoc-c= rossref.

This is my line of code for making the file: 
% pandoc -F pandoc-crossref myOutput.md -o myOutput.docx --resource-p= ath=3D../assets/img/ --citeproc --number-sections --lua-filter=3Dparse-late= x.lua

Thanks! 

// I can live with chan= ging the the figure's Latex code to Markdown when I export to Word (it does= not happen that often) 


On Sunday, July 24,= 2022 at 3:25:27 PM UTC+1 Albert Krewinkel wrote:

'Kriszti=C3=A1n Hofst=C3=A4dter' via pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wri= tes:

> How can I use figure placement specifiers with Markdown, e.g. [p] = for
> special place?
>
> When converting from Markdown to PDF the figure with the code belo= w is
> rendered properly, however it is missing when converting to Word
> (docx).

The easiest way is probably to use the LaTeX code in combination with a
Lua filter that parses the LaTeX when converting to a different output
format:

``` lua
if FORMAT:match 'latex' then return {} end

function RawBlock (raw)
if raw.format:match 'tex' then
return pandoc.read(raw.text, 'latex').blocks
end
end
```

Save the above to a file `parse-latex.lua` and pass it to pandoc via
`--lua-filter=3Dparse-latex.lua`.

--=20
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
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/0a6a41d3-fb62-43e9-a85e-edb09e53dc79n%40googlegroups.= com.
------=_Part_1819_1613458793.1658675868622-- ------=_Part_1818_491523661.1658675868622--