I'm just asking if it is possible to insert LaTeX into a social networking app? If so, how?
-
6Hi there, and welcome to TeX.SE! It's a little hard to tell what you want in your app, but it's certainly possible. For instance, MathJax is used to display math in web apps, or Jupyter can convert notebooks in .tex format. If you could edit your question to provide more detail, we'll be able to understand your needs better. – gz839918 Jul 30 '23 at 16:06
-
This question is perfectly clear as stated. This "needs details or clarity" seems to be used too often. It's rather silly. – LaTeXereXeTaL Jul 30 '23 at 19:14
-
1@LaTeXereXeTaL-- perfectly clear as edited. (The original wasn't, but the editing had been done by the time you looked. Not that I have any idea how to answer it.) – barbara beeton Jul 30 '23 at 23:40
-
2I think the answer greatly depends on which app, and how much of TeX (MathJax, just a few packages, and an entire TeXLive). – Teepeemm Jul 31 '23 at 01:17
1 Answers
If you are simply talking about LaTeX code without the possibility of having it typeset into input, you can include that just about anywhere because it is usually only ASCII characters, occasionally accompanied by Unicode characters.
As far as I currently know, including a full LaTeX implementation into something like a social media platform has not been done and indeed may not be possible. The reason is rather deceptive in that many developers say they "support LaTeX" when in fact what they really mean is that they support a LaTeX-like command syntax (i.e. commands that begin with a backslash character). This alone does not mean actual LaTeX is in use. I elaborate on this in my answer https://tex.stackexchange.com/a/648198/218142.
As an example from social media, consider the Mathstodon.xyz instance. The term "LaTeX" is advertised but it really uses MathJax, a JavaScript library that indeed mimics a lot of LaTeX's capability. You can examine the source code for Mathstodon on their GitHub home https://github.com/christianp/mastodon.
Similarly, Jupyter Notebook sometimes claims support for LaTeX, but it too uses MathJax. You can export a notebook to TeX, but I have never experimented with that and have no idea how good the generate code is. Still, processing that code requires a local TeX Live (or similar) installation.
Using actual LaTeX requires an extensive backend including a processing engine. On my current TeX Live 2023 installation, the pdftex engine is 5.3MB in size and that engine would need to be present somewhere in the machinery for every user to make use of it.
If you count WordPress blogs as "social media" then I know of one plugin that does indeed use an actual LaTeX distribution, Quick LaTeX. It works by piping the LaTeX markup to a server where it is processed natively by a TeX Live distribution and then returned to the blog as an image. Still, unlike the other systems I describe it allows for LaTeX packages and genuine LaTeX markup. This model may be worth looking into but I have no knowledge about whether or not it would scale to a social media platform with millions of users.
The only large scale software package I use, and that I am aware of, that uses a locally installed LaTeX distribution is Manim Community, a fork of the Python-based animation system used by 3Blue1Brown. Indeed, it requires a local TeX Live or other suitable TeX/LaTeX distribution (I haven't tested it with MikTeX).
In summary, due to the extensive backend requirements, to my knowledge it is not (yet?) possible to integrate full LaTeX capability into something like a social media platform. I hope someone someday finds a way to do it because I think it would be immensely useful.
- 3,594