Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autorender README.md examples don't work. #1049

Closed
keithpjolley opened this issue Dec 30, 2017 · 2 comments · Fixed by #1050
Closed

autorender README.md examples don't work. #1049

keithpjolley opened this issue Dec 30, 2017 · 2 comments · Fixed by #1050

Comments

@keithpjolley
Copy link

<header>
...
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/contrib/auto-render.min.js" integrity="sha384-cXpztMJlr2xFXyDSIfRWYSMVCXZ9HeGXvzyKTYrn03rsMAlOtIQVzjty5ULbaP8L" crossorigin="anonymous">
</script>
</header>

gives a ReferenceError: katex is not defined error in the console.

In the index.html example file, which doesn't use the CDN, it also shows <script src="/katex.js" type="text/javascript"></script> which gave the hint of what's missing from README.md:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.css" integrity="sha384-exe4Ak6B0EoJI0ogGxjJ8rn+RN3ftPnEQrGwX59KTCl5ybGzvHGKjhPKk/KC3abb" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.js" integrity="sha384-OMvkZ24ANLwviZR2lVq8ujbE/bUO8IR1FdBrKLQBI14Gq5Xp/lksIccGkmKL8m+h" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/contrib/auto-render.min.js" integrity="sha384-cXpztMJlr2xFXyDSIfRWYSMVCXZ9HeGXvzyKTYrn03rsMAlOtIQVzjty5ULbaP8L" crossorigin="anonymous">
</script>

I think adding this would make it easier for newbies such as myself to get auto-render working more quickly.
Thanks - Keith

edemaine added a commit to edemaine/KaTeX that referenced this issue Dec 30, 2017
This is an attempt to flesh out the required <head> tags needed to make a full
working example of autorender, including KaTeX itself, to help people get
started with KaTeX.
@edemaine
Copy link
Member

edemaine commented Dec 30, 2017

Good point! This does make it difficult to get started using KaTeX; and I've definitely wanted a copy/pastable complete example for this purpose before myself. I've created #1050 as a first stab at this. Would you like to take a look and see if that would have helped you?

@keithpjolley
Copy link
Author

Yes, that would do it. Everything but that little bit was "cut and paste" to get to work.
Thank you!

kevinbarabash pushed a commit that referenced this issue Jan 1, 2018
This is an attempt to flesh out the required <head> tags needed to make a full
working example of autorender, including KaTeX itself, to help people get
started with KaTeX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants