Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Myst Markdown directives not appearing in tex file #2

Open
dressedfez opened this issue Jul 14, 2023 · 2 comments
Open

Myst Markdown directives not appearing in tex file #2

dressedfez opened this issue Jul 14, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dressedfez
Copy link
Collaborator

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.

@dressedfez dressedfez added bug Something isn't working help wanted Extra attention is needed labels Jul 14, 2023
@stevejpurves
Copy link

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
Copy link
Collaborator Author

dressedfez commented Sep 2, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants