# KaTex and Framework

I’m new to Frameworks and work with the Split View Template.
Therefore i want to show math, i included the javascript library from KaTex just inside the head-tag

<link rel="stylesheet" href="../css/app.css">
<body>


At the end of the index.html i put the javascript code as

  <!-- Your custom app scripts -->
<script src="../js/app.js"></script>
<script src="../katex/katex.min.js" type="text/javascript"></script>
<script src="../katex/contrib/auto-render.min.js" type="text/javascript"></script>
<script>
renderMathInElement(document.body);
</script>
</body>


Now all math formulas are rendered inside index.html as expected, e.g. $$a^2$$ as a² in displaystyle. But if i load another page with the same code, no math formula is rendered. In this case the file mechanics.html is loaded, but no math formula get rendered (snippet from the template).

<div class="page" data-name="mechanics">
<div class="navbar">
<div class="navbar-inner sliding">
<div class="left">

This is how JavaScript works, you need to call your renderMathInElement within pageInit for every page loaded and pass page’s HTML element to this function