Wrong link, please remove the 'sales' part :D

On Mon, Nov 11, 2019, 20:46 Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
BTW if by any chance you're interested in FP Scala I'd be happy to give you a copy of my work-in-progress book, where I also give credits to Pandoc https://leanpub.com/pfp-scala/sales

Just let me know, you've been very helpful :) 



On Mon, Nov 11, 2019, 20:00 Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
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") "<p/>"

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 <jgm@berkeley.edu> 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 <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <jgm@berkeley.edu> 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
>>> <div class="foo">
>>> hi there
>>> </div>
>>> ^D
>>> \begin{foo}
>>>
>>> hi there
>>>
>>> \end{foo}
>>>
>>> % pandoc --lua-filter divToEnv.lua -t html5
>>> <div class="foo">
>>> hi there
>>> </div>
>>> ^D
>>> <div class="foo">
>>> <p>hi there</p>
>>> </div>
>>>
>>> Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>>
>>> > Or even better, can `pandoc` identify <div> 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:
>>> >
>>> >  <div class="foo">
>>> >   some text
>>> >  </div>
>>> >
>>> > 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)$
>>> >>   <div class="foo">
>>> >>   some text
>>> >>   </div>
>>> >> $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-/JYPxA39Uh5TLH3MbocFFw@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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJReL340w%2BdXeOJVXWVaviTw2ZV%3DoyyXTBeN5cLhtUSnwr1zUQ%40mail.gmail.com.