uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use 'latex' as raw format rather than 'tex'

joshuahhh opened this issue · comments

Currently, Living Papers assumes raw tex code will be labeled with format 'tex' rather than 'latex'. This deviates from Pandoc's built-in / documented practice. Living Papers needs to explicitly rewrite the format:

const format = raw === 'latex' ? 'tex' : raw;

Also, the Pandoc documents refer to using {=latex} for a raw latex block.

Not sure why we should use 'tex' rather than 'latex', since 'latex' is the name we use for the output format elsewhere (like in latex:only, etc.). At the very least, I'd like this condition to include 'latex':

raw(ast) {
const format = getPropertyValue(ast, 'format');
if (format !== 'tex') {
return '';

Happy to make the change if desired.

I default to tex because that is what the Pandoc markdown parser produces by default (e.g., see this example).

Ideally everything could use latex to match the Living Papers output type name. One possibility would be to augment our Pandoc AST parser to simply map raw tex to raw latex. Alternatively, we could have both tex and latex map to the same semantics, though this might involve some new patches (possibly including to the recently added excludesNamespace AST utility). The first option feels "nicer" to me.