Next: , Previous: , Up: Insertions   [Contents][Index]

12.7 @math: Inserting Mathematical Expressions

You can write a short mathematical expression with the @math command. Write the mathematical expression between braces, like this:

@math{(a + b) = (b + a)}

This produces the following in Info and HTML:

(a + b) = (b + a)

The @math command has no special effect on the Info and HTML output. makeinfo expands any @-commands as usual, but it does not try to use produce good mathematical formatting in any way (no use of MathML, etc.). The HTML output is enclosed by <em>...</em>, but nothing more.

However, as far as the TeX output is concerned, plain TeX mathematical commands are allowed in @math, starting with ‘\’. In essence, @math switches into plain TeX math mode. (Exception: the plain TeX command \sup, which typesets the mathematical operator name ‘sup’, must be accessed as \mathopsup, due to the conflict with Texinfo’s @sup command.)

This allows you to use all the plain TeX math control sequences for symbols, functions, and so on, and thus get proper formatting in the TeX output, at least.

The @sub and @sup commands described in the previous section produce subscripts and superscripts in HTML output as well as TeX; the plain TeX characters _ and ^ for subscripts and superscripts are recognized by TeX inside @math, but do nothing special in HTML or other output formats.

It’s best to use ‘\’ instead of ‘@’ for any such mathematical commands; otherwise, makeinfo will complain. On the other hand, makeinfo does allow input with matching (but unescaped) braces, such as ‘k_{75}’; it complains about such bare braces in regular input.

Here’s an example:

@math{\sin 2\pi \equiv \cos 3\pi}

which looks like the input in Info and HTML:

\sin 2\pi \equiv \cos 3\pi

Since ‘\’ is an escape character inside @math, you can use @\ to get a literal backslash (\\ will work in TeX, but you’d get the literal two characters ‘\\’ in Info). @\ is not defined outside of @math, since a ‘\’ ordinarily produces a literal (typewriter) ‘\’. You can also use @backslashchar{} in any mode to get a typewriter backslash. See Inserting a Backslash.

For displayed equations, you must at present use TeX directly (see Raw Formatter Commands).

Next: , Previous: , Up: Insertions   [Contents][Index]