-
Notifications
You must be signed in to change notification settings - Fork 66
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
🪄 Updates for multi-article typst export with interactive figures #1701
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 8e3054e The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -56,6 +56,10 @@ export const figureDirective: DirectiveSpec = { | |||
type: String, | |||
doc: 'A placeholder image when using a notebook cell as the figure contents. This will be shown in place of the Jupyter output until an execution environment is attached. It will also be used in static outputs, such as a PDF output.', | |||
}, | |||
static: { |
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 suspect we do not want to call this static
. @stevejpurves suggested hard-copy
in #1157 . We could also do something like placeholder:pdf
, but really, this applies to all "paper" exports: docx, tex, typst, and pdf. placeholder:paper
? Not sure how confusing placeholder
vs placeholder:pdf
might be.
@@ -104,6 +104,11 @@ export const containerHandler: Handler = (node, state) => { | |||
return; | |||
} | |||
|
|||
if (node.enumerator?.endsWith('.1')) { |
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.
This could be improved. It places strict assumptions on the enumerator
in numbering
. e.g. It works great for:
numbering:
enumerator: 3.%s
But doesn't work at all for:
numbering:
enumerator: (3-%s)
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.
Possibly we need better translation between myst and typst enumerators.
@@ -49,8 +49,8 @@ const textOnlyReplacements: Record<string, string> = { | |||
'©': '#emoji.copyright ', | |||
'®': '#emoji.reg ', | |||
'™': '#emoji.tm ', | |||
'<': '\\< ', | |||
'>': '\\> ', | |||
'<': '\\<', |
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.
Making this change did not feel good - I'm not sure why we were previously adding a space after these characters. However, for the examples I was looking at, the addition of this space looked very wrong, and simply removing it here fixed the output.
@rowanc1 perhaps you have some recollection of this...?
I was working on building this PDF: msa-em/nanocartography#7 - It is a multi-article, typst export with many interactive figures and complex equations.
This triggered some updates to
tex-to-typst
, mainly matrices, brackets, arrows. See continuous-foundation/tex-to-typst@f4ca453...v0.0.12Additionally, it encouraged some significant updates here in MyST:
static
images to use only in hard-copies, different thanplaceholders
which modify the web experience - this addresses an existing issue: usingfigure
placeholders to get hard copy placeholders, can break the web experience for altair #1157myst.yml#project
)