I have a stack of 3 rectangles, and a text in each rectangle. The code is as follows: #stack(
dir: ttb,
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[first] rectangle with random text.]
],
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[second] rectangle with random text.]
],
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[third] rectangle with random text.]
],
)
I am trying to change the color of the nested text (e.g text(size: 12pt)[This is the text(red)[first] rectangle with random text.]). Typst does not recognize the inner text and print text(red)[first]
with no color applied.
I have fixed the problem. The solution is as follows: #stack(
dir: ttb,
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[first] rectangle with random text.]
],
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[second] rectangle with random text.]
],
rect(width: 200pt, height: 80pt)[ text(size: 12pt)[This is the text(red)[third] rectangle with random text.]
],
)