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: Escape characters silently truncate other text
Date: Tue, 30 Aug 2022 16:12:57 -0700	[thread overview]
Message-ID: <61B0FAA5-C982-4E6E-8ECE-A738785BC612@gmail.com> (raw)
In-Reply-To: <Yw6ILcBFMakgvnrd-7O8SYKUizqF02rolkqoqlA@public.gmane.org>



> On Aug 30, 2022, at 2:59 PM, 'amindfv-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org' via pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> wrote:
> 
> I'm confused about this for a couple reasons:
> 
>  1. The silent truncation: I'd understand if I'd written `here's a string "with a\nequator"` and gotten back `here's a string "with a≠uator"`, but it's much more disturbing to have a single backslash to cause any following text to disappear
> 

Try it with —verbose

>  2. raw_tex seems not to actually let me use raw Tex... e.g.
> 
>    $ cat /tmp/foo.md 
>    here's a string "with a\nnewline\ncharacter"
> 
>    what happened to the other stuff?
> 
>    \emph{this also disappears}

Again, use pandoc -t native and you’ll see how pandoc is parsing this. It doesn’t disappear. It is parsed as raw LaTeX.  But raw LaTeX content is only passed through to formats that allow it (namely LaTeX, ConTeXt, Beamer, markdown + raw_tex, etc.).


>    This is fine, though: $E=mc^2$

Math is separate from raw tex; it is parsed as a Math element and we convert this as appropriate to the output format.

>    \this_isnt_latex
> 
>    This is: \neq
> 
>    $ pandoc /tmp/foo.md -o /tmp/foo.html
>    $ cat /tmp/foo.html 
>    <p>here’s a string “with a”</p>
>    <p>what happened to the other stuff?</p>
>    <p></p>
>    <p>This is fine, though: <span class="math inline"><em>E</em> = <em>m</em><em>c</em><sup>2</sup></span></p>
>    <p>_isnt_latex</p>
>    <p>This is: </p>
> 
> To me it'd be much more "principle of least astonishment" to only have raw_tex handle commands it understands (and then output them), not consume a lot of text and output nothing


The point of raw TeX is really to allow users to put in the sorrt of thing pandoc *wouldn’t* understand, because they know they want this in the output format.


-- 
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/61B0FAA5-C982-4E6E-8ECE-A738785BC612%40gmail.com.


      parent reply	other threads:[~2022-08-30 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 21:04 'amindfv-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org' via pandoc-discuss
     [not found] ` <Yw57XcTYQBSq80ME-7O8SYKUizqF02rolkqoqlA@public.gmane.org>
2022-08-30 21:10   ` John MacFarlane
     [not found]     ` <3EC2D4C1-EA11-46E5-A000-363461CD8A29-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-08-30 21:59       ` 'amindfv-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org' via pandoc-discuss
     [not found]         ` <Yw6ILcBFMakgvnrd-7O8SYKUizqF02rolkqoqlA@public.gmane.org>
2022-08-30 23:12           ` John MacFarlane [this message]

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=61B0FAA5-C982-4E6E-8ECE-A738785BC612@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).