rendering $..$ and macros not work
See original GitHub issueHi. I have followed all the instructions to render with $ .. $ and it does not work. And neither when creating my macros
<body>
<script>
$(document).ready(function() { katex.render(formula, element, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\[", right: "\\]", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false} ],
macros: {
// Algebra-Precal
"\\lcm": "\\mathop{\\mathrm{lcm}}",
"\\sen" "\text{sen}\\",
// Calculus
"\\dd": "\\mathop{\\mathrm{d} #1}",
"\\abs": "\\lvert#1\\rvert",
}
});
});
</script>
</body>
the page with this problem is https://prob.matematicauniversitaria.com/
in the CSS I only have:
p{ font-family: times new roman; /*Latin Modern Math*/ font-size: 100% }
.katex{ font-size: 1.10em; /*1.16em dicen q es el 100%*/ }
and in the head I have the same thing that it provides https://katex.org/docs/autorender.html
What should I correct? Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)

Top Related StackOverflow Question
Thank you. Now I can see that it renders perfectly with the macros.
I used
in the
<body>Best regards!
You aren’t loading katex properly with your document.ready code, it looks like you aren’t loading jquery so you can’t use
$(document).ready(. I have put a fixed version below. You should also removeonload="renderMathInElement(document.body);"or maybe even the whole katex auto-render load line, as currently you are loading katex twice.