M
M
Maxibonoff2014-09-23 14:27:50
css
Maxibonoff, 2014-09-23 14:27:50

How to define different styles for plain text and tex formulas within the same pair of tags in an html file?

For example, in html between tags there is text interspersed with tex-formulas, it is supposed to make plain text gray, and formulas black. How to make it so that when a formula is recognized in the text, it is automatically assigned the desired color. Mathjax is used to display formulas.
Separating each formula with a span tag with the corresponding id is not an option, since this is a laborious process, there are a lot of formulas. The p tag is grayed out.
An example of one such page:

<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../css/iphone.css">
<script type="text/javascript" src="../Mathjax/MathJax.js?config=TeX-AMS_HTML-full"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
    tex2jax: {inlineMath: }
  });
</script>
</head>

<body>

<div>

<h1>Определение производной</h1>

<hr size=2 width="100%" align=center>

<p><span style='color:#22ADE7'><strong>Определение:</strong></span> Производной функции $ѓ $ в точке $x_0$называется предел отношения приращения функции к приращению аргумента при стремлении приращении аргумента к нулю, если предел существует и конечен.</p>

<p>\[\underline{\overline{\left|f'\left(x_0\right)={\mathop{\lim }_{\triangle x\to 0} \frac{\triangle f}{\triangle x}\ }\right|}}\]</p>

<p>Поставив в соответствие каждому значению $x$ (если это возможно) число $f'\left(x\right)$, получим функцию $f'$, называемую производной функции $f$.</p>

<p>Приращение функции - изменение значения функции $f\left(x\right)-f\left(x_0\right)=f\left(x_0+\triangle x\right)-f(x_0)$ , обозначается $\triangle f=f\left(x_0+\triangle x\right)-f(x_0)$.</p>

</div>

</body>

</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2014-09-23
@Maxibonoff

p nobr{
   color:black;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question