Next: , Previous: Conditional Not Commands, Up: Conditionals


17.3 Raw Formatter Commands

Inside a region delineated by @iftex and @end iftex, you can embed some raw TeX commands. The Texinfo processors will ignore such a region unless TeX output is being produced. You can write the TeX commands as you would write them in a normal TeX file, except that you must replace the `\' used by TeX with an `@'. For example, in the @titlepage section of a Texinfo file, you can use the TeX command @vskip to format the copyright page. (The @titlepage command causes Info to ignore the region automatically, as it does with the @iftex command.)

However, most features of plain TeX will not work within @iftex, as they are overridden by Texinfo features. The purpose of @iftex is to provide conditional processing for the Texinfo source, not provide access to underlying formatting features.

You can enter plain TeX completely, and use `\' in the TeX commands, by delineating a region with the @tex and @end tex commands. All plain TeX commands and category codes are restored within an @tex region. The sole exception is that the @ character still introduces a command, so that @end tex can be recognized properly. As with @iftex, Texinfo processors will ignore such a region unless TeX output is being produced.

In complex cases, you may wish to define new TeX macros within @tex. You must use \gdef to do this, not \def, because @tex regions are processed in a TeX group.

As an example, here is a mathematical expression written in plain TeX:

     @tex
     $$ \chi^2 = \sum_{i=1}^N
              \left (y_i - (a + b x_i)
              \over \sigma_i\right)^2 $$
     @end tex

The output of this example will appear only in a printed manual. If you are reading this in Info, you will not see the equation that appears in the printed manual.

Analogously, you can use @ifhtml ... @end ifhtml to delimit a region to be included in HTML output only, and @html ... @end html for a region of raw HTML.

Likewise, you can use @ifxml ... @end ifxml to delimit a region to be included in XML output only, and @xml ... @end xml for a region of raw XML.

Again likewise, you can use @ifdocbook ... @end ifdocbook to delimit a region to be included in Docbook output only, and @docbook ... @end docbook for a region of raw Docbook.

In all cases, the exception to the raw processing is that @ is still an escape character, so the @end command can be recognized.