Template causing error

I’ve just signed up to typst.app and tried to create a presentation by selecting a template, but the very first line

#import "@preview/touying:0.3.2": *

cause an error “Only element functions can be used as selectors”. I just wanted to learn typst by creating a little presentation.

Typst 0.14.0 recently released and it seems that Touying 0.3.2 is not compatible with it. Luckily there is a version that works: 0.6.1.

#import "@preview/touying:0.6.1": *

The problem seems to be that the first Touying template listed when creating a document from a template needs to be updated to use a more recent version (it’s using 0.3.2). Listed authors are:

  • OrangeX4
  • Andreas Kröpelin
  • ntjess
  • Enivex
  • Pol Dellaiera

Does anybody know if they are active on the forum?

1 Like

Any problem can be filed in the repository issue tracker. Judging by the names/nicknames, I don’t think any of them were active in a very long time. Autocompletion uses latest package version (which might be incompatible before a new Typst release. See [PoC] Exclude incompatible package versions from import autocompletion by Andrew15-5 · Pull Request #7193 · typst/typst · GitHub)

1 Like

The issue is already known, from Touying template uses outdated import · Issue #159 · touying-typ/touying · GitHub

This is because I mistakenly published touying as a template in version 0.3.2, when in fact touying should just be a package. For comparison, touying-aqua is a template instead of package. Let me see if I can modify the template field of the old version of touying to remove it from touying 0.3.2

1 Like

The issue seems to be that touying:0.3.2 was released as a template, but newer versions of the package are not marked as a template in their typst.toml.

This should have lead to the touying package no longer showing up in the template selector, but for some reason the old version is stuck there.

There is, as far as I can tell, two solutions here:

  • a new version of touying gets released, as a template again
    • Drawback: touying should be a package, not a template
  • The typst web-app template selector is updated such that it doesn’t consider templates that are not the newest version of their package.
    • This is tracked in
1 Like

Thank you all for responding!

I’ve just tested the feature (autocompletion) and confirm that v0.6.1 is the latest version to the online editor, as @gezepi indicates.

But, this one gives a different error on themes.aqua.register:

Module `aqua` does not contain `register`

That means, as other people are saying, that the template I selected is not supported any longer.

Is there a template somewhere to start from? I’m trying to create a presentation to learn typst.

Instead of the Touying template, create a project by selecting the “Touying-aqua” or any other “Touying-*” template.
There is a good tutorial on how to use various features of Touying on https://touying-typ.github.io/.

1 Like

Aha! I didn’t know there are so many templates and I didn’t scroll down! I just selected the one within the window, which happened to be the unsupported one.

Thanks. I’ll play with it.