All Projects → cagix → pandoc-lecture

cagix / pandoc-lecture

Licence: MIT license
This project defines a skeleton repo for creating lecture slides and handouts including lecture notes out of Pandoc Markdown (http://pandoc.org/MANUAL.html) using a single source approach.

Programming Languages

lua
6591 projects
TeX
3793 projects
CSS
56736 projects
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to pandoc-lecture

paru
Control pandoc with Ruby and write pandoc filters in Ruby
Stars: ✭ 30 (-58.33%)
Mutual labels:  pandoc, pandoc-filter
dsge
Course on Dynamic Stochastic General Equilibrium (DSGE): Models, Solution, Estimation (graduate level)
Stars: ✭ 41 (-43.06%)
Mutual labels:  exams, teaching-materials
pandoc-placetable
Pandoc filter to include CSV data (from file or URL)
Stars: ✭ 35 (-51.39%)
Mutual labels:  pandoc, pandoc-filter
citeproc-rs
CSL processor in Rust.
Stars: ✭ 56 (-22.22%)
Mutual labels:  pandoc, pandoc-filter
pandoc-include
Pandoc filter to allow file and header includes
Stars: ✭ 35 (-51.39%)
Mutual labels:  pandoc, pandoc-filter
pandoc-amsthm
provide a syntax to use amsthm environments in pandoc, with output in LaTeX and HTML
Stars: ✭ 19 (-73.61%)
Mutual labels:  pandoc, pandoc-filter
dotpandoc
Pandoc Data directory, including customised filters and templates for producing multiple outputs for academic content.
Stars: ✭ 44 (-38.89%)
Mutual labels:  pandoc, pandoc-filter
reinforcement learning course materials
Lecture notes, tutorial tasks including solutions as well as online videos for the reinforcement learning course hosted by Paderborn University
Stars: ✭ 765 (+962.5%)
Mutual labels:  lecture-notes, teaching-materials
android-lecture
android lecture notes
Stars: ✭ 25 (-65.28%)
Mutual labels:  lecture-notes
Python-Fundamentals
Jupyter Notebooks for How to Think Like a Computer Scientist - Learning with Python 3 (RLE) Textbook
Stars: ✭ 30 (-58.33%)
Mutual labels:  teaching-materials
42-piscine-exam
This repo has all exercises of "C Exam Alone In The Dark - Beginner" sorted from level_00 to Level_05
Stars: ✭ 218 (+202.78%)
Mutual labels:  exams
2018-datascience-lectures
Lecture content for Intro to Data Science 2018
Stars: ✭ 32 (-55.56%)
Mutual labels:  lecture-notes
DLAIE
Materials for Hawley's Deep Learning & AI Ethics course
Stars: ✭ 27 (-62.5%)
Mutual labels:  teaching-materials
dissertation-story
My philosophy dissertation + cloud backup + version control. Written in plaintext Markdown with Sublime Text 3.
Stars: ✭ 14 (-80.56%)
Mutual labels:  pandoc
learningspoons
nlp lecture-notes and source code
Stars: ✭ 29 (-59.72%)
Mutual labels:  lecture-notes
marked-man
Read Markdown files like UNIX man pages
Stars: ✭ 16 (-77.78%)
Mutual labels:  pandoc
my-writing-workflow
Tutorial for converting markdown files in to APA-formatted docs, based on my workflow.
Stars: ✭ 35 (-51.39%)
Mutual labels:  pandoc
2018-dlsl
UPC Deep Learning for Speech and Language 2018
Stars: ✭ 18 (-75%)
Mutual labels:  teaching-materials
5
Lectures and computer labs storage for IW5 course at FIT VUT.
Stars: ✭ 32 (-55.56%)
Mutual labels:  lecture-notes
awesome-academic-writing
MERGED with https://github.com/writing-resources/awesome-scientific-writing
Stars: ✭ 39 (-45.83%)
Mutual labels:  pandoc

Pandoc Markdown Lecture Template

This project defines a skeleton repo for creating lecture material, i.e. slides and handouts including lecture notes, homework sheets plus the corresponding evaluation sheets and exams plus solution sheets out of Pandoc Markdown using a single source approach.

History

Slides and Handouts

Originally TeX Live and the beamer class were used to produce slides in PDF format for lecture. A nice handout as article (i.e. not just 2 or 4 slides on a page) in PDF format with additional comments could easily be generated out of the slide source code by adding the \usepackage{beamerarticle} option.

However, there are a few drawbacks:

  • The TeX overhead is particularly high in this scenario: estimated 50 to 80 percent of the slides source code is just TeX code (defining slides and header, defining bullet point lists, ...).
  • Comments, that should appear in the handout, are limited. There is a \note command available in beamer, but using it for larger texts including code listings and headers is rather inconvenient or even impossible.
  • Most students would read the handout using a tablet or an e-book reader, so PDF is not really a suitable format for handouts. HTML or even EPUB would be a much more appropriate choice for this task. There are a number of projects addressing this (e.g. LaTeX2HTML, Hyperlatex, TeX4ht), but the resulting HTML is not really satisfying, and EPUB generation is not even supported.

Using Pandoc Markdown most of the standard TeX structures can be written in a much shorter way. Since Pandoc does not parse Markdown contained in TeX environments, all \begin{XXX} and \end{XXX} commands need to be replaced using redefinitions like \newcommand{\XXXbegin}{\begin{XXX}}.

Also by introducing a notes block/inline (using fenced Divs, new in Pandoc 2.x) in combination with a custom Pandoc filter, the lecture notes can be placed freely at any location in the material. Using the filter the lecture notes do not appear in the slides but in the handout. The lecture notes can contain any valid Markdown or TeX code, even further (sub-) sections.

Pandoc can convert Markdown also to HTML and EPUB. Thus a single source can be used to create lecture slides (PDF) and handouts (HTML/EPUB). Even slide desks in HTML using e.g. reveal.js would be possible.

Homework Sheets

Originally TeX Live and the exam class were used to produce homework sheets in PDF format.

However, there are a few drawbacks:

  • The overhead stemming from the exam class is quite high in this scenario.
  • Generating an evaluation sheet from the homework sheet is not supported by the exam class.

Much of the code required by the exam class (and also quite some TeX code) can be omitted by using Pandoc Markdown. Thus the homework sheets can be written in a much simpler way, saving quite some time.

Deriving an evaluation sheet from the homework sheet can be done by using Pandoc in combination with a customised template.

A Pandoc filter adds up all points (like the functionality provided by the exam class).

Since LaTeX is still used as back end, all TeX macros could be used.

Exams

Originally TeX Live and the exam class were used to produce exams and corresponding solution sheets in PDF format.

Using Pandoc Markdown the task of creating exams with the exam class can be simplified. Since LaTeX is still used as back end, all TeX macros could be used.

Notes on Pandoc Filters

Since LaTeX is still used as back end when creating slides, all TeX macros could be used.

Pandoc 2.x includes a Lua interpreter, thus there is no need anymore to install a separate (matching!) python filter module.

Slides and Handouts

To create HTML output, the TeX code needs to be replaced with appropriate HTML code. This is achieved by the filter html.lua, which transforms the AST created by Pandoc parsing the input document before Pandoc converts it to the specified output format.

To remove the lecture notes from the beamer slides and to transform fenced Divs and inline Spans to TeX macros, the filter tex.lua is used.

Homework Sheets

The filter addpoints.lua is used to calculate the overall sum of points.

It searches for any header having a "punkte"/value pair in its attribute list. The value will be added to the overall sum.

Example for a task with 2 points:

    # Task A {punkte=2}

If there is a meta variable points available in the documents meta data, the calculated sum will be compared to the value of the meta variable. If there is any difference, a warning will be issued.

Example for a homework sheet with an expected overall sum of 10 points:

    ---
    title: "Blatt 1: Short Summary"
    author: "Author, Institute"
    points: 10
    ...

The filter questions.lua collects all headers with a "punkte"/value attribute and writes this list to the meta data of the document (meta variable questions). This list is used in the evaluation sheet template to generate the appropriate structures.

Notes on TeX Math

To deal with TeX math, a number of options exist:

  • MathML could work (even offline), but is not supported by at least one major browser.
  • Rendering the math to images and embedding it into the result. Works well (even offline), but there are some issues regarding the used font, font size and font/background colours.
  • JavaScript libraries like MathJax or KaTeX can be used to render math within the browser. However, you would need Internet connectivity, as currently Pandoc can not embed MathJax into the generated output and embedding KaTeX yields in rather huge files.

Currently, MathJax is used for HTML output in this project (option --mathjax). To prevent Pandoc from incorporating MathJax into the generated self-contained HTML document (it is quite large and it won't work properly this way), the URL to MathJax is included via a separate file.

Since most current e-book readers do not support MathML and are usually used without Internet connectivity, math is converted to embedded images using the --webtex option of Pandoc for EPUB output.

Installing and running

  1. If you have not already done so, install:

  2. Either install also the following programs and packages:

    Or use the dockerfile contained in the docker/ subdirectory to create a docker image, which should contain all the tools and tex packages mentioned above ... (about 800 MiB)

  3. Create a working directory for your project and change into it.

  4. Clone this repo using git clone https://github.com/cagix/pandoc-lecture lecture (or add it as git submodule to your project).

  5. Change to the lecture/ directory. Adapt the DATADIR variable in the makefiles (demo subdir): It should point to the root directory of this project, i.e. to the folder containing the subfolders filters, resources and demo.

    Build the demo using make -f Makefile.lecture (slides and handout) or make -f Makefile.homework (homework sheet) or make -f Makefile.exams (exams).

    Have a look at the examples in lecture/demo/. Some of the features are demonstrated and explained in the markdown source.

Notes and Versions

This project is supposed to be used with Pandoc 2.19 or later.

Contributing

Questions, bug reports, feature requests and pull requests are very welcome. Please be sure to read the contributor guidelines before opening a new issue.


License

This work by Carsten Gips and contributors is licensed under MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].