Next: , Previous: , Up: Special Characters   [Contents][Index]

14.1.4 Inserting ‘\’ with @backslashchar{}

Ordinarily, a backslash ‘\’ is a normal character in Texinfo that can be simply typed in your input where you need it. The result is to typeset the backslash from the typewriter font.

However, Texinfo uses the backslash as a special character in one restricted context: to delimit formal arguments in the bodies of user-defined macros (see Defining Macros).

Due to the vagaries of macro argument parsing, it is more reliable to pass an alphabetic command that produces a backslash instead of using a literal \. Hence @backslashchar{}. Here is an example macro call:

@mymac{One argument@backslashchar{} with a backslash}

Texinfo documents may also use \ as a command character inside @math (see Inserting Math). In this case, @\ or \backslash produces a “math” backslash (from the math symbol font), while @backslashchar{} produces a typewriter backslash as usual.

Although ‘@backslashchar{}’ can be used nearly anywhere, there is no need for it except in these unusual cases.