Thanks. Using `-t native` to generate a `.tex` file I see the following relevant element: ,Div ("",["box","box-note"],[]) [Para [Str "A",Space,Str "note",Space,Str "on",Space,Str "what\8217s",Space,Str "being",Space,Str "explained"]] ,RawBlock (Format "html") "

" If I try to generate a `pdf` as usual, I get the following error: "cannot produce pdf output from native" I don't really understand what's going on here, to be honest ... On Mon, 11 Nov 2019 at 19:44, John MacFarlane wrote: > > It looks like it should work. Try using the filter but going > `-t native` to see what comes out the other end. > > Gabriel Volpe writes: > > > Hi John, > > > > This function worked very well for me but I've modified my LaTeX function > > to take an extra argument and now I'm struggling to make it work: > > > > return {pandoc.RawBlock('latex', '\\begin{' .. class .. > > '}[Some Title]'), > > el, > > pandoc.RawBlock('latex', '\\end{' .. class .. '}')} > > > > > > This compiles but it doesn't work as I expect it to. The intended title > is > > rendered as part of the body instead (together with `el`). If I instead > > have the LaTeX directly, it works: > > > > \begin{notebox}[Custom title] > > > > some content > > > > \end{notebox} > > > > > > Any hints? > > > > Thanks! > > > > On Tue, 1 Oct 2019 at 21:57, Gabriel Volpe > wrote: > > > >> This is awesome! Thank you so much, I'll give it a try very soon. > >> > >> On Tue, 1 Oct 2019 at 18:54, John MacFarlane wrote: > >> > >>> > >>> You can write a fairly simple filter that will do this for you, yes. > >>> > >>> % cat divToEnv.lua > >>> function Div(el) > >>> if FORMAT == 'latex' then > >>> local envname = el.classes[1] > >>> return {pandoc.RawBlock('latex', '\\begin{' .. envname .. '}'), > >>> el, > >>> pandoc.RawBlock('latex', '\\end{' .. envname .. '}')} > >>> end > >>> end > >>> > >>> % pandoc --lua-filter divToEnv.lua -t latex > >>>

> >>> hi there > >>>
> >>> ^D > >>> \begin{foo} > >>> > >>> hi there > >>> > >>> \end{foo} > >>> > >>> % pandoc --lua-filter divToEnv.lua -t html5 > >>>
> >>> hi there > >>>
> >>> ^D > >>>
> >>>

hi there

> >>>
> >>> > >>> Gabriel Volpe writes: > >>> > >>> > Or even better, can `pandoc` identify
blocks when parsing > >>> markdown to > >>> > pdf and if so, apply some LaTeX style instead? > >>> > > >>> > That'd be great to avoid repeating text. I should be able to just > write: > >>> > > >>> >
> >>> > some text > >>> >
> >>> > > >>> > And then have the conditional logic in my LaTeX template file. > >>> > > >>> > On Tuesday, 1 October 2019 18:09:19 UTC-5, Gabriel Volpe wrote: > >>> >> > >>> >> Hi, > >>> >> > >>> >> I'm in search of something similar to this: > >>> >> > >>> > https://groups.google.com/forum/#!searchin/pandoc-discuss/conditional%7Csort:date/pandoc-discuss/R00dbPcjYRY/An6ZEYNwAgAJ > >>> >> > >>> >> But instead, I want a specific output for LaTeX and another for EPUB > >>> >> (which goes through HTML). Basically, something like > >>> >> > >>> >> $if(outputformat=latex)$ > >>> >> \begin{foo} > >>> >> some text > >>> >> \end{foo} > >>> >> $endif$ > >>> >> > >>> >> $if(outputformat=epub)$ > >>> >>
> >>> >> some text > >>> >>
> >>> >> $endif$ > >>> >> > >>> >> I had a look into > >>> https://pandoc.org/MANUAL.html#extension-raw_attribute but > >>> >> I'm not being able to understand how I can get this working. > >>> >> > >>> >> Can anyone shed some light on me? > >>> >> > >>> >> Thanks! > >>> >> > >>> > > >>> > -- > >>> > 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/dbfa5bfc-fba7-4309-abe0-7e432cd13b9b%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/CAJReL35qw5%2BmgbQunSzi7M_f8sCG%3D9JuUX39MKvoWA1PrdXeAg%40mail.gmail.com.