public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Apprentice Ship
	<tex.apprentice-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Detect math-mode and text-mode in LaTeX
Date: Sun, 20 Sep 2020 10:05:51 -0700	[thread overview]
Message-ID: <m28sd4v0nk.fsf@MacBook-Pro.hsd1.ca.comcast.net> (raw)
In-Reply-To: <a134e012-4816-450d-83cd-80d44dbc957en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


Apprentice Ship <tex.apprentice-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Is it possible to use Pandoc to detect if you are in text-mode or math-mode 
> inside LaTeX? That is, on any LaTeX file. What I would like to do is to 
> test some conformance on part of the LaTeX file, for example, the presence 
> of a "." (dot) in math-mode or \mathrm{} in text-mode...

You can use a filter to see if anything parsed as a Math element
contains a dot, for example.

For the other case, you'd need to use -f latex+raw_tex and then
see if there are any RawInline or RawBlock elements that contain
`\mathrm`.


      parent reply	other threads:[~2020-09-20 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-19 19:10 Apprentice Ship
     [not found] ` <a134e012-4816-450d-83cd-80d44dbc957en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-20 17:05   ` 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=m28sd4v0nk.fsf@MacBook-Pro.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=tex.apprentice-Re5JQEeQqe8AvxtiuMwx3w@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).