A group of notebook cells can be grouped together into an environment using the multicell functionality. This is done using a keyword, followed by a plus (+
). From that point on in the notebook all cells, including code and raw cells, are part of the multicell environment. The multicell is terminated using : keyword +
, after which cells behave as normal.
To prevent markdown cells from being executed, we will show the syntax using %%markdown
magic. After the example the rendered output is shown.
%%markdown
## Information+: Multicell information 1
Here is some information about multicells
The multicell is terminated using a colon and the corresponding keyword. (1)
:information+
The above doesn't really show much additional functionality, apart from adding a big indent to the additional cells. The real power of multicells is combining them with code and raw cells
%%markdown
## Information+: Multicell information 2
This is a raw cell
This is a simple Python3 code cell
import __hello__
This is the end of the multicell
:information+
It is even possible to nest multicells, given that they are distinct environments. However, we strongly discourage the use of the nesting functionality, and it may be removed in the future.