public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Antonio Piccolboni <piccolbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: missing figures in latex/pdf output
Date: Tue, 27 Sep 2022 20:41:17 -0700 (PDT)	[thread overview]
Message-ID: <c2b0c867-fb97-4aee-86f4-fcf160ff0303n@googlegroups.com> (raw)
In-Reply-To: <1AF44C44-B3C7-4872-BA10-980739F20F72-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 5078 bytes --]

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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.

[-- Attachment #1.2: Type: text/html, Size: 7208 bytes --]

  parent reply	other threads:[~2022-09-28  3:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 20:26 Antonio Piccolboni
     [not found] ` <8bd75451-cad3-4a83-80e3-7a983091bcadn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-09-27 21:06   ` John MacFarlane
     [not found]     ` <D0DAD6A1-3B30-4F46-8FAB-5F484F65D700-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-28  1:11       ` Martin Hepp
     [not found]         ` <1AF44C44-B3C7-4872-BA10-980739F20F72-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-28  3:41           ` Antonio Piccolboni [this message]
     [not found]             ` <c2b0c867-fb97-4aee-86f4-fcf160ff0303n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-09-28  6:04               ` John MacFarlane
     [not found]                 ` <ADAB9DB0-E0D5-4933-A83A-589C7EF14F61-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-28 15:48                   ` Antonio Piccolboni
     [not found]                     ` <C357174C-A074-4646-9149-B3102B6FAB8F-JxjfdnYl9jjeHsu01rjbxw@public.gmane.org>
2022-10-02 16:01                       ` 'Marek Stepanek' via pandoc-discuss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2b0c867-fb97-4aee-86f4-fcf160ff0303n@googlegroups.com \
    --to=piccolbo-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).