Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text color and math mode. #16

Open
fryguybob opened this issue Dec 20, 2018 · 2 comments
Open

Text color and math mode. #16

fryguybob opened this issue Dec 20, 2018 · 2 comments
Labels

Comments

@fryguybob
Copy link
Member

It looks like we use \pgfsetfillcolor for coloring text but this has odd behavior with text that has math components:

example :: Diagram B
example = circle 2 `atop` (baselineText "$\\frac{1}{2}$" & fc red)

The text is the right color, but the fraction bar is not:

half-black

If I add a color command using the fc color name that gets defined in the output I can work around the issue:

example :: Diagram B
example = circle 2 `atop` (baselineText "\\color{fc}$\\frac{1}{2}$" & fc red)

all-red

@fryguybob fryguybob added the bug label Dec 20, 2018
@byorgey
Copy link
Member

byorgey commented Feb 2, 2019

Hmm, weird. What do you think is the right way to fix this?

@fryguybob
Copy link
Member Author

I don't really understand why PGF does what it does, but I think it might be fine to emit \color{fc} inside every \pgftext if \definecolor{fc} is already emitted in that scope. Seems like a lot of stuff to emit for a rare use case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants