Other Inline Markup

Interstitial Heading

A rubric is rendered as an interstitial heading but does not become part of the structural hierarchy of the document. Useful for marking the footnotes section at the end of a page.

Source:

This is a paragraph.

.. rubric:: This is a rubric

This is another paragraph.

Result:

This is a paragraph.

This is a rubric

This is another paragraph.

References:

Superscript

Preferred: :sup:`...`

Synonyms: :superscript:`...`

Source:

Plot the parabola y = x :sup:`2` + 1.

Result:

Plot the parabola y = x 2 + 1.

References:

Subscript

Preferred: :sub:`...`

Synonyms: :subscript:`...`

Source:

Water is H :sub:`2` O.

Result:

Water is H 2 O.

References:

Title Reference

Used for the title of a book, periodical, etc.

Preferred: :title-reference:`...`

Synonyms: :title:`...`, :t:`...`

Source:

:title-reference:`Design Patterns` is a great book.

Result:

Design Patterns is a great book.

References:

Semantic Markup

Note

These roles are part of Sphinx.

Sphinx defines a number of roles for semantic markup.

:abbr:`AAA (expansion of AAA)`

Abbreviation and expansion.

:abbr:`FTP (File Transfer Protocol)` -> FTP

:command:`...`

OS-level command.

:command:`rm` -> rm

:dfn:`...`

Defining instance of a term.

:dfn:`LOCKSS` -> LOCKSS

:file:`...`

File or directory name.

Within the contents, you can use curly braces to indicate a variable part

:file:`/usr/lib/python2.{x}/site-packages` -> /usr/lib/python2.x/site-packages

:guilabel:`...`

UI labels (button text, field name…)

Within the contents, an accelerator key can be marked specially by preceding it with an ampersand (two ampersands result in a literal ampersand).

:guilabel:`&Cancel` -> Cancel

:kbd:`...`

Sequence of keystrokes.

:kbd:`Control + Alt + Delete` -> Control + Alt + Delete

:mailheader:`...`

Mail or HTTP header.

:mailheader:`Content-Type` -> Content-Type

:manpage:`COMMAND(N)`

Unix man page and section

:manpage:`ls(1)` -> ls(1)

:menuselection:

A menu selection sequence, separated by -->.

Supports ampersand accelerators like :guilabel:.

:menuselection:`Edit --> Copy` -> Edit ‣ Copy

:mimetype:

Media type, or major or minor portion of a media type.

:mimetype:`text/html` -> text/html

:program:

Executable program.

:program:`configure.sh` -> configure.sh

:regexp:

Regular expression.

:regexp:`^ab*c$` -> ^ab*c$

:samp:

Piece of sample text.

Within the contents, you can use curly braces to indicate a variable part, as in :file:. Curly braces are escaped with a backslash.

:samp:`print {variable} + 1` -> :samp:`print {variable} + 1`

Notes:

  • :guilabel: seems to have bugs. In HTML output, the accelerator key surrounds the affected character with a distinguishable <span> but seemingly not resulting in a different visual. In PDF output, the double ampersand remains without being escaped to a single ampersand.

References: