(La)TeX on Habrahabr

hi, Habr.


Question about native display formulas on habré there long enough (I myself recently wrote to tech support with this question, received the answer that there are plans, but so far very vague), and today (or rather yesterday) was raised in the comments to "the Magic of tensor algebra: Reloaded". And if you look at a hub for LaTeX, then immediately 2 latest articles on the theme of the formulas in the articles of Habr.



Most interesting is that, in principle, to connect the support for TeX / LaTeX to any website, it takes a couple minutes and a couple lines of code: it is enough to connect MathJax, which has already become almost standard in the task of displaying the formulas in the browser.

Traditionally, formulas habré are images, but all of the above leads to a well-defined idea that there is another kind of crutches. On the one hand, less comfortable with the other more.

...

Here it is:
the
v=document.createElement('script');v.type='text/x-mathjax-config';v.textContent="MathJax.Hub.Config({tex2jax:{inlineMath:[['$tex','$']],displayMath:[['$$tex','$$']]},asciimath2jax:{delimiters:[['$asc','$']]}});";s=document.createElement('script');s.src='//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML&locale=ru';document.head.appendChild(v);document.head.appendChild(s);
Ctrl+C, F12 and Ctrl+V.
If desired, can be used as a bookmarklet by adding at the beginning `javascript:`

The audience of Habra are not the kind of people you can scare a console browser or a bookmarklet, right?

An inline TeX is inserted into $tex ...$, a separate paragraph in the $$tex ... $$, and in addition there is support for AsciiMath in the $asc ... $.

Well, living examples, of course:

$$tex \frac{1}{\pi} = \frac{2 \sqrt 2}{9801} \sum_{k=0}^{\infty} \frac{(4k)!(1103 + 26390k)}{(k!)^4 396^{4k}} $$

Or here is an inline formula: $tex e^{ \frac{d}{dt} } = 1 + \frac{1}{1!}\; \frac{d}{dt} + \frac{1}{2!}\;\frac{d^2}{dt^2} + \frac{1}{3!}\;\frac{d^3}{dt^3} + \cdots $.

Cons all this is less obvious, and, in truth, cast doubt on the viability of the idea, but at least as an experiment — interesting, IMHO. What do you think?
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Car navigation in detail

PostgreSQL: Analytics for DBA

Google has launched an online training course advanced search