You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
myst-cli has introduced functionality to export myst files as tex/pdf/docx from the command line
tex/pdf exports allow you to specify a latex template to customize the output. There are already a number of templates available: https://github.com/myst-templates. These are totally standalone, with a template.yml config (defining template metadata, required frontmatter fields, and additional template options), a nunjuks-style template to use, and all additional supplementary files (icons, latex document classes, etc).
jtex validates user input against the template options and fills in the template based on these options, myst frontmatter, and tex content (converted with myst-to-tex)
docx templating, however, requires passing in a renderer function (since we use docx to generate the document). It can take additional template options (and these can be defined in a template.yml file), but there is nothing like jtex validating these options and holding it all together.
Additionally, there is no easy way to define additional static files required by the renderer...
Proposal
I don't think we should move away from using the docx library for now. This would require writing valid docx nunjuks-style templates in XML, doesn't feel great, but certainly a future possibility.
For now it would be great to at least:
validate options based on a template.yml
bundle static files together with the template.yml
connect this template to the renderer function so they are used together
This means teasing apart the template download / validation part of jtex from the tex-specific rendering, and updating the docx build to consume a template package using the non-tex part of jtex.
Tasks and updates
No response
The text was updated successfully, but these errors were encountered:
Some other things that I noticed after the merge is that the current docx template still has a curvenote footer on it. We should fix that up and provide some extensibility there.
Context
myst-cli
has introduced functionality to export myst files as tex/pdf/docx from the command linetemplate.yml
config (defining template metadata, required frontmatter fields, and additional template options), a nunjuks-style template to use, and all additional supplementary files (icons, latex document classes, etc).jtex
validates user input against the template options and fills in the template based on these options, myst frontmatter, and tex content (converted withmyst-to-tex
)renderer
function (since we use docx to generate the document). It can take additional template options (and these can be defined in atemplate.yml
file), but there is nothing likejtex
validating these options and holding it all together.Proposal
docx
library for now. This would require writing valid docx nunjuks-style templates in XML, doesn't feel great, but certainly a future possibility.template.yml
template.yml
jtex
from the tex-specific rendering, and updating the docx build to consume a template package using the non-tex part ofjtex
.Tasks and updates
No response
The text was updated successfully, but these errors were encountered: