Skip to content

Inconsistent spacing with repeated boxes in outline #4160

Answered by l0wx
Victor-N-Suadicani asked this question in Q&A
Discussion options

You must be logged in to vote
#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

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Victor-N-Suadicani
Comment options

@l0wx
Comment options

Answer selected by Victor-N-Suadicani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants