-
I have a function to render some content, and want to judge the first function call. I try to implement it by getting #let render_counter = counter("render")
#let render(body, title: "") = [
#render_counter.step()
// FIXME: how to get integer or another way to judge the condition
#if render_counter.display() == 1 [
] else [
]
] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You need to use the |
Beta Was this translation helpful? Give feedback.
-
OK, I've referred @Dherse example. I just want to specially render the first component. I modify your example a little of the render_counter.step()
if render_counter.at(loc).at(0) == 0 [
this is the first paragraph.
] else [
this is not the first paragraph.
] Before starting the discussion, I have read the time travel section. To be honest, it's a little obscure. |
Beta Was this translation helpful? Give feedback.
You need to use the
at
method oncounter
. Inside of alocate
block. This is all covered in the documentation in the time travel section.