mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Doc: How to use LaTeX -> myst

Open LecrisUT opened this issue 1 year ago • 8 comments
trafficstars

Proposal

There were some mentions of LaTeX -> myst and there is the equivalent package, but it is unclear how one would use it. Is it supposed to be an equivalent source like an .md file? Some documentation would be helpful

LecrisUT avatar Mar 19 '24 18:03 LecrisUT

Any latex source files that are in the project will be picked up and transformed. There is a blog post here and some examples in this repository that we use for Physiome.

Docs would be wonderful for this portion of the workflow and happy for contributions to start it! (I think that the structure of the docs may need to be adapted, but probably just a new page that talks about this a bit would be a great addition, and we can organize later).

rowanc1 avatar Mar 19 '24 18:03 rowanc1

The first cut at this is here: https://mystmd.org/guide/writing-in-latex

Happy for feedback!

rowanc1 avatar Apr 11 '24 05:04 rowanc1

From what I read there, there is no frontmatter section for LaTeX?

Maybe some other undocumented limitations would be splitting the document in multiple files? That would be a limitation for book projects.

LecrisUT avatar Apr 11 '24 07:04 LecrisUT

I will take another pass on documenting how the frontmatter is dealt with (i.e. everything before \begin{document}), which is parsed, but there are some limitations / quirks.

It is also possible to use snippets of latex (e.g. a latex table):

https://mystmd.org/guide/embed#docs-include

image

You can split up files and use include in latex as well, but you might have a different thing in mind for book projects?

rowanc1 avatar Apr 11 '24 14:04 rowanc1

You can split up files and use include in latex as well, but you might have a different thing in mind for book projects?

Would mystmd try to parse any .tex file and create a page for it or only those that have \begin{document}? If the former, that would create a problem for book projects where the content of included chapters do no have \begin{document}. That is the main problem I was thinking of

LecrisUT avatar Apr 11 '24 15:04 LecrisUT

By default, every parsable file is included. At the moment, you can change what is included in the table of contents using the myst init --write-toc and removing what is not relevant. The way that web is presented is often different, for example, in my thesis, each chapter is a page online, but there is only one \begin{document}.

rowanc1 avatar Apr 11 '24 15:04 rowanc1

The way that web is presented is often different, for example, in my thesis, each chapter is a page online, but there is only one \begin{document}.

Just to clarify that is independent of the file separation and it's governed by the frontmatter right?

LecrisUT avatar Apr 11 '24 15:04 LecrisUT

Correct, the configuration is in the _toc.yml at the moment (docs) and does not depend on the file separation choices.

rowanc1 avatar Apr 11 '24 15:04 rowanc1