Thanks both Martin and John for the advice. Just a comment from a long time Markdown user, more recent pandoc user with multiformat output ambitions.

Until now I had assumed that markdown was a superset of html. It wasn't a pandoc extension, it is what the Markdown format says: you can mix in html when markdown syntax is not enough. It was the backstop that made it easy to pick markdown without future regret.  So not converting the html in markdown is not in keeping with the format definition according to my assumptions. That said, markdown doesn't have an official standard and I may very well be wrong. 

There are indeed quite a few filters that translate html to tex. One of them is pandoc itself.  So it seems to me the tech is there to do it, it is just a decision about the role of html within markdown, an extension devoted to maximizing control on html output only, like the other raw_<Format> extensions, or part of the markdown format itself  as per my old assumption. Perhaps I could generate html first and then a pdf from the html if I felt adventurous.

In my specific case the solution is to use just markdown as Martin suggested. The reason I had switched to html is that, for some reason, the calibre epub viewer ignores the caption when using the Markdown syntax. Apple books doesn't have this problem. So I will just ignore the calibre viewer. I had a few other uses for html tags like sup and span, but I can work around those, mostly. Thanks!

Antonio


On Tuesday, September 27, 2022 at 6:11:56 PM UTC-7 mfhepp wrote:
In general, if you aim at multiple output formats, it’s best to use Markdown syntax / elements for the authoritative master document, and delegate required modifications to format-specific Pandoc filters (or writers, but less common).

There are quite some filters out there that try to translate HTML elements to TeX syntax (e.g. text color) and other formats, but this is typically second-best, in particular more difficult to implement in a robust way.

Except for tables, Markdown in the Pandoc flavor, is likely the best compromise for a output-format-agnostic representation of documents, in particular thanks to fenced divs support.

Best wishes
Martin

---------------------------------------
martin hepp
www: https://www.heppnetz.de/


> On 27. Sep 2022, at 23:06, John MacFarlane <fiddlo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> It’s not a bug. Raw HTML is only passed through to formats that support it (e.g. Markdown, EPUB, and HTML).
> It isn’t parsed into a native Pandoc structure and then rerendered in the target format.
>
>> On Sep 27, 2022, at 1:26 PM, Antonio Piccolboni <picc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> Hi,
>> if one includes some graphics with the ![]() syntax, the graphics is present in the pdf output. But if one uses <figure>, no such luck. Both work with epub output. (I momentarily forgot why I am alternating between the two forms, I think I needed some extra control on image size). This is a minimal example. Markdown:
>>
>> ```
>> ![Some image](assets/IBM650.jpg)
>>
>> <figure>
>> <img src="assets/IBM650.jpg"></img>
>> <figcaption>Some image 2
>> </figcaption>
>> </figure>
>> ```
>>
>> Tex output:
>>
>> ```
>> \begin{figure}
>> \centering
>> \includegraphics{assets/IBM650.jpg}
>> \caption{Some image}
>> \end{figure}
>>
>> Some image 2
>> ```
>>
>> Of the second image, only the caption is left. Is this a bug or am I missing something? Thanks
>>
>>
>>
>> Antonio
>>
>>
>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8bd75451-cad3-4a83-80e3-7a983091bcadn%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-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/D0DAD6A1-3B30-4F46-8FAB-5F484F65D700%40gmail.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/c2b0c867-fb97-4aee-86f4-fcf160ff0303n%40googlegroups.com.