Guest User

Untitled

a guest
Mar 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. [ textcolor{green}{sum}_{k=0}^n ]
  2.  
  3. newcommand*{opcolor}[2]{mathop{textcolor{#1}{#2}}}
  4.  
  5. documentclass{article}
  6. usepackage{xcolor}
  7. newcommand*{opcolor}[2]{mathop{textcolor{#1}{#2}}}
  8. newcommand*{csum}[1]{opcolor{#1}sum}
  9.  
  10. begin{document}
  11. [ mathop{textcolor{green}{sum}}_{k=0}^n ]
  12.  
  13. [ csum{green}_{k=0}^n ]
  14.  
  15. [ opcolor{green}{sum}_{k=0}^n ]
  16. end{document}
  17.  
  18. documentclass{article}
  19. usepackage{amsmath}
  20. usepackage{xcolor}
  21. begin{document}
  22. [ mathop{textcolor{green}{sum}}_{k=0}^n ]
  23. end{document}
  24.  
  25. documentclass{article}
  26. usepackage{xcolor}
  27. colorlet{mygreen}{green!80!black}% a littler darker
  28.  
  29. makeatletter
  30. newcommand*{mathcolor}{}
  31. % Catch an optional argument in #1
  32. defmathcolor#1#{math@color{#1}}%
  33. newcommand*{math@color}[3]{%
  34. % #1: empty or optional argument including brackets
  35. % #2: mandatory color argument
  36. % #3: stuff to be colored
  37. begingroupcolor#1{#2}#3endgroup
  38. }
  39. makeatother
  40.  
  41. begin{document}
  42. [
  43. mathcolor{mygreen}{
  44. int_{mathcolor{black}{k=0}}^{mathcolor{black}{n}}
  45. }
  46. mathcolor{red}{=}
  47. mathcolor{mygreen}{
  48. intlimits_{mathcolor{black}{k=0}}^{mathcolor{black}{n}}
  49. }
  50. ]
  51. end{document}
Add Comment
Please, Sign In to add comment