<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>6.5 Inline Markup </title> <META NAME="description" CONTENT="6.5 Inline Markup "> <META NAME="keywords" CONTENT="doc"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <meta http-equiv="Content-Type" content="text/html; charset="> <link rel="STYLESHEET" href="doc.css"> <link rel="first" href="doc.html"> <link rel="contents" href="contents.html" title="Contents"> <LINK REL="next" href="misc-text-markup.html"> <LINK REL="previous" href="showing-examples.html"> <LINK REL="up" href="special-constructs.html"> <LINK REL="next" href="misc-text-markup.html"> </head> <body> <DIV CLASS="navigation"> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A href="showing-examples.html"><img src="../icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="special-constructs.html"><img src="../icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="misc-text-markup.html"><img src="../icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Documenting Python</td> <td><A href="contents.html"><img src="../icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><img src="../icons/blank.gif" border="0" height="32" alt="" width="32"></td> <td><img src="../icons/blank.gif" border="0" height="32" alt="" width="32"></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" href="showing-examples.html">6.4 Showing Code Examples</A> <b class="navlabel">Up:</b> <a class="sectref" href="special-constructs.html">6 Special Markup Constructs</A> <b class="navlabel">Next:</b> <a class="sectref" href="misc-text-markup.html">6.6 Miscellaneous Text Markup</A> <br><hr> </DIV> <!--End of Navigation Panel--> <H2><A NAME="SECTION000750000000000000000"> </A> <BR> 6.5 Inline Markup </H2> <P> 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. <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\bfcode</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> Like <tt class='macro'>\code</tt>, but also makes the font bold-face. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\cdata</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a C-language variable. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\cfunction</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a C-language function. <var>name</var> should include the function name and the trailing parentheses. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\character</tt></b> <tt>{</tt><var>char</var><tt>}</tt> <dd> A character when discussing the character rather than a one-byte string value. The character will be typeset as with <tt class='macro'>\samp</tt>. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\citetitle</tt></b> <tt>[</tt><var>url</var><tt>]</tt><tt>{</tt><var>title</var><tt>}</tt> <dd> A title for a referenced publication. If <var>url</var> is specified, the title will be made into a hyperlink when formatted as HTML. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\class</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> A class name; a dotted name may be used. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\code</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> A short code fragment or literal constant value. Typically, it should not include any spaces since no quotation marks are added. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\constant</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a ``defined'' constant. This may be a C-language <code>#define</code> or a Python variable that is not intended to be changed. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\ctype</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a C <tt class="keyword">typedef</tt> or structure. For structures defined without a <tt class="keyword">typedef</tt>, use <code>\ctype{struct struct_tag}</code> to make it clear that the <tt class="keyword">struct</tt> is required. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\deprecated</tt></b> <tt>{</tt><var>version</var><tt>}</tt><tt>{</tt><var>what to do</var><tt>}</tt> <dd> Declare whatever is being described as being deprecated starting with release <var>version</var>. The text given as <var>what to do</var> should recommend something to use instead. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\dfn</tt></b> <tt>{</tt><var>term</var><tt>}</tt> <dd> Mark the defining instance of <var>term</var> in the text. (No index entries are generated.) </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\e</tt></b> <dd> Produces a backslash. This is convenient in <tt class='macro'>\code</tt> and similar macros, and is only defined there. To create a backslash in ordinary text (such as the contents of the <tt class='macro'>\file</tt> macro), use the standard <tt class='macro'>\textbackslash</tt> macro. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\email</tt></b> <tt>{</tt><var>address</var><tt>}</tt> <dd> An email address. Note that this is <i>not</i> hyperlinked in any of the possible output formats. The domain name portion of the address should be lower case. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\emph</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> Emphasized text; this will be presented in an italic font. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\envvar</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> An environment variable. Index entries are generated. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\exception</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of an exception. A dotted name may be used. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\file</tt></b> <tt>{</tt><var>file or dir</var><tt>}</tt> <dd> 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. <span class="warning"><b class="label">Warning:</b> The <tt class='macro'>\file</tt> macro cannot be used in the content of a section title due to processing limitations.</span> </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\filenq</tt></b> <tt>{</tt><var>file or dir</var><tt>}</tt> <dd> Like <tt class='macro'>\file</tt>, but single quotes are never used. This can be used in conjunction with tables if a column will only contain file or directory names. <span class="warning"><b class="label">Warning:</b> The <tt class='macro'>\filenq</tt> macro cannot be used in the content of a section title due to processing limitations.</span> </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\function</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a Python function; dotted names may be used. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\infinity</tt></b> <dd> The symbol for mathematical infinity: ∞. Some Web browsers are not able to render the HTML representation of this symbol properly, but support is growing. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\kbd</tt></b> <tt>{</tt><var>key sequence</var><tt>}</tt> <dd> Mark a sequence of keystrokes. What form <var>key sequence</var> takes may depend on platform- or application-specific conventions. When there are no relevant conventions, the names of modifier keys should be spelled out, to improve accessibility for new users and non-native speakers. For example, an <b class="program">xemacs</b> key sequence may be marked like <code>\kbd{C-x C-f}</code>, but without reference to a specific application or platform, the same sequence should be marked as <code>\kbd{Control-x Control-f}</code>. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\keyword</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a keyword in a programming language. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\mailheader</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of an <a class="rfc" name="rfcref-2325" href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>-style mail header. This markup does not imply that the header is being used in an email message, but can be used to refer to any header of the same ``style.'' This is also used for headers defined by the various MIME specifications. The header name should be entered in the same way it would normally be found in practice, with the camel-casing conventions being preferred where there is more than one common usage. The colon which follows the name of the header should not be included. For example: <code>\mailheader{Content-Type}</code>. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\makevar</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a <b class="program">make</b> variable. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\manpage</tt></b> <tt>{</tt><var>name</var><tt>}</tt><tt>{</tt><var>section</var><tt>}</tt> <dd> A reference to a Unix manual page. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\member</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a data attribute of an object. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\method</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a method of an object. <var>name</var> should include the method name and the trailing parentheses. A dotted name may be used. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\mimetype</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a MIME type, or a component of a MIME type (the major or minor portion, taken alone). </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\module</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a module; a dotted name may be used. This should also be used for package names. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\newsgroup</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a Usenet newsgroup. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\note</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> An especially important bit of information about an API that a user should be aware of when using whatever bit of API the note pertains to. This should be the last thing in the paragraph as the end of the note is not visually marked in any way. The content of <var>text</var> should be written in complete sentences and include all appropriate punctuation. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\pep</tt></b> <tt>{</tt><var>number</var><tt>}</tt> <dd> A reference to a Python Enhancement Proposal. This generates appropriate index entries. The text "<tt class="samp">PEP <var>number</var></tt>" is generated; in the HTML output, this text is a hyperlink to an online copy of the specified PEP. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\plusminus</tt></b> <dd> The symbol for indicating a value that may take a positive or negative value of a specified magnitude, typically represented by a plus sign placed over a minus sign. For example: <code>\plusminus 3%</code>. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\program</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of an executable program. This may differ from the file name for the executable for some platforms. In particular, the <span class="file">.exe</span> (or other) extension should be omitted for DOS and Windows programs. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\programopt</tt></b> <tt>{</tt><var>option</var><tt>}</tt> <dd> A command-line option to an executable program. Use this only for ``shot'' options, and include the leading hyphen. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\longprogramopt</tt></b> <tt>{</tt><var>option</var><tt>}</tt> <dd> A long command-line option to an executable program. This should only be used for long option names which will be prefixed by two hyphens; the hyphens should not be provided as part of <var>option</var>. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\refmodule</tt></b> <tt>[</tt><var>key</var><tt>]</tt><tt>{</tt><var>name</var><tt>}</tt> <dd> Like <tt class='macro'>\module</tt>, but create a hyperlink to the documentation for the named module. Note that the corresponding <tt class='macro'>\declaremodule</tt> must be in the same document. If the <tt class='macro'>\declaremodule</tt> defines a module key different from the module name, it must also be provided as <var>key</var> to the <tt class='macro'>\refmodule</tt> macro. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\regexp</tt></b> <tt>{</tt><var>string</var><tt>}</tt> <dd> Mark a regular expression. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\rfc</tt></b> <tt>{</tt><var>number</var><tt>}</tt> <dd> A reference to an Internet Request for Comments. This generates appropriate index entries. The text "<tt class="samp">RFC <var>number</var></tt>" is generated; in the HTML output, this text is a hyperlink to an online copy of the specified RFC. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\samp</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> A short code sample, but possibly longer than would be given using <tt class='macro'>\code</tt>. Since quotation marks are added, spaces are acceptable. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\shortversion</tt></b> <dd> The ``short'' version number of the documented software, as specified using the <tt class='macro'>\setshortversion</tt> macro in the preamble. For Python, the short version number for a release is the first three characters of the <code>sys.version</code> value. For example, versions 2.0b1 and 2.0.1 both have a short version of 2.0. This may not apply for all packages; if <tt class='macro'>\setshortversion</tt> is not used, this produces an empty expansion. See also the <tt class='macro'>\version</tt> macro. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\strong</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> Strongly emphasized text; this will be presented using a bold font. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\ulink</tt></b> <tt>{</tt><var>text</var><tt>}</tt><tt>{</tt><var>url</var><tt>}</tt> <dd> A hypertext link with a target specified by a URL, but for which the link text should not be the title of the resource. For resources being referenced by name, use the <tt class='macro'>\citetitle</tt> macro. Not all formatted versions support arbitrary hypertext links. Note that many characters are special to <SPAN CLASS="logo,LaTeX">L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X</SPAN> and this macro does not always do the right thing. In particular, the tilde character ("<tt class="character">~</tt>") is mis-handled; encoding it as a hex-sequence does work, use "<tt class="samp">%7e</tt>" in place of the tilde character. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\url</tt></b> <tt>{</tt><var>url</var><tt>}</tt> <dd> 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 without specific titles; references to resources which have titles should be marked using the <tt class='macro'>\citetitle</tt> macro. See the comments about special characters in the description of the <tt class='macro'>\ulink</tt> macro for special considerations. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\var</tt></b> <tt>{</tt><var>name</var><tt>}</tt> <dd> The name of a variable or formal parameter in running text. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\version</tt></b> <dd> The version number of the described software, as specified using <tt class='macro'>\release</tt> in the preamble. See also the <tt class='macro'>\shortversion</tt> macro. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\versionadded</tt></b> <tt>[</tt><var>explanation</var><tt>]</tt><tt>{</tt><var>version</var><tt>}</tt> <dd> The version of Python which added the described feature to the library or C API. <var>explanation</var> should be a <i>brief</i> explanation of the change consisting of a capitalized sentence fragment; a period will be appended by the formatting process. This is typically added to the end of the first paragraph of the description before any availability notes. The location should be selected so the explanation makes sense and may vary as needed. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\versionchanged</tt></b> <tt>[</tt><var>explanation</var><tt>]</tt><tt>{</tt><var>version</var><tt>}</tt> <dd> The version of Python in which the named feature was changed in some way (new parameters, changed side effects, etc.). <var>explanation</var> should be a <i>brief</i> explanation of the change consisting of a capitalized sentence fragment; a period will be appended by the formatting process. This is typically added to the end of the first paragraph of the description before any availability notes and after <tt class='macro'>\versionadded</tt>. The location should be selected so the explanation makes sense and may vary as needed. </dl> <P> <dl class='macrodesc'> <dt><b><tt class='macro'>\warning</tt></b> <tt>{</tt><var>text</var><tt>}</tt> <dd> An important bit of information about an API that a user should be very aware of when using whatever bit of API the warning pertains to. This should be the last thing in the paragraph as the end of the warning is not visually marked in any way. The content of <var>text</var> should be written in complete sentences and include all appropriate punctuation. This differs from <tt class='macro'>\note</tt> in that it is recommended over <tt class='macro'>\note</tt> for information regarding security. </dl> <P> <DIV CLASS="navigation"> <p><hr> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A href="showing-examples.html"><img src="../icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="special-constructs.html"><img src="../icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="misc-text-markup.html"><img src="../icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Documenting Python</td> <td><A href="contents.html"><img src="../icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><img src="../icons/blank.gif" border="0" height="32" alt="" width="32"></td> <td><img src="../icons/blank.gif" border="0" height="32" alt="" width="32"></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" href="showing-examples.html">6.4 Showing Code Examples</A> <b class="navlabel">Up:</b> <a class="sectref" href="special-constructs.html">6 Special Markup Constructs</A> <b class="navlabel">Next:</b> <a class="sectref" href="misc-text-markup.html">6.6 Miscellaneous Text Markup</A> <hr> <span class="release-info">Release 2.2, documentation updated on December 21, 2001.</span> </DIV> <!--End of Navigation Panel--> <ADDRESS> See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. </ADDRESS> </BODY> </HTML>