Closed johannes-wolf closed 10 months ago
In my last document, I put external packages that are used (one or) many times inside my /utils/utils.typ
file. And then I can import that file and choose what exactly do I want to import.
A more readable approach is to make:
/src/preview/oxifmt.typ
/src/packages/oxifmt.typ
/src/external/oxifmt.typ
/src/dependencies/oxifmt.typ
This way you create 1 file per @preview
package where you import everything that you need and then re-import from that local file into other files. This looks very well organized, and only the relative paths will be more ugly/longer, but since they are only created by a script automatically, this shouldn't be an issue.
#import "/src/dependencies/oxifmt.typ": strfmt
This ↑ should work flawlessly.
Inside /src/dependencies/oxifmt.typ
:
#import "@preview/oxifmt:0.2.0": strfmt
We should group imports of external packages into one file to not mix up versions.
You can very easily forget to update all files that import the same package.
Originally posted by @Andrew15-5 in https://github.com/johannes-wolf/cetz/issues/402#issuecomment-1854839353