rst2ld enables the conversion of lecture slides authored in reStructuredText to LectureDoc2 format.
Version: August 22nd, 2024
- create a directory in which you want to store your slides; e.g.,
mkdir slides
- change to the directory:
cd slides
- initialize git:
git init
- add the LectureDoc2 and restructuredTextToLectureDoc2 projects as submodules:
git submodule add https://github.com/delors/LectureDoc2
git submodule add https://github.com/delors/reStructuredTextToLectureDoc2
add a script to (automatically) generate slides (e.g., https://github.com/Delors/Lectures/blob/main/generate-htmls.zsh)
add
docutils.conf
(e.g., https://github.com/Delors/Lectures/blob/main/docutils.conf) when necessary ; i.e., if you have mathematical (.. math::
) expressions in your slides and want to refer to a specific version of MathJax.add a
docutils.defs
(e.g., https://github.com/Delors/Lectures/blob/main/docutils.shared.defs) when you want to create a lecture material and want to (re)use a large number of usefull definitions across multiple documents.(You need to explicitly import the document in each presentation using:
.. include:: docutils.defs
- adapt the path if necessary).add
.gitignore
file with\*.rst.html
if you don't want to archive the generated web pages
In general, PDFs are generated by converting the HTML files to PDFs using a browser. As of 2024, Safari has the best support for printing HTML to PDF (don't use the Export as PDF...
feature; use Print
→ PDF
). Chrome works in most cases reasonably well, Firefox often fails miserably.
A script (https://github.com/Delors/Lectures/blob/main/generate-pdfs.zsh) for generating PDFs using Safari (tested on Mac OS 14 (Sonoma)) is available. This script requires that LectureDoc is found in the LectureDoc2
subfolder. This script basically automates Safari by simulating user input. Hence, don't use your Mac while the script is running.