Skip to content

Gradient misbehaves on radicals #2586

Closed

Description

@schuelermine

Description

A gradient over a math equation will not work correctly on radicals.
To emphasize, I’m setting the background to black.
Code like this:

#set page(fill: black)
#show math.equation: content => [
  #set text(fill: gradient.linear(..color.map.turbo))
  #box(content)
]
#set page(height: auto, width: auto, margin: 1em)

$ sqrt(x + 1) (x + 1 $

Results in this output:
Screenshot 2023-11-04 at 19-54-26 scratchpad – Typst
Additionally the color in the bar on top of the radical is also completely broken when looking at the exported PDF:
Screenshot 2023-11-04 at 19-54-21 scratchpad-1 pdf

Reproduction URL

No response

Operating system

Web app, Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Nov 4, 2023
  2. added
    styling
    math
    on Nov 4, 2023
  3. Enivex commented on Nov 5, 2023

    @Enivex
    Collaborator
  4. Dherse commented on Nov 5, 2023

    @Dherse
    Contributor

    @schuelermine is correct, it should apply to all parts, the issue is that I didn't delve too deep into the math code, therefore it doesn't handle all of the strokes generated in math code. This would require a PR that goes all over the math code and fixes it.

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

    bugmathstyling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions