Skip to content

Edge Overrun Box Function. #3368

Closed as not planned
Closed as not planned

Description

@pauladam94

Description

When doing box[content], the content is not completely contain in the box. According to me it should be. If we don't fix the size of the box, the box should adapt to the exact size of the content see on the pdf.

It is especially complicated when doing a package with automatic layout. For example in a package that computes the layout by getting measure of what is given by the use of the package. The measure don't represent the size of the content that is seen on the pdf.

Example to see what I am talking about :

#let a = $a_a_a$

#let thing(body) = style(styles => {
  let size = measure(body, styles)
  let width = size.width
  let height = size.height
  [width : #width , height : #height]
  v(1pt)
  [#body]
  h(10pt)
  box(stroke : 0.5pt)[#body]
  h(10pt)
  box(width : width, height : height, stroke : 0.5pt)[]
})
#thing(a)

The boxes here all have exactly the same size (width : 15.9pt, height : 7.51pt).
Screenshot 2024-02-06 at 19 04 09

Simplier example :

#box(stroke : 0.5pt)[$a_a$]
Screenshot 2024-02-06 at 19 07 03
#box(stroke : 0.5pt)[$a_a$]
Screenshot 2024-02-06 at 19 06 57

I want to know if there is a way to deal with that. For me it is a bug. It might also be only a problem with math equation. I have mainly tested that with math equation because I am the author of the "curryst" package.

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Feb 6, 2024
  2. laurmaedje commented on Feb 6, 2024

    @laurmaedje
    Member

    Duplicate of #1028

  3. added
    duplicate
    layout
    on Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugduplicatelayout

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions