Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a grammar for Tex of LaTeX?

80 views
Skip to first unread message

Hendrik Boom

unread,
Mar 4, 2019, 11:55:26 AM3/4/19
to
Is there a grammar, or a precise specification, for (at least the
mathematical notation part of) TeX or LaTeX?

-- hendrik

Peter Wilson

unread,
Mar 4, 2019, 1:31:26 PM3/4/19
to
No. TeX is a macro language which means that you can change the meaning
of any construct at any time.

The famous example of this is xii.tex:
pdftex xii.tex

Try
> texdoc xii
for more information

Peter W.

Hendrik Boom

unread,
Mar 5, 2019, 7:27:47 AM3/5/19
to
On Mon, 04 Mar 2019 18:31:21 +0000, Peter Wilson wrote:

> On 04/03/19 16:55, Hendrik Boom wrote:
>> Is there a grammar, or a precise specification, for (at least the
>> mathematical notation part of) TeX or LaTeX?
>>
>> -- hendrik
>>
>>
> No. TeX is a macro language which means that you can change the meaning
> of any construct at any time.
>
Yes, I get that. But
(a) most people dont redefine the language, except for using standard
packages such as those fron AMS.

(b) There's a difference between changing the syntax and changing the
semantics.

(c) There's a wide-spread use of laTeX notation outside of TeX, such as
in markdown extensions and other ad-hoc markup notations. Though I admit
there's precious little even among markdown implementations..

In (c) at least there's not much opportuity to change either the syntax
or the semantics.

I'm hoping for a precise definition of at least such common usage. If
it were easily available it might stem the unnecessary divergence of
such expatriate LaTeX variants.

Such expatriate LaTeX *is* very useful in html or html-generating
programs. I'd like to avoid creating yet another variant in any html-
generating code I might need to write.

> The famous example of this is xii.tex:
> pdftex xii.tex

Noted. That's fun, and not what most users need.

-- hendrik

Robert Heller

unread,
Mar 5, 2019, 11:15:23 AM3/5/19
to
I think what Peter Wilson is saying is that even if you stick to "standard
usage", there are enough things going on that coming up with a *precise
specification* is probably not possible. It is just not that sort of thing.
Eg the syntax for some things is one thing and the syntax for other things is
something else.

>
> -- hendrik
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Scott Pakin

unread,
Mar 6, 2019, 2:42:14 PM3/6/19
to
On 3/4/19 9:55 AM, Hendrik Boom wrote:
> Is there a grammar, or a precise specification, for (at least the
> mathematical notation part of) TeX or LaTeX?

While not exactly what you're looking for, perhaps you can infer a
grammar from MathJax's TeX parser's source code. A quick skim through
the code indicates that


https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js

may be a good starting point.

-- Scott

Hendrik Boom

unread,
Mar 7, 2019, 8:44:03 PM3/7/19
to
Thank you. That's definitely one of the well-used common variants.

-- hendrik
0 new messages