6. Playground

Try various .rst/Sphinx features here.

\(x+1+2\) is inline in math mode (with role).

\[x+1+2 = x+3~\text{is math mode block with directive}\]

One can use links to, e.g., Google, or add some footnotes [1], which can be tricky because of their positioning.

Also, you can reference previously defined labels with ease, or at least in a consistent way. Sadly, there is a lot of white space in .rst, and the markup is quite cumbersome to remember.

You can also add some code with a nice code block (learn more about the possible options and available languages):

Listing 6.1 A very nice code block
int main(void){
   return 0;
}

There are images as well.

A picture of this .rst file

Figure 6.1 Some random caption.

This is the most obscure table syntax I know:

Table 6.1 Frozen Delights!

Treat

Quantity

Description

Albatross

2.99

On a stick!

Crunchy Frog

1.49

If we took the bones out, it wouldn’t be crunchy, now would it?

Gannet Ripple

1.99

On a stick!

Luckily, we can also use a more natural table syntax.

Table 6.2 Like this

A

B

1

1

0

1

And even

Table 6.3 Frozen Delights!

Treat

Quantity

Description

Albatross

2.99

On a stick!

Crunchy Frog

1.49

If we took the bones out, it wouldn’t be crunchy, now would it?

Gannet Ripple

1.99

On a stick!

Really neat: Display keyboard shortcuts in a dedicated font: Ctrl+C. Formatting is strange, you can make things italic or bold, but other than that, I do not know.

Also, possibly interesting: we could have some .rst definition file with a lot of definitions that can be re-used, e.g., \(r\) or \(\tau\).

The .rst format defines various header levels. These are as follows.

Level 0
====================================================================================

Level 1
------------------------------------------------------------------------------------

Level 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Level 3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Level 4
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Level 5
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Level 6
************************************************************************************

We can also make lists, for example

  • With bullets

  • and more bullets

or with numbers, either

  1. explicit, but then we have to take care that we

  2. keep the numbering,

  3. or it will be a syntax error,

or

  1. implicit. Either way, we cannot skip

  2. things