【LaTeX应用】设置字体颜色的三种方式

\textcolor{red}{text}

直接设置字体颜色,其中red只是其中一个预定义颜色值,可以换成其他预定义颜色值,比如blue

\textcolor[rgb]{1,0.5,0.5}{text}

用rgb的模式设置字体颜色,其中rgb的选值在0到1之间

\usepackage{color}
\definecolor{colorname}{rgb}{255,0,0}
\textcolor{colorname}{text}

同一设置颜色值,这种自定义的方式,可以根据自己的需要设置,其中rgb的值在0到255之间,调用的时候还是textcolor

猜你喜欢

转载自blog.csdn.net/m0_50984266/article/details/112340515