# LaTeX in Telegram Desktop

Yesterday @M42, a good friend of mine told me there was a partial solution to render $\LaTeX$ equations in Telegram Desktop, ChatJax, a code line that inserts a <script> html tag in the current page’s <head>, allowing sent $\LaTeX$ code in a Telegram Desktop Window to render. This could be saved as a handy boomark and be executed every time we’d like to render sent equations.

However, this had a big problem, appart from the obvious necessity of clicking the boomark every time we’d like to use it. If we started to use it in an open conversation, it would render the sent equations properly, but from now on, it would also try to render all non sent equations, producing a (curious) unwanted result.

Unsent $\LaTeX$ already rendered

Sent $\LaTeX$ as a rare encoding

So I started finding a solution, and after one hour of trying to make this code work automatically (with GreaseMonkey), once started the browser, and realizing that I have to target only a part of the Telegram Desktop Window to be rendered, I arrived to an useful MathJax Documentation about doing so with MathJax.Hub.Queue and it worked out!.

I’ve written a public gist here with a GreaseMonkey extension to render equations properly in Telegram Desktop. I’ve only given it a try in Firefox, and it works well!.

To download it, GreaseMonkey extension must be installed in the current browser, and it suffices to click Raw from the gist page, and it will pop up a confirmation to install it as an user script. To write inline $\LaTeX$, use a simple $. To write centered $\LaTeX$, use $\$.

The script is also available from GreasyFork here.

# Vector Space where norms aren't equivalent

A week ago, we were asked in Fourier Series class to find a counterexample to prove that norms aren’t equivalent in vector space $L^2(a,b)$.

The definition for this space is:

The norm based on the dot product $% = \int_a^b f \cdot g %]]>$ is:

We can define another norm as: $\|f\|_{*} = \int_a^b \lvert f \rvert$. It’s easy to prove that it’s a norm.

Let $f_n: (a,b) \rightarrow \mathbb{R}$, with $f_n(x)= e^{nx}$ for all $n\in \mathbb{N}$.

Thus:

We remember that for those two norms to be equivalent in $L^2(a,b)$ (vector space), there have to be $\lambda, \delta \in \mathbb{R^{+}}$, verifying that: $\delta \|f\|_{*} \le \|f\|_2 \le \lambda \|f\|_{*} \quad \forall f\in L^2(a,b)$.

Therefore:

But:

So we arrived at a contradiction.