Adding Latex to questions
Hello,
I would like to allow the user to enter Latex in their questions and answers
To get mathjax to compile Latex with the AskBug Theme, I’ve entered
function mathhead(){
echo <<<CSS
<script type=”text/x-mathjax-config”>
MathJax.Hub.Config({
tex2jax: {
inlineMath: [[”$”,”$”]]
}
});
</script>
<script type=”text/javascript”
src=”https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full”>
</script>
CSS;
}
add_action(‘wp_head’, ‘mathhead’);
in the functions.php file.
This works, but not all the way:
For some reason the character “\” is being removed when a user asks a question in the text editor. Why is this?
Hello,
I made a fix to deal with this issue. But you cannot apply fix on your live site. I request you to manually remove
wp_unslash
from this line:
from your local file.
Lemme know.
Great! Problem Solved! Thanks