admin管理员组

文章数量:1315822

I am using the LateXSwiftUI package. I want to set the background color of part of the text. However, using \colorbox does not seem to set the background to the desired color of red, resulting in a black box being put over "Hello." I have tried other colors, RGB colors, and hex colors, none of which have helped.

Code:

LaTeX("\\colorbox{red}{Hello}, World!")
.parsingMode(.all)

I am using the LateXSwiftUI package. I want to set the background color of part of the text. However, using \colorbox does not seem to set the background to the desired color of red, resulting in a black box being put over "Hello." I have tried other colors, RGB colors, and hex colors, none of which have helped.

Code:

LaTeX("\\colorbox{red}{Hello}, World!")
.parsingMode(.all)

Share Improve this question asked Jan 30 at 6:07 Churro the DuckChurro the Duck 1511 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

try this:

LaTeX("\\colorbox{red}{Hello}, World!")
    .imageRenderingMode(.original)  // <--- here
    .parsingMode(.all)

本文标签: swiftHow can I set background color of text with LaTeXSwiftUIStack Overflow