Hi,
I have a typ document with 2k lines. At several sections I have defined variables with content/images.
I now what to change the image dependend on a bool.
However I cannot use the var myimage2 due to the scope …
Any recommendation how to solve this?
Many thanks …
#let isLevelEasy = true
= section 1
#let myimage1 = image("image1")
// use myimage1 here
myimage1
= section 2
// I would like to define myimage2 as part of section2
#if isLevelEasy {
let myimage2 = image("image2")
} else {
let myimage2 = image("image2_Easy")
}
// I would like to use myimage2 here ...
Or, if you don’t actually need to save the image in a variable, you can simply return the correct image from within the if block which will then be displayed: