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 not rendering in nodes #11

Open
pieffebi opened this issue Mar 6, 2021 · 2 comments
Open

text color not rendering in nodes #11

pieffebi opened this issue Mar 6, 2021 · 2 comments

Comments

@pieffebi
Copy link

pieffebi commented Mar 6, 2021

Hi,

I think I might have found another issue. It seems to me that it is not possible to have colored text in nodes.
The following MWE alwaysproduces black text in TikZJax

\node[red] at (0,-2) {a};
\node[red] at (0,0) {$b$};
\node[text=red] at (-1,0) {$c$};
\node at (1,1) {$\color{red} d$};
\node at (-1,1) {$\textcolor{red} e$};
\node[red] at (-1,-2) {f};

The same code produces some colored text at https://tex.rossprogram.org/.
Specifically, a, b, c produce red text, while d, e, f produce black text, even if package xcolor is loaded.
Curiously enough, outside the tikzpicture environment, "{\color{red} whatever}" produces red text even when xcolor is not loaded.

I hope this helps
Francesco

@pieffebi
Copy link
Author

Hi,
I just realized that

\node[color=red] at (-1,-2) {f};

does actually work. Apologies about my previous comment. I was probably thrown off by the first three example above working in other environments.

@tobiasBora
Copy link

Isn't \textcolor supposed to work anyway? The color=red option is useful but limited, notably if one want to color only a portion of the text.

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

No branches or pull requests

2 participants