5.4 Inline Markup

The macros described in this section are used to mark just about anything interesting in the document text. They may be used in headings (though anything involving hyperlinks should be avoided there) as well as in the body text.

\bfcode {text}
Like \code, but also makes the font bold-face.

\cdata {name}
The name of a C-language variable.

\cfunction {name}
The name of a C-language function. name should include the function name and the trailing parentheses.

\character {char}
A character when discussing the character rather than a one-byte string value. The character will be typeset as with \samp.

\class {name}
A class name; a dotted name may be used.

\code {text}
A short code fragment or literal constant value. Typically, it should not include any spaces since no quotation marks are added.

\constant {name}
The name of a ``defined'' constant. This may be a C-language #define or a Python variable that is not intended to be changed.

\ctype {name}
The name of a C typedef or structure. For structures defined without a typedef, use \ctype{struct struct_tag} to make it clear that the struct is required.

\deprecated {version}{what to do}
Declare whatever is being described as being deprecated starting with release version. The text given as what to do should recommend something to use instead.

\dfn {term}
Mark the defining instance of term in the text. (No index entries are generated.)

Produces a backslash. This is convenient in \code and similar macros.

\email {address}
An email address. Note that this is not hyperlinked in any of the possible output formats. The domain name portion of the address should be lower case.

\emph {text}
Emphasized text; this will be presented in an italic font.

\envvar {name}
An environment variable. Index entries are generated.

\exception {name}
The name of an exception. A dotted name may be used.

\file {file or dir}
The name of a file or directory. In the PDF and PostScript outputs, single quotes and a font change are used to indicate the file name, but no quotes are used in the HTML output.

\filenq {file or dir}
Like \file, but single quotes are never used. This can be used in conjunction with tables if a column will only contain file or directory names.

\function {name}
The name of a Python function; dotted names may be used.

\kbd {key sequence}
Mark a sequence of keystrokes. What form key sequence takes may depend on platform- or application-specific conventions. For example, an xemacs key sequence may be marked like \kbd{C-x C-f}.

\keyword {name}
The name of a keyword in a programming language.

\makevar {name}
The name of a make variable.

\manpage {name}{section}
A reference to a Unix manual page.

\member {name}
The name of a data attribute of an object.

\method {name}
The name of a method of an object. name should include the method name and the trailing parentheses. A dotted name may be used.

\mimetype {name}
The name of a MIME type.

\module {name}
The name of a module; a dotted name may be used.

\newsgroup {name}
The name of a USENET newsgroup.

\program {name}
The name of an executable program. This may differ from the file name for the executable for some platforms. In particular, the .exe (or other) extension should be omitted for DOS and Windows programs.

\refmodule [key]{name}
Like \module, but create a hyperlink to the documentation for the named module. Note that the corresponding \declaremodule must be in the same document. If the \declaremodule defines a module key different from the module name, it must also be provided as key to the \refmodule macro.

\regexp {string}
Mark a regular expression.

\rfc {number}
A reference to an Internet Request for Comments. This generates appropriate index entries. The text "RFC number" is generated; in the HTML output, this text is a hyperlink to an online copy of the specified RFC.

\samp {text}
A short code sample, but possibly longer than would be given using \code. Since quotation marks are added, spaces are acceptable.

\strong {text}
Strongly emphasized text; this will be presented using a bold font.

\url {url}
A URL (or URN). The URL will be presented as text. In the HTML and PDF formatted versions, the URL will also be a hyperlink. This can be used when referring to external resources. Note that many characters are special to and this macro does not always do the right thing. In particular, the tilde character ("~") is mis-handled; encoding it as a hex-sequence does work, use "%7e" in place of the tilde character.

\var {name}
The name of a variable or formal parameter in running text.

The version number for the documentation, as specified using \release in the preamble.

Send comments on this document to python-docs@python.org.