π FiltersΒΆ
Behind the scenes, in2lambda makes use of pandoc filters to parse the question files.
Why not manually parse the questions?
Parsing LaTeX is inherently difficult. See here for a full explanation.
Some potential complications include custom libraries, macros that have different meanings depending on context and nested expressions.
Pandoc helps deal with this by quickly generating a standardised JSON format that abstracts away a lot of unnecessary details. This allows us to write simpler, Pythonic parsers for many different file formats.
Different filters should be used depending on the structure of the question file. For instance, maybe the solutions come directly after a part, or maybe there arenβt any answers provided at all!
Please see the specific pages on each filter for more information: