Adding code snippets to chapters

Inserting code snippets

Inserting code into the tutorial is done easily via drag&drop from an outline of the source code file.

Applying formats

There are several reasons why the standard way of inserting code is insufficient.

Predefined formats

There are predefined formats which can be applied to each compatible code snippet, e.g. header_only for methods to have their body replaced by {...}. To change the format of a code snippet do the following:

Custom formats

If more fine-grained control is necessary, a custom format can be created. Such a custom format is only available for the code snippet for which it has been created and cannot be applied to other code snippets.

It is also possible to edit and delete custom formats via the Edit and Delete buttons. Note that predefined formats can neither be edited nor deleted.