多语言展示
当前在线:1237今日阅读:84今日分享:32

LaTex排版技巧:[30]如何输入带颜色的公式

LaTeX作为一个功能强大国际通用的排版软件,它特别适合于数理科学中科技论文、专业书籍排版, LaTeX尤其适合于各种符号公式的编排,其公式排版效果是目前常用的mathtype所不能比拟的。这里将latex的排版技巧按照系列经验的方式与大家分享下,希望对大家有所帮助。本小节关于如何输入带颜色的公式。
工具/原料
1

电脑

2

latex排版软件

方法/步骤
2

这里提供第一个公式的输入代码\usepackage{amsmath}\usepackage{empheq}\usepackage{xcolor}\usepackage{graphicx}\definecolor{hellmagenta}{rgb}{1,0.75,0.9}\definecolor{hellcyan}{rgb}{0.75,1,0.9}\definecolor{hellgelb}{rgb}{1,1,0.8}\definecolor{colKeys}{rgb}{0,0,1}\definecolor{colIdentifier}{rgb}{0,0,0}\definecolor{colComments}{rgb}{1,0,0}\definecolor{colString}{rgb}{0,0.5,0}\definecolor{darkyellow}{rgb}{1,0.9,0}\def\xstrut{\vphantom{\dfrac{(A)^1}{(B)^1}}}\begin{equation}\label{eq:6}E = %\colorbox{darkyellow}{$\xstrut a_vA$} -\colorbox{hellmagenta}{$\xstrut a_fA^{2/3}$} -\colorbox{green}{$\xstrut a_c\dfrac{Z(Z-1)}{A^{1/3}}$} -\colorbox{cyan}{$\xstrut a_s\dfrac{(A-2Z)^2}{A}$} +\colorbox{yellow}{$\xstrut E_p$}\end{equation}

注意事项

本文是作者根据自己的经验总结

推荐信息