public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Detect math-mode and text-mode in LaTeX
@ 2020-09-19 19:10 Apprentice Ship
       [not found] ` <a134e012-4816-450d-83cd-80d44dbc957en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Apprentice Ship @ 2020-09-19 19:10 UTC (permalink / raw)
  To: pandoc-discuss


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

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...

Joshua

-- 
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/a134e012-4816-450d-83cd-80d44dbc957en%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Detect math-mode and text-mode in LaTeX
       [not found] ` <a134e012-4816-450d-83cd-80d44dbc957en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-09-20 17:05   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2020-09-20 17:05 UTC (permalink / raw)
  To: Apprentice Ship, pandoc-discuss


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`.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-20 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19 19:10 Detect math-mode and text-mode in LaTeX Apprentice Ship
     [not found] ` <a134e012-4816-450d-83cd-80d44dbc957en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-20 17:05   ` John MacFarlane

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).