-
Notifications
You must be signed in to change notification settings - Fork 63
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
🗺 Add tectonic
support
#1093
base: main
Are you sure you want to change the base?
🗺 Add tectonic
support
#1093
Conversation
Currently, I cannot import isLatexmkAvailable and isTectonicAvailable from '../../../myst-cli/src/build/pdf/utils.ts'. I am therefore duplicating the two functions in jtex/src/tex/exports. See also: https://github.com/orgs/executablebooks/discussions/1154#discussioncomment-9084375. Hopefully this can be modified later.
Thanks for submitting your first pull request! You are awesome! 🤗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes.
I think this is close, it would be wonderful if you could add a section in the docs.
I can aim to take a pass later today or tomorrow to clean anything up and get it in!
|
||
export function isTectonicAvailable() { | ||
return which.sync('tectonic', { nothrow: true }); | ||
} | ||
|
||
export function pdfTexExportCommand( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's remove the duplication here by moving this command to myst-cli/src/build/pdf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
The only thing regarding the duplicated functions is that I cannot import them from myst-cli/src/build/pdf/utils.ts
to jtex/src/tex/export.ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to move the whole file over, but I see that is a bit complex, and we probably want to do it for typst at the same time.
I am happy to come in after and do a quick refactor, I also want to talk to @fwkoch to get a sense check on moving those around.
Have you tested the functionality locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works on my local machine. Cloned the forked repo and followed your contribution guidelines for developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic - I will give it a go today or tomorrow and we can get this released early next week. Thanks again for your help in the PR, excited to try out tectonic and stop recommending 5gb downloads ... !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
My pleasure. Yes, it's still relatively unknown, but it's such a step forward for local LaTeX compiling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the duplication - it would be nice to eliminate... that would mean "creating the command" (currently in jtex
) and "invoking the command" (currently in myst-cli
) in one single place. Definitely a smaller refactor to move "creation" to myst-cli
, but it could also be interesting if part of the scope of jtex
was to know how to create and invoke all the various rendering engines. MyST could then just say "jtex, build me a pdf using this template" hmm...
Anyway - the duplication here is relatively minor; I don't think we need to block this PR with a big refactor.
Just added a paragraph for the documentation. |
Co-authored-by: Rowan Cockett <[email protected]>
Co-authored-by: Rowan Cockett
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I wanted to check on - if you have glossaries, the latexmk
build runs twice with a makeglossaries
command in between: https://github.com/executablebooks/mystmd/blob/main/packages/myst-cli/src/build/pdf/create.ts#L218-L250
I think the tectonic
build will do the same thing. Is this correct (i.e. is the makeglossaries
workflow fundamental to latex, regardless of engine), or do we need to make changes deeper in the build invocation flow?
Hi @fwkoch, |
Update: I have taken a first look at this locally and am working through some of the error states and logging, which need to change a bit if tectonic does not succeed. I will continue to chip away at this during the week. |
This PR includes Tectonic as a LaTeX build engine instead of
latexmk
.However, I let
latexmk
in the code as a fallback option.The warning in packages/myst-cli/src/build/pdf/create.ts is extended with an availability check for
tectonic
.See also the discussion here.