本文章主要介绍了在Latex编辑公式时,如何改变公式中每部分的颜色,希望下面的分享能够给你在编辑Latex公式时提供帮助。

原始公式效果图

∫abf(x)dx=c {\int_a^b}{f(x)}{dx}{=c} abf(x)dx=c

上面公式的 Latex代码

\begin{align}
{\int_a^b}{f(x)}{dx}{=c}
\end{align}

解决方案

在文件中添加 \usepackage{xcolor}

\usepackage{xcolor}
\usepackage{xcolor}

\begin{align}
{\int_a^b}{f(x)}{dx}{=c}
\end{align}

改变颜色之后的公式效果图

∫abf(x)dx=c \textcolor{red}{\int_a^b}\textcolor{blue}{f(x)}\textcolor{green}{dx}\textcolor{yellow}{=c} abf(x)dx=c

上面公式的代码

\begin{align}
 \textcolor{red}{\int_a^b}\textcolor{blue}{f(x)}\textcolor{green}{dx}\textcolor{yellow}{=c}
\end{align}
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐