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

MD -> LaTeX: imports not accessible to #978

Open
LecrisUT opened this issue Mar 13, 2024 · 8 comments · May be fixed by #979
Open

MD -> LaTeX: imports not accessible to #978

LecrisUT opened this issue Mar 13, 2024 · 8 comments · May be fixed by #979

Comments

@LecrisUT
Copy link
Contributor

One would expect to be able to add to the list of package imports via

exports:
  - format: pdf+tex
    imports:
      - physics

But this currently has no effect. Of course this is not complete since the imports could have additional options, but this should fix basic \usepackage needs

@LecrisUT LecrisUT linked a pull request Mar 13, 2024 that will close this issue
@LecrisUT
Copy link
Contributor Author

There seems to be more nuance to this, because even if we include the missing \usepackage, myst will still complain of Undefined control sequence:

@LecrisUT LecrisUT changed the title LaTeX: imports not accessible to MD -> LaTeX: imports not accessible to Mar 13, 2024
@jan-david-fischbach
Copy link
Contributor

👍 Any Progress on this?

@gl-yziquel
Copy link

I must say, it is not easy to find out of to get some \usepackage in mystmd working. I need \reflectbox from \graphicx, and struggling quite a bit finding the correct way to get that done.

@gl-yziquel
Copy link

gl-yziquel commented Nov 9, 2024

@LecrisUT I've rebased your fix/978 branch and rebuilt the mystmd codebase on my machine. Could you please give me some guidance / advice as to how to use this imports field ?

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Nov 9, 2024

Iirc, you just need to add an imports field to the front-matter e.g.:

exports:
  - format: pdf+tex
    imports:
      - physics

@gl-yziquel
Copy link

@LecrisUT Then, I'm doing something else wrong that I do not understand. Thank you, and sorry for disturbing you needlessly.

@gl-yziquel
Copy link

@LecrisUT Erratum: it in fact does work. I just checked it by importing the "cancel" package as follows:

exports:
  - format: pdf+tex
    template: curvenote
    imports:
      - cancel

I am now able to write \cancel{\exists} with it, and could not before. So it indeed does work.

The main branch of my fork of mystmd contains the merge of current main branch and of your fix/978 branch.

https://github.com/gl-yziquel/mystmd

Please feel free to update your PR.

@LecrisUT
Copy link
Contributor Author

LecrisUT commented Nov 9, 2024

Feel free to take over that PR. It would need some documentation and tests. I'm not that proficient in node stuff so I don't know if the approach there is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants