1.6. Inline Markup

If you want to make sure that text is shown in monospaced fonts for code examples or concepts, use double backticks around it. It looks like this on output.

the example
1
You can use **backticks** for showing ``highlighted`` code.
which gives

You can use backticks for showing highlighted code.

Refer to Inline markup added by Sphinx.

All the standard reStructuredText inline markups are quite simple, use:

  • one asterisk: *text* for emphasis (italics),

  • two asterisks: **text** for strong emphasis (boldface), and

  • backquotes: ``text`` for code samples as shown above (literal).

If asterisks or backquotes appear in running text and could be confused with inline markup delimiters, they have to be escaped with a backslash or encapsulated by Roles:

one escaped asterisk

the example
1
2
*italics \*with\* asterisk*,
**boldface \*with\* asterisk**
which gives

italics *with* asterisk, boldface *with* asterisk

two escaped asterisks

the example
1
2
*italics \*\*with\*\* asterisks*,
**boldface \*\*with\*\* asterisks**
which gives

italics **with** asterisks, boldface **with** asterisks,

two escaped backquotes

the example
1
2
*italics \`\`with\`\` backquotes*,
**boldface \`\`with\`\` backquotes**
which gives

italics ``with`` backquotes, boldface ``with`` backquotes

escaped backquote and asterisks

the example
1
:literal:`literal \`\`with\`\` backquotes **and** asterisks`
which gives

literal ``with`` backquotes **and** asterisks

Be aware of some restrictions of this markup:

  • it may not be nested (see nested inline markup in Docutils To Do List),

  • content may not start or end with whitespace: * text* is wrong,

  • it must be separated from surrounding text by non-word characters. Use a backslash escaped space to work around that: thisis\ **one**\ word (thisisoneword).