Skip to content

Commit

Permalink
🐛 Typst imports can be conflict prone
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Oct 22, 2024
1 parent 5d828b8 commit 7292290
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-rice-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"jtex": patch
---

Change typst exports to be less- conflict prone.
4 changes: 2 additions & 2 deletions packages/jtex/src/typst/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export function renderTypstImports(
const { macros, commands } = templateImports ?? {};
const importStatements: string[] = [];
const hasMacros = macros && macros.length > 0;
if (hasMacros) importStatements.push('#import "myst.typ": *');
if (hasMacros) importStatements.push('#import "myst-imports.typ": *');
if (output && hasMacros) {
const mystTypst = path.join(path.dirname(output), 'myst.typ');
const mystTypst = path.join(path.dirname(output), 'myst-imports.typ');
writeFileToFolder(mystTypst, macros.join('\n\n'));
}
if (commands && Object.keys(commands).length > 0) {
Expand Down

0 comments on commit 7292290

Please sign in to comment.