typst / packages

Packages for Typst.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stuck in loading loop

boyen-cell opened this issue · comments

commented

I'm not sure what I'm doing wrong, but I cannot get this to work.
If I put the following in my main.typ file, then the PDF preview loads, but then I can only make use of acronyms from within the main document, not within any other typst file.

#import "@preview/acrostiche:0.2.0": *

#init-acronyms((
  "NN": ("Neural Network",),
  "OS": ("Operating System",),
  "BIOS": ("Basic Input/Output System", "Basic Input/Output Systems"), 
)) 

If I put it at the beginning of a different typst file as well to make use of it, then the PDF preview gets stuck in a loading loop.
I've tried only adding the #init-acronyms((...)) part into the other documents, but then the compiler complains about no such function existing.

Not sure which typst version I'm using, but I'm using the web app (typst.app), so I'd guess it's the newest version?

Initializing the acronyms twice is probably unexpected by acrostiche. Do you include your other files into the main file after init-acronyms? That should work. A bit more context / a minimal reproduction example would be helpful.

I've created a new project now to showcase how things roughly look like in my main document:
https://typst.app/project/wR4I7ztdM1shNRlxM6ihZc

In there I've gotten it to work, but I need to have the #import "@preview/acrostiche:0.3.0": * snippet both in main.typ AND in the customFunctions.typ document, which I import into every chapter.

Is that correct?

If you use definitions from acrostiche both in main and the chapters, then that is correct. If not, something strange is going on.

In the main.typ file I only use the #print-index() function but no actual acronyms.

Package imports aren't global. If you import something in the main file, it does not automatically become available in all other files. So it sounds like everything is working as expected.