LectureDoc is an authoring system for creating lecture material; i. e., lecture slides, notes and exercises from a single document.
A single LectureDoc document contains discussions of topis which are then used as templates for creating advanced slides as well as a standard document. LectureDoc is intended to be used in combination with rst2ld (reStructuredText to LectureDoc) which is a tool that converts reStructuredText documents into LectureDoc and makes authoring slides as easy as writing a text document.
This tutorial is written in reStructuredText (rst in the following) and can be used as a template for creating your own lecture slides. The code of this tutorial is available on GitHub: https://delors.github.io/reStructuredTextToLectureDoc2/ld_base_example.en.rst.html.
Prof. Dr. Michael Eichberg
A basic slide consists of a (section) header and some reStructuredText content.
Embed math equations using reStructuredText's default directive (.. math::) and role (:math:`...`).
A slide without a title can be created by explicitly creating an empty title.
Alternatively, you can use no-title in combination with the class directive if you want to include the slide in an index.
Example
1.. class:: no-title
23
I will only show up in an index...
4------------------------------------
Basic appear animations can be created using the (CSS) class incremental[1]. You can also define a corresponding custom role (.. role:: incremental) to animate parts of a text.
Example
1Animation
2----------
34
Basic *appear* animations can be created using the (CSS) class
5``incremental``. You can also define a corresponding custom role
6(``.. role:: incremental``) :incremental:`to animate parts of a text.`
78
.. example::
9:class: incremental
1011
...
Animation progress can be reset by pressing the r key.
In case of (un-)ordered lists (ol or ul in HTML) it is sufficient to associate the class incremental using the class directive with the list. It is also possible, to only specify the class attribute for the required list items.
Example
The following code:
1.. class:: incremental
23
- this
4- is
5- a test
Will render incrementally like this:
this
is
a test
The slide dimensions can be controlled by specifying the corresponding meta information. If not specified, the dimension is set to \(1920 \times 1200\) (default); i.e., a ratio of 16:10.
Example
In HTML documents add the following meta tag:
<meta name="slide-dimensions" content="1600x1200">
In reStructuredText documents add at the beginning:
.. meta::
:slide-dimensions: 1600x1200
Many functions in LectureDoc2 - e.g. persistence of the slide progress - require that a document is associated with a unique id. This id can be set using the meta directive. If no id is set, the respective functions are not available.
Example
1.. meta::
2:id: lecturedoc2-tutorial
3:description: LectureDoc2 Tutorial
4:author: Michael Eichberg
5:license: Released under the terms of the `2-Clause BSD license`.
Adding information that should not be on the slides, but provide additional information/explanations, can be added using the supplemental directive.
Example
1.. supplemental::
23
**Formatting Slides**
45
Formatting slides is done using classes and roles.
Formatting Slides
Creating heavily formatted slides is easily possible using rst directives and roles which are mapped to CSS classes.
Creating a slide which marks the beginning of a new section can be done using the new-section class.
Example
.. class:: new-section
Structuring Documents
----------------------
.. class:: new-subsection
Creating Sections
-----------------
Slide transitions can be controlled using the transition-... classes[2]:
transition-fade
transition-move-left
transition-move-to-top
transition-scale
transition-flip
Example
1.. class:: transition-move-to-top
23
Slide Transitions
4------------------
See the LectureDoc2 Cheat Sheet for a comprehensive list of predefined transitions.
Adding code can be done using reStructuredText's code directive.
Example
The following code:
1.. code:: python
2:number-lines:
34
for i in range(0,10):
5print(i)
Will render like this:
1for i in range(0,10):
2print(i)
Example
1LectureDoc2 supports links to external resources:
23
- https://github.com/Delors/LectureDoc2
4- `LectureDoc2 Sourcecode <https://github.com/Delors/LectureDoc2>`_
LectureDoc2 supports links to external resources:
The title of a slide can be used as a link target ➠ Advanced Formatting
An element which is explicitly marked as a target can be used as a link target:
Example
Slide with explicit marked-up element:
1Adv. Formatting
2---------------------
34
.. container:: incremental
56
.. _Link Target in Block:
78
See the LectureDoc2 Cheat Sheet.
References are defined as follows:
1Links to internal targets:
23
- Link to slide: `Adv. Formatting`_
4- Link to a marked-up element:
56
`Link Target in Block`_
Citations are fully supported in LectureDoc2.
A reference to a book: [Martin2017] (Details are found in the bibliography (see next slide)).
Example
A reference to a book: [Martin2017]_
Clean Architecture: A Craftsman's Guide to Software Structure and Design; Robert C. Martin, Addison-Wesley, 2017
...
Example
.. [Martin2017] Clean Architecture: ...; Robert C. Martin, Addison-Wesley, 2017
LectureDoc comes with a set of predefined (CSS) classes that can be used to format the slides. Some of these classes have explicit support by LectureDoc and will be rendered differently in the different situations (e.g., document view vs. slide view will render stacked layouts or supplemental information differently).
red
peripheral
obsolete
See the LectureDoc2 Cheat Sheet for a comprehensive list of predefined CSS classes.
Stacked layouts enables updating parts of a slide by putting the content into layers and then showing the layers incrementally.
Example
This text is gray.
.. deck:: monospaced
.. card::
:gray:`This text is gray.`
.. card:: overlay
.. raw:: html
<svg width="600" height="80">
⇥ ⇥<rect width="600" height="80"
⇥ ⇥ ⇥ ⇥ ⇥style="fill:rgb(0,0,255,0.25);
⇥ ⇥ ⇥ ⇥ ⇥ ⇥ ⇥ ⇥ stroke-width:1;
⇥ ⇥ ⇥ ⇥ ⇥ ⇥ ⇥ ⇥ stroke:rgb(0,0,0)" />
</svg>
Presenter notes can be added to a slide using the presenter-note directive.
A presenter note - including its presence - is only visible after entering the master password (press m and then enter: 123456).
Example
1.. presenter-note::
23
This is a presenter note.
45
It is only visible after entering the master password (123456).
Exercises can be integrated into the slide set.
Example
Exercise: 1+1
Compute: \(\sqrt 2 = ?\)
To unlock the solution go to the document view and enter the password (sqrt).
1.. exercise:: Exercise: 1+1
23
Compute: :math:`\sqrt 2 = ?`.
45
.. solution::
6:pwd: sqrt
78
Solution: :math:`1,4142135624`.
If you have multiple exercises, you can define a master password (123456) to unlock all solutions at once (press m to open the dialog).
.. meta::
:master-password: 123456
Example
1.. class:: padding-none no-title transition-scale
23
Image in the Background
4------------------------
56
.. deck::
78
.. card::
910
.. image:: ld_base_example/tag_cloud.png
11:width: 100%
12:align: center
1314
.. card:: overlay
1516
Content on the slide...