-
Notifications
You must be signed in to change notification settings - Fork 68
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
Latex and texlive cannot be installed easily on macOS/ARM #1735
Comments
Thanks for the report @certik! Yes, it looks like there aren't any binaries for ARM in OSX: https://prefix.dev/channels/conda-forge/packages/latexmk That's odd because I saw a PR there to add ARM support. Something must not be quite right with the recipe. I will note that Regarding tectonic, that is something that we're looking to move to. There's an open PR #1093, but it needs a bit more work to get it over the line. Right now, you have a few different options:
We generally encourage people to use the Typst exporter because it's a lot easier to target (for us) than LaTeX. However, I don't know if there are additional constraints that dissuade you from doing that. I'll give this some more thought, and pop back here if anything else comes to mind. |
Here is how I got the pdf working using tectonic: $ myst build --tex && (cd _build/exports/paper_tex && tectonic paper.tex)
📬 Performing exports:
01-paper.md -> _build/exports/paper_tex/paper.tex
📖 Built 01-paper.md in 4.79 ms.
📖 Built README.md in 4.32 ms.
📚 Built 2 pages for export (including 1 dependency) from /Users/ondrej/repos/math_notes in 7.83 ms.
📑 Exported TeX in 7.5 ms, copying to _build/exports/paper_tex/paper.tex
Running TeX ...
warning: fmtcount.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fmtcount.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fcprefix.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fcprefix.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fcnumparser.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fcnumparser.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fc-english.def:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fc-english.def:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
Rerunning TeX because "paper.aux" changed ...
warning: fmtcount.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fmtcount.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fcprefix.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fcprefix.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fcnumparser.sty:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fcnumparser.sty:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: fc-english.def:10:
Invalid UTF-8 byte or sequence at line 10 replaced by U+FFFD.
warning: fc-english.def:22: Invalid UTF-8 byte or sequence at line 22 replaced by U+FFFD.
warning: warnings were issued by the TeX engine; use --print and/or --keep-logs for details.
Running xdvipdfmx ...
Writing `paper.pdf` (23.92 KiB)
Skipped writing 2 intermediate files (use --keep-intermediates to keep them)
$ open _build/exports/paper_tex/paper.pdf And that works beautifully. |
@certik that was a good idea. It didn't occur to me to suggest handling the build yourself! I'm glad that you had success. |
I just tried
Maybe there is a way to workaround all these, I need to see. Latex via tectonic has been rock solid in my experience, so I've been using that. Although I discovered a bug in mystmd for latex (#1737). Is the plan to fully support latex, but perhaps use typst as the recommended backend? Update: I see, it's because
These bugs happen even in the official documentation, say here: https://mystmd.org/guide/math#dollar-math, click on the LaTeX tab, it generates correct latex, then click on the Typst tab and it skips the more complicated equations, only shows the simple one. I think it makes sense to be able to parse latex equations, and generate for example proper Word equations out of it. But that will all take time, so it seems using the latex exporter is the only robust solution for now. Also I got a lot of warnings for typst: $ myst build --typst
📬 Performing exports:
01-paper.md -> _build/exports/paper_typst/paper.pdf
📖 Built 01-paper.md in 72 ms.
📖 Built README.md in 72 ms.
📚 Built 2 pages for export (including 1 dependency) from /Users/ondrej/repos/math_notes in 79 ms.
📑 Exported typst in 32 ms, copying to _build/temp/mystNYj4Ud/paper.typ
⛔️ 01-paper.md 'parts' missing required key: abstract (at 01-paper.md)
warning: `locate` with callback function is deprecated
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:83:12
│
83 │ header: locate(loc => {
│ ╭─────────────^
84 │ │ if(loc.page() == 1) {
85 │ │ let headers = (
86 │ │ if (open-access) {smallcaps[Open Access]},
· │
94 │ │ }
95 │ │ }),
│ ╰──────^
│
= hint: use a `context` expression instead
warning: `counter.display` without context is deprecated
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:112:15
│
112 │ #counter(page).display() of #locate((loc) => {counter(page).final(loc).first()})
│ ^^^^^^^^^^^^^^^^^^^^^^^
│
= hint: use it in a `context` expression instead
warning: `locate` with callback function is deprecated
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:112:43
│
112 │ #counter(page).display() of #locate((loc) => {counter(page).final(loc).first()})
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
│
= hint: use a `context` expression instead
warning: unknown font family: noto sans
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:121:17
│
121 │ set text(font: font-face, size: 10pt)
│ ^^^^^^^^^
warning: `show par: set block(spacing: ..)` has no effect anymore
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:294:2
│
294 │ show par: set block(spacing: 1.5em)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
│
= hint: write `set par(spacing: ..)` instead
= hint: this is specific to paragraphs as they are not considered blocks anymore
warning: `locate` with callback function is deprecated
┌─ _build/temp/mystNYj4Ud/lapreprint.typ:132:22
│
132 │ show heading: it => locate(loc => {
│ ╭───────────────────────^
133 │ │ // Find out the final number of the heading counter.
134 │ │ let levels = counter(heading).at(loc)
135 │ │ set text(10pt, weight: 400)
· │
170 │ │ ]
171 │ │ })
│ ╰────^
│
= hint: use a `context` expression instead
warning: calling `counter.final` with a location is deprecated
┌─
_build/temp/mystNYj4Ud/lapreprint.typ:112:60
│
112 │ #counter(page).display() of #locate((loc) => {counter(page).final(loc).first()})
│ ^^^^^^^^^^^^^^^^^^^^^^^^
│
= hint: try removing the location argument
🖨 Rendering typst pdf to _build/exports/paper_typst/paper.pdf |
Thanks @certik for the feedback on typst. This is something that we are actively working on at the moment. Many of the warnings are from the recent typst upgrade which deprecated quite a few things, and our templates haven't all been updated yet. The Typst math errors are difficult, as you note, their syntax is different (sometimes very different), and the automated translation solutions are still evolving and patchy. MyST expects all math in latex (not typst). I was planning to get a feature over the line for an escape hatch this week (i.e. write in latex, and have an explicit typst line as well for ones that are not translated automatically). I think also surfacing this as errors is also a good idea. I will make a few issues. To handle your equations specifically, it would be good to get the examples. We will release another version likely tomorrow and I can get those ones done at least to unblock you. |
@rowanc1 awesome, thanks! I uploaded the paper I've been writing here: https://gist.github.com/certik/62deb4eacf23ab71c6c4fa1fb8f230f2, it's standalone, I removed the bibtex references. It compiles with |
Thanks I will take a look today. :) |
I followed the documentation at https://mystmd.org/guide/installing and it seems neither
latexmk
nortexlive-core
can be easily installed. I previously installed themystmd
package:On macOS I usually use the
tectonic
package which packages TeX and it just works.The text was updated successfully, but these errors were encountered: