Mathematica中文论坛-非官方

标题: latex color equation [打印本页]

作者: meatball1982    时间: 2017-12-16 08:50
标题: latex color equation
I read a post. about the color equation and words.
Great work.
https://betterexplained.com/articles/colorized-math-equations/

Repost here. for further use.

xelatex this_tex_file.tex


  1. % \documentclass{article}
  2. \documentclass[preview]{standalone}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage{amssymb}
  6. \usepackage{color}

  7. \newcommand{\plain}{\color{black}}
  8. \newcommand{\Frac}[2]{\genfrac{}{}{1pt}{}{#1}{#2}}        % thicker fraction line

  9. \definecolor{c1}{RGB}{114,0,172}   % primary
  10. \definecolor{c2}{RGB}{45,177,93}   % true
  11. \definecolor{c3}{RGB}{251,0,29}    % false
  12. \definecolor{c4}{RGB}{18,110,213}  % secondary
  13. \definecolor{c5}{RGB}{255,160,109} % tertiary
  14. \definecolor{c6}{RGB}{219,78,158}  % alt-primary

  15. \renewcommand{\familydefault}{\sfdefault}

  16. \begin{document}
  17. \begin{center}

  18. \newcommand{\growth}{\color{c1}}
  19. \newcommand{\unitQuantity}{\color{c2}}
  20. \newcommand{\unitInterest}{\color{c3}}
  21. \newcommand{\unitTime}{\color{c4}}
  22. \newcommand{\perfectly}{\color{c5}}
  23. \newcommand{\compounded}{\color{c6}}

  24. $\growth e
  25. \plain =
  26. \perfectly \lim_{n\to\infty}
  27. \plain \left(
  28. \unitQuantity 1 + \unitInterest \frac{1}{\compounded n}
  29. \plain \right)
  30. \unitTime^{1 \cdot \compounded n}
  31. $

  32. \growth       The base for continuous growth
  33. \plain        is
  34. \\
  35. \unitQuantity the unit quantity
  36. \unitInterest earning unit interest
  37. \unitTime     for unit time,
  38. \\
  39. \compounded   compounded
  40. \perfectly    as fast as possible

  41. \end{center}
  42. \end{document}
复制代码


Untitled.png (30.41 KB, 下载次数: 890)

Untitled.png





欢迎光临 Mathematica中文论坛-非官方 (http://ilovemathematica.com/) Powered by Discuz! X3.2