admin管理员组文章数量:1335361
I have a couple variables in my javascript that hold color values, i.e.
var color = #ABCDEF
I'm trying to use these variables to color some text that I have, but it seems that MathJax doesn't support hex color values. Is there anyway to circumvent this in order to use the variable in the \color?
I have a couple variables in my javascript that hold color values, i.e.
var color = #ABCDEF
I'm trying to use these variables to color some text that I have, but it seems that MathJax doesn't support hex color values. Is there anyway to circumvent this in order to use the variable in the \color?
Share Improve this question asked Aug 27, 2015 at 23:15 gamehengamehen 3241 gold badge6 silver badges18 bronze badges2 Answers
Reset to default 4You can try \color[HTML]{ABCDEF}
.
You need to add \usepackage{xcolor}
to the preamble.
it seems that MathJax doesn't support hex color values
Sure it does. E.g., \color{#ABCDEF}{x+1}
works fine in the standard configurations. You can also load MathJax's color extension to make the \color
mand more patible with LaTeX's syntax (thought it doesn't implement the HTML color model suggested by sergej, but does do rgb and several others).
You don't give enough of your code to tell how you intend to use you color variable, but one thing that is wrong is that you have left out the quotation marks:
var color = "#ABCDEF";
The issue now will be how you get this value into the \color
mand within you math expressions. If you are trying to make all the math on your page be a different color, it would be best to use CSS for that. E.g.,
<style>
.MathJax {color: #ABCDEF}
</style>
would do it for MathJax's HTML-CSS output.
本文标签: javascriptUsing hex values for colors in LaTexMathJaxStack Overflow
版权声明:本文标题:javascript - Using hex values for colors in LaTexMathJax - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742338828a2456179.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论