0

How can I make the whole math equation in blue color? Adding \textcolor{blue} will only change the first (x=) blue even though the whole equation is within the brackets. Is there any way to simply make it blue?

moewe
  • 175,683
  • 2
    \textcolor takes two arguments, not just one. If you leave off curly braces around the intended scope of the \textcolor directive, only the very first token after \textcolor{blue} will be colored blue. – Mico Feb 08 '23 at 04:01
  • 1
    In your current state your question irritates some members here. The minimum you should do is to EDIT your question and add minimal code, which compiles, shows your attempt, removed all parts not needed for this purpose. Thanks – MS-SPO Feb 08 '23 at 11:14
  • Please consider accepting the provided question if it solves your problem, the same is true for you other questions. See also https://tex.stackexchange.com/tour. – Dr. Manuel Kuehner Mar 17 '23 at 23:54

1 Answers1

1

It's best to include your code in a minimal working example (MWE) so we can see what you have done.

\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{amsmath}
\begin{document}
\noindent \textcolor{blue}{$c^2=a^2+b^2$}\\\\
\textcolor{red}{$x = \cfrac{\cfrac{Q_1}{T_2}}{1+{Q_1}+{\cos{30}}}$}
\end{document}

You can use \textcolor without issue. Your approach (using \color{blue}) will have scoping issues as Werner says; that is, the text that you type afterwords will be blue unless you limit the scope as Werner suggested. Sample code running below shows how your original approach can work.

enter image description here

DJP
  • 12,451