kisonecat / tikzjax

TikZJax is TikZ running under WebAssembly in the browser
LaTeX Project Public License v1.3c
437 stars 36 forks source link

text color not rendering in nodes #11

Open pieffebi opened 3 years ago

pieffebi commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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.