When the math rendering method is set to katex, and there is Jupyter widget-like content (e.g. displaying a pandas dataframe in rich format), then math equations cannot be rendered. An example file is katex.ipynb in the zip file. This is the html output:

![katex](https://user-images.githubusercontent.com/25242516/170162926-37f90ee0-c039-4768-bbaf-a951a8b2671e.png)

It seems that the injection of require.js affects the loading of katex.js. As a workaround, modify the generated html file to add a <script> tag of katex.js without defer="" before the <script> tag of require.js.

```html
<!-- existing content before the script tag of loading require.js -->

<!-- add a script tag of loading katex.js without defer="" -->
<script src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js"></script>

<!-- existing content of the script tag of loading require.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>
```
[katex.zip](https://github.com/quarto-dev/quarto-cli/files/8767304/katex.zip)

2022-05-25T01:59:12Z
kendrewlau
closed
Katex cannot be loaded with Jupyter widget-like content
https://github.com/quarto-dev/quarto-cli/issues/967