* fenced_divs depending on output format (custom-styles)
@ 2018-09-14 21:34 tolot27
[not found] ` <2500ccf4-6f92-4d01-9267-5c4e4634c099-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: tolot27 @ 2018-09-14 21:34 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1346 bytes --]
Hi,
my main intention is to define a fenced div with a custom-style only for
docx and not for other formats. The reason is that I use savequote in latex
which is not supported by other output formats. But I like to have the same
quote/poem in docx. Hence, I've defined a fenced div with a custom-style
and fenced_code_attributes as described in
https://pandoc.org/MANUAL.html#output. That works so far except for other
output formats like latex, obviously. How can I hide this fenced div or
make it output-format dependend like fenced code blocks?
Idealy, the syntax introduced by the raw_attribute could be used for fenced
divs, too.
Example:
::: {=docx custom-style="Poetry"}
| A Bird came down the Walk---
| He did not know I saw---
:::
--
Regards,
Mathias
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2500ccf4-6f92-4d01-9267-5c4e4634c099%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 2733 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fenced_divs depending on output format (custom-styles)
[not found] ` <2500ccf4-6f92-4d01-9267-5c4e4634c099-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-09-14 23:16 ` John MacFarlane
0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2018-09-14 23:16 UTC (permalink / raw)
To: tolot27, pandoc-discuss
Your best bet is to use a lua filter. For example
this one will suppress all Divs with custom-style
'Poetry' unless the output format is docx:
function Div(el)
if el.attributes['custom-style'] == 'Poetry' and FORMAT ~= 'docx' then
return {}
end
end
tolot27 <mathias-taBouHiV1h1goHlPtYpdqQ@public.gmane.org> writes:
> Hi,
>
> my main intention is to define a fenced div with a custom-style only for
> docx and not for other formats. The reason is that I use savequote in latex
> which is not supported by other output formats. But I like to have the same
> quote/poem in docx. Hence, I've defined a fenced div with a custom-style
> and fenced_code_attributes as described in
> https://pandoc.org/MANUAL.html#output. That works so far except for other
> output formats like latex, obviously. How can I hide this fenced div or
> make it output-format dependend like fenced code blocks?
>
> Idealy, the syntax introduced by the raw_attribute could be used for fenced
> divs, too.
>
> Example:
>
> ::: {=docx custom-style="Poetry"}
> | A Bird came down the Walk---
> | He did not know I saw---
> :::
>
>
> --
> Regards,
> Mathias
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2500ccf4-6f92-4d01-9267-5c4e4634c099%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-14 23:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14 21:34 fenced_divs depending on output format (custom-styles) tolot27
[not found] ` <2500ccf4-6f92-4d01-9267-5c4e4634c099-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-09-14 23:16 ` John MacFarlane
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).