How to incrementally reveal theorem content in Touying and Theorion

I sometimes have very bulky results I need to display in Touying slides. One way I try and mitigate just displaying massive block of texts is to display them incrementally. However, if I try and do this inside Theorion environments, I instead get panics. With the example:

#import "@preview/touying:0.7.3": *
#import themes.university: *
#import "@preview/numbly:0.1.0": numbly
#import "@preview/theorion:0.6.0": *
#import cosmos.clouds: *
#show: show-theorion

#show: university-theme.with(
  aspect-ratio: "16-9",
  config-common(frozen-counters: (theorem-counter,)),  // freeze theorem counter for animation
)

= test

#proposition[
  The formula:
  #pause
]

I get the error:

error: panicked with: "Unsupported mark `touying-jump/pause/meanwhile` at page 2. You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead."
   β”Œβ”€ @preview/touying:0.7.3/src/configs.typ:66:8
   β”‚  
66 β”‚ β•­         panic(
67 β”‚ β”‚           "Unsupported mark `"
68 β”‚ β”‚             + kind
69 β”‚ β”‚             + "` at page "
70 β”‚ β”‚             + str(page-num)
71 β”‚ β”‚             + ". You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead.",
72 β”‚ β”‚         )
   β”‚ ╰─────────^

Meanwhile, trying to follow the error’s advice and use uncover:

#slide(repeat: 3)[
  #proposition[
    The formula
    $
      #uncover("2-")[]
    $
  ]
]

results in the error:

error: panicked with: "Unsupported mark `touying-fn-wrapper` at page 2. You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead."
   β”Œβ”€ @preview/touying:0.7.3/src/configs.typ:66:8
   β”‚  
66 β”‚ β•­         panic(
67 β”‚ β”‚           "Unsupported mark `"
68 β”‚ β”‚             + kind
69 β”‚ β”‚             + "` at page "
70 β”‚ β”‚             + str(page-num)
71 β”‚ β”‚             + ". You can't use it inside some functions like `context`. You may want to use the callback-style `uncover` function instead.",
72 β”‚ β”‚         )
   β”‚ ╰─────────^

Is there any way to break up content inside Theorion environments for incremental display in Touying?

I can’t exactly figure out what the change that caused this is, but it seems that importing an earlier version on theorion fixes this. To do this, just change the import to

#import "@preview/theorion:0.3.3": *

Note that revering to the non-newest version might come with some bugs that were later patched

1 Like

Oh wow. That’s incredibly wonky. I wonder if that’s the intended behavior, because it doesn’t feel like it should be.

I doubt it’s intended, if it is then the claim that theorion works with touying should certainly come with a warning. Hopefully I’ll have some time later so that i can investigate what version 0.4.0 broke and/or open an issue

edit: bug report here: touying animations broken Β· Issue #45 Β· OrangeX4/typst-theorion Β· GitHub

1 Like

the problem is that theorion now uses context to do some counter and state stuff and out of caution we don’t allow touying to meddle inside explicit context environments.
Does it work if you turn the warning off. Typst does 5 rendering passes so you might get lucky and it gets resolved correctly, but please don’t rely on it.

Sorry, turning the warning off? It sounds like you’re talking about failed convergences, but I can’t get that far on the latest versions because documents using theorion simply refuses to compile when interacting with Touying in this way.

touying has this config field: enable-mark-warning: bool (see config-common | Touying)

in its common config (without prefix), which is by default true. you can turn this off and then the case will not panic but just emit a warning instead.

as i said above this is not a fix since it is unstable/unreliable, but if you are lucky it might work for you.