How can I view latex symbols in html like the following:
Asked
Active
Viewed 676 times
0
-
What do you mean by “view latex symbols”? Are you actually asking how to format mathematical expressions in HTML documents? Or how to convert from LaTeX to HTML? Which kinds of expressions? The one given as example can easily be represented in HTML, using just `i` and `sup` markup (though the result is not typographically good). For more complicated display expressions, it’s different. – Jukka K. Korpela May 04 '14 at 04:47
2 Answers
3
You won't get this with vanilla Markdown; it simply doesn't have any support for math.
The best solution depends on your use case, of course, and without more information it's hard to say what your best bet is. But MathJax is likely a good starting point.
In general, using MathJax looks something like this example from the docs:
<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript"
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</body>
</html>

ChrisGPT was on strike
- 127,765
- 105
- 273
- 257
-
1Note from the future: cdn.mathjax.org is nearing its end-of-life, check https://www.mathjax.org/cdn-shutting-down for migration tips (and perhaps update your post for future readers). – Peter Krautzberger Apr 21 '17 at 07:25
0
There are latex to html converters. Check out this link:
http://en.wikibooks.org/wiki/LaTeX/Export_To_Other_Formats#Convert_to_HTML
Also this question might prove useful: