Here is a simple code example. Here I want to generate a special footer for the first page, and for all subsequent ones, there will be another one.
#set page(
width: 10cm,
height: 10cm
)
// context inside context
#let temp1(body) = context {
set page(footer: context if here().page() == 1 {
[ First page footer ]
} else {
[ Other pages footer ]
})
body
}
// context
#let temp2(body) = context {
set page(footer: if here().page() == 1 {
[ First page footer ]
} else {
[ Other pages footer]
})
body
}
// #temp1()[#lorem(250)]
// #temp2()[#lorem(250)]
If I use the first function, the footers will be correctly generated on the page based on my rule, but if I use the second function, it won’t work that way. Although all calculations still take place inside the context.
Is this a bug or I just don’t understand how to use it properly?