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?
Asked
Active
Viewed 274 times
0
1 Answers
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.
Jasper Habicht
- 48,848
DJP
- 12,451

\textcolortakes two arguments, not just one. If you leave off curly braces around the intended scope of the\textcolordirective, only the very first token after\textcolor{blue}will be colored blue. – Mico Feb 08 '23 at 04:01