From 7292290283f97c6d1e98fab67c827c472dbeff55 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 22 Oct 2024 09:30:17 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Typst=20imports=20can=20be=20con?= =?UTF-8?q?flict=20prone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/grumpy-rice-bake.md | 5 +++++ packages/jtex/src/typst/imports.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/grumpy-rice-bake.md diff --git a/.changeset/grumpy-rice-bake.md b/.changeset/grumpy-rice-bake.md new file mode 100644 index 000000000..f8aafc820 --- /dev/null +++ b/.changeset/grumpy-rice-bake.md @@ -0,0 +1,5 @@ +--- +"jtex": patch +--- + +Change typst exports to be less- conflict prone. diff --git a/packages/jtex/src/typst/imports.ts b/packages/jtex/src/typst/imports.ts index 803da0f76..b66658951 100644 --- a/packages/jtex/src/typst/imports.ts +++ b/packages/jtex/src/typst/imports.ts @@ -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) {