-
Notifications
You must be signed in to change notification settings - Fork 72
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'myst-to-typst': patch | ||
--- | ||
|
||
Support additional greek characters in typst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'myst-directives': patch | ||
'myst-transforms': patch | ||
'myst-cli': patch | ||
--- | ||
|
||
Add static figure placeholder for images that should be used only for PDF exports |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'myst-cli': patch | ||
--- | ||
|
||
Prevent html outputs that translate to empty images |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'myst-to-typst': patch | ||
--- | ||
|
||
Support restarting counter for each typst article in multi-article export |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'myst-to-typst': patch | ||
--- | ||
|
||
Fix typst crossreferences to other pages |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'myst-cli': patch | ||
--- | ||
|
||
Prioritize project-level parts for project-level typst export |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This could be improved. It places strict assumptions on the
But doesn't work at all for:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly we need better translation between myst and typst enumerators. |
||
state.write(`#set figure(numbering: "${node.enumerator}")\n`); | ||
state.write(`#counter(figure.where(kind: "${kind}")).update(0)\n\n`); | ||
} | ||
|
||
if (nonCaptions && nonCaptions.length > 1) { | ||
const allSubFigs = | ||
nonCaptions.filter((item: GenericNode) => item.type === 'container').length === | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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...? |
||
'>': '\\>', | ||
' ': '~', | ||
' ': '~', | ||
// eslint-disable-next-line no-irregular-whitespace | ||
|
@@ -105,16 +105,19 @@ const mathReplacements: Record<string, string> = { | |
'×': 'times', | ||
Α: 'A', | ||
α: 'alpha', | ||
𝜶: 'alpha', | ||
Β: 'B', | ||
β: 'beta', | ||
ß: 'beta', | ||
𝜷: 'beta', | ||
Γ: 'Gamma', | ||
γ: 'gamma', | ||
Δ: 'Delta', | ||
'∆': 'Delta', | ||
δ: 'delta', | ||
Ε: 'E', | ||
ε: 'epsilon', | ||
𝝴: 'epsilon', | ||
Ζ: 'Z', | ||
ζ: 'zeta', | ||
Η: 'H', | ||
|
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 suggestedhard-copy
in #1157 . We could also do something likeplaceholder:pdf
, but really, this applies to all "paper" exports: docx, tex, typst, and pdf.placeholder:paper
? Not sure how confusingplaceholder
vsplaceholder:pdf
might be.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.
Can we block this PR until we resolve #1157 (comment)?
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.
Lets break this into ~6 prs and get the ones in that are simple and make this one smaller.