-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Description
Please rename the title if you found out what the actual problem is.
Here is the code:
#set page("a6")
#set text(font: "Noto Sans")
#set text(size: 20pt)
// ========== Scripting ==========
// Icons
#let sensorIcon = image("sensor-icon.png")
#let mcIcon = image("microcomputer-icon.png")
// Symbols
#let makeSym(im, te, spacing: 1em, width: 3cm, textSize: 16pt) = {
set text(size: textSize)
block(width: width, stroke: none)[
#set align(center)
#im
#v(-2em + spacing)
#text(te)
]
}
#let sensorSym = makeSym(sensorIcon, "Sensor", spacing: 0.6em)
#let mcSym = makeSym(mcIcon, "MicroComputer", spacing: 1.3em)
// combined Symbols
#let combo = block(stroke: 1pt)[
#scale(90%, mcSym)
#place(top + left, dx: 0pt, dy: 0pt, scale(50%, block(stroke: 1pt, sensorIcon)))
]
// ========== Document ==========
#combo
#combo
#combo
#combo
#comboThe problem:
The command #combo produces 2 different visualizations. This happens only when the third usage is moved to the next page (that's why i set page format to a6). Since it is the same variable it should produce exactly the same output, right?
I assume this is an issue of place(). But I don't know for sure. The docs say:
place := Places content relatively to its parent container.
In this case the parent container should be the block, right?
I also found out, that if i set sensorIcon to image("sensor-icon.png", width: 3cm) it seems to be working just fine. As if the problem would be about the image handling and scaling etc. But since the same scaling is used why is it different in the two calls??
I actually don't know what is the problem but something seems odd here. Maybe I just miss something relevant here and it is not a bug. In that case I'd be sorry to waste your time, but I think the behavior is not explained very well anywhere.
Best regards
PS: I love typst :)
Reproduction URL
Operating system
Linux
Typst version
- I am using the latest version of Typst
