i want to display the math equation using mathjax and generate a latex code of the equation below.
view.php
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
array(
'label'=>'equation',
'type'=>'html',
'value'=>$model->equation,
),
array(
'label'=>'$\TeX$ code',
'type'=>'raw',
'value'=>'<pre>'.CHtml::encode($model->equation).'</pre>'
),
),
)); ?>
model/equation.php
class Equation extends CActiveRecord
{
...
}
controller/ProblemController.php
...
public function actionView($id)
{ $equation=$this->loadModel($id);
$this->render('view',array(
'model'=>$problem,
));
}
...
equation table
id equation
1 $x^2=2$
2 $360^\circ=2\pi$
3 $1\text{rad}=57^\circ 17' 45''$
the equation outputs works fine with mathjax but the apostrophe in tex code becomes '.
it is expected to show $1\text{rad}=57^\circ 17’ 45’’$
but it appears to be
$1\text{rad}=57^\circ 17' 45''$
the same question appears here.