On 11/28/2014 11:01 AM, Karl Berry wrote:
Sure, sub/superscripts are most commonly used in math. Thus @math, as
in @math{e=mc^2}. I never expected anything else to be used, certainly
not clunky macros. This is why @math was created in the first place.
Is your proposal really just working around makeinfo not recognizing ^
and _ in math in the first place?
My use case is primarily *not* math - I mainly want subscripts and superscripts.
For example function prototypes:
(list exp@sub{1} ... exp@sub{n})
Syntax descriptions:
list = nil | (value@sup{+})
Language names:
Schema as specified by R@sup{7}RS.
However, I do have some need for math:
A quaternion is a number that can be expressed in the form ‘w+xi+yj+zk’,
where w, x, y, and z are real, and i, j, and k are imaginary units satisfying
@math{i^2 = j^2 = k^2 = ijk = -1}. The magnitude of a quaternion is defined
to be its
Euclidean norm when viewed as a point in @math{R^4}.
I want some sane way of writing i^2 and R^4 so I get tolerably-looking
expressions with superscripts in both TeX andDocBook/HTML.
Having been drafting the documentation, I can say that it feels quite
clean to say "use @sub/@sup for text, @math{^_...} for math". It's no
problem to implement @sub/@sup being like ^ and _ in math mode and doing
text in text mode, etc., but, I don't know, usage doesn't seem as clear.
If I may dare to generalize a tiny bit -- in principle, I'd rather that
we recognize TeX math in the first place than invent new Texinfo
commands to do the same thing.
In the above example I don't care if I have to write @math{R^4} or
@math{R@sup{4}},
as long as I don't have to use conditionals, and I get a <sup> when
emitting HTML.
--
--Per Bothner
[email protected] http://per.bothner.com/