public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Getting pandoc to convert Github Markdown documents with HTML tags to PDF
Date: Wed, 5 Jul 2023 11:41:38 -0700	[thread overview]
Message-ID: <F4D52E47-33F8-4A2C-9A56-679BD5240ABD@gmail.com> (raw)
In-Reply-To: <CAFy1yb2op3Aq=P4L7xpNwPBBHtopKMx+urWz+-VQ+5Mh0CM=hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

&mdash; and &Hscr; will be parsed as unicode characters and these will be passed through to the HTML.
You can check the intermediate HTML file (again it will be printed with --verbose) to confirm this.
It may be that the program that is being invoked to go from HTML -> PDF (wkhtmltopdf ?) doesn't handle these characters properly.
You could try adding the `--ascii` option which will force entities to be used.

> On Jul 4, 2023, at 4:07 PM, Luveh Keraph <1.41421-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> Thanks. I invoked pandoc -f gfm MyDoc. -o MyDoc.pdf and in the resulting PDF document the subscripts are still ignored. When running it with --verbose in the resulting output I saw numerous instances of 
> 
> [INFO] Not rendering RawInline (Format "html") "</sub>"
> [INFO] Not rendering RawInline (Format "html") "<sub>"
> 
> However, when I added -t html5 to the invocation the diagnostics above disappear, and the subscripts are indeed present in the converted PDF file. Thanks for the tip - it has indeed improved things. Now it is still the case that things like &mdash; or &Hscr; are ignored by pandoc. Any suggestions on how to get pandoc to process them? 
> 
> I am using the following:
> 
> pandoc 3.1.4
> Features: +server +lua
> Scripting engine: Lua 5.4
> 
> 
> 
> 
> 
> 
> On Tue, Jul 4, 2023 at 3:50 PM John MacFarlane <fiddlosopher@gmail.com> wrote:
> HTML tags should be passed through to HTML formats.
> 
> Have you looked at the intermediate HTML produced?  You can use --verbose to see it.
> 
> This seems to work fine:
> 
> % pandoc -t html5
> _A_<sub>_m_</sub>
> <p><em>A</em><sub><em>m</em></sub></p>
> 
> PS. You probably want to use -f gfm if you're targeting GitHub Markdown.
> 
> Pandoc version?
> 
> 
> 
> > On Jul 3,
> 
> > 2023, at 3:41 PM, Luveh Keraph <1.41421-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > 
> > I have a Github Markdown document that contains HTML tags - mostly to do with special characters (e.g. &Hscr;) and stuff to place pictures where I want in the page. The thing is, pandoc seems to ignore the HTML tags. Is this a limitation intrinsic to pandoc, or is there any way to get pandoc to process such tags and produce the right output? 
> > 
> > The pandoc invocation that I am currently using for converting my Github Markdown documents to PDF is
> > 
> >  $ pandoc --resource-path=/home/abc/Repos.wiki -t html5 --pdf-engine=wkhtmltopdf --metadata pagetitle="MyDoc.md" --css github.css -o MyDoc.pdf
> > 
> > The default invocation pandoc MyDoc.md -o MyDoc.pdf is not dealing with images properly (in that it sometimes rearranges surrounding paragraphs the wrong way) and it seems to be unable to deal with expressions like _A_<sub>_m_</sub>, in that the <sub> and </sub> directives seem to be ignored.
> > 
> > -- 
> > 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/b1dae07b-11d1-4c98-8fcf-369f2b23a54cn%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/529BC174-779A-4D98-BCC9-F59AEAAC2B9D%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/CAFy1yb2op3Aq%3DP4L7xpNwPBBHtopKMx%2BurWz%2B-VQ%2B5Mh0CM%3DhQ%40mail.gmail.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/F4D52E47-33F8-4A2C-9A56-679BD5240ABD%40gmail.com.


  parent reply	other threads:[~2023-07-05 18:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 22:41 Luveh Keraph
     [not found] ` <b1dae07b-11d1-4c98-8fcf-369f2b23a54cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-04 21:50   ` John MacFarlane
     [not found]     ` <529BC174-779A-4D98-BCC9-F59AEAAC2B9D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-07-04 23:07       ` Luveh Keraph
     [not found]         ` <CAFy1yb2op3Aq=P4L7xpNwPBBHtopKMx+urWz+-VQ+5Mh0CM=hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-07-05 18:41           ` John MacFarlane [this message]
     [not found]             ` <F4D52E47-33F8-4A2C-9A56-679BD5240ABD-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-07-05 19:16               ` Luveh Keraph
     [not found]                 ` <CAFy1yb3hBrj7FUSM7wDiFY7hEB+GQ1PJSB4RiUo5YRNJnACZjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-07-05 19:47                   ` John MacFarlane

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=F4D52E47-33F8-4A2C-9A56-679BD5240ABD@gmail.com \
    --to=fiddlosopher-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).