Inconsistent spacing with repeated boxes in outline #4160
Answered
by
l0wx
Victor-N-Suadicani
asked this question in
Q&A
Replies: 1 comment 2 replies
-
#import calc: *
#let demo(sz) = place(rect(..sz, stroke: green))// Demonstrational purp.
#let filler = box(
fill: red,// Demonstrational purp.
".",
)
#let filler-seq = context {
let msms = measure(filler)
box(
width: 1fr,
inset: (left: -msms.width/2),
align(
right,
layout(sz=> demo(sz) + context filler*(msms, sz)
.map(l=> 1000000 * l.width.pt())
.fold(1, (acc, r)=> quo(r, acc))
),
),
)
}
#outline(
fill: filler-seq,
)
= Ans
= Dswa |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Victor-N-Suadicani
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make a pretty outline like this:
This results in the following:
And it's mostly good except that the dots somehow don't line up! They always start lined up on the right (which looks good) but then as you go to the left of the page, they somehow get spaced out inconsistently.
If I give the boxes a background color, I can even see that there is sometimes a tiny gap in-between the boxes.
My guess is that this gap is what is causing the problem but I'm not sure.
Am I causing this spacing somehow and can I fix it? Or is this some kind of bug?
Beta Was this translation helpful? Give feedback.
All reactions