myst-templates / springer

A template for easily creating pretty, nicely formatted Springer Journal articles using Myst Markdown
1 stars 1 forks source link

Myst Markdown directives not appearing in tex file #2

Open dressedfez opened 11 months ago

dressedfez commented 11 months ago

In the example article I have used various directives, e.g. theorem, proposition, etc (see https://mystmd.org/guide/proofs-and-theorems). The directives do not appear in the Latex/Tex file.

Note: the Springer templates uses special tex environments for theorem, proposition, etc. The question is how can we make sure that the Myst Build process uses those environments.

stevejpurves commented 10 months ago

yes, currently the proof and theorems have no specific export to latex defined and so are omitted. These should have latex translations added and that then leads to the question of what should be the standard form of those and how does that relate to this template.

image

Supporting base proof and theorem environments seems sensible as it enables the templates to define their handling, it probably gets more sticky when looking at the specific options a template supports and choosing those to be broadly applicable. If there is a lot of variation that could be difficult.

dressedfez commented 10 months ago

I would suggest the following. Myst currently supports the directives as specified here: https://mystmd.org/guide/proofs-and-theorems. The default behavior, in my opinion, should be to translate this to:

\begin{directive-name}
\end{directive-name}

In case of a theorem this would read:

\begin{theorem}
\end{theorem}

However, to allow more flexibility and to support further options a template author should be able to override the default translation using an entry in template.yml. I could imagine that this could look like this:

translations:
    tex:
       - source-name: proof
         target-name: special-proof
         options:
              - width
              - color
              - sub-label

This would be used in Myst markdown in the following way:

:::{prf:proof}
:width: 4cm
:color: yellow
:sub-label: My special proof.

Text for proof.
:::

and appear like this on the LaTex side (note this is before the actual value substitution):

\begin{special-proof}[proof.width.value,proof.color.value,proof.sub-label.value]
\end{special-proof}

which eventually would look like this in the translated Latex document:

\begin{special-proof}[4cm,yellow,My special proof.]
Text for proof
\end{special-proof}

The yaml entry above should also apply to just adding options to the default behavior.

What you think @stevejpurves @rowanc1 and @fwkoch ?