# What is the Latex and MathJax, how can I write beautiful formulas in my posts?

I get regularly the feedback in comments to use Latex or MathJax. Also I would write beautiful formulas what I can do only on pen & paper. Where can I get info about these?

• This question intends to be a community wiki post. Anybody feel free to improve it. – peterh - Reinstate Monica Sep 10 '16 at 18:49
• – Qmechanic Sep 10 '16 at 18:50
• @Qmechanic The goal is to have a single-click, easily understable reference point for newbies using many formulas, but not knowing latex. The related questions contain a lot of info, but all of them are references to other, mostly complex sources and don't contain direct information. This is partially because the the MathJax on this meta site is not activated. I solved this problem by 1) providing directly available info 2) it is minimal and easy-to-understand 3) I used pictures to avoid the problem of the lack of MathJax. – peterh - Reinstate Monica Sep 10 '16 at 18:52
• The "Ask Question" page sidebar of course includes links to physics.stackexchange.com/editing-help (scroll down to physics.stackexchange.com/editing-help#latex) and math.harvard.edu/texman, and there is physics.stackexchange.com/help/notation in the help center though it is not as prominent as I would like. – dmckee --- ex-moderator kitten Sep 10 '16 at 19:02
• @dmckee These posts contain how the MathJax inclusion works here, but doesn't contain a list of the basic markups. Sometimes it is not trivial to use (for example, \infty or the correct \frac syntax can't be found without googling). – peterh - Reinstate Monica Sep 10 '16 at 19:04
• @peterh I learned how to use LaTeX from those links, after never writing math on the computer besides the Microsoft Word equation editor. I think they work pretty well. Do you have any specific reasons for thinking that they're insufficient? – HDE 226868 Sep 10 '16 at 19:06
• @HDE226868 This post is not for you as a Latex tutorial, because it is clear that you know it. It is for you only to use it later as a possible reference point while you help newbies to avoid their posts being voted down or the closure of their questions. – peterh - Reinstate Monica Sep 10 '16 at 19:07
• @peterh Why couldn't I simply link them to the other pages? I'm just saying that this page duplicates the others - another competing standard. – HDE 226868 Sep 10 '16 at 19:10
• @HDE226868 IT ergonomical reasons. Only a practically negligible part of the users will click twice to find a huge documentation, and then dig out from it the few required information they actually need. – peterh - Reinstate Monica Sep 10 '16 at 19:11
• @HDE226868 In addition, the only place where a PSE-centric minimal subset of the MathJax can exist, is here on the meta. – peterh - Reinstate Monica Sep 10 '16 at 20:22
• @peterh That's some interesting criticism of the math.se thread (even if it's phrased in amazingly inappropriate terms), regarding "everybody included therein what he know from the MathJax or found important". Have you got any sort of coherent proposal for how to avoid this happening here? You seem to have a lot of criticisms, and all your solutions only make the problems worse. – Emilio Pisanty Sep 12 '16 at 11:28
• @Qmechanic (edited version of previous,misunderstable comment) The MathSE post is 1) out of the PSE 2) everybody included therein what he knows from the MathJax or found important. The result is a huge mess practically impossible for a new reader to understand. – peterh - Reinstate Monica Sep 12 '16 at 11:52
• @EmilioPisanty Yes. My idea is 1) to have a minimal post as an accepted answer, it will bump it to the top, 2) additional extensions, or links to additional material can be posted as different answers. I am really sorry for the inappropriate formulation, it wasn't intentional. Note my first comment: "This question intends to be a community wiki post. Anybody feel free to improve it." – peterh - Reinstate Monica Sep 12 '16 at 12:09

While this seems like a well-intentioned thread, there is already a comprehensive tutorial over on the Mathematics Meta Stack Exchange site, at

## MathJax basic tutorial and quick reference

and there really isn't that much point in duplicating the enormous amount of work that has gone into writing that.

• Yes, 1) I intentionally focused to the most common markups on the PSE 2) there is a HTML remark for the editors on the beginning of the post, warning exactly to this possible problem (if you open the post as edit, you can see that). – peterh - Reinstate Monica Sep 12 '16 at 11:30
• Oh, OK, I see, so the idea is to have a really incomplete tutorial so that people looking for something have yet another stepping stone to go through. Yeah, I don't think that's a cool thing to do. – Emilio Pisanty Sep 12 '16 at 11:34
• I have also the idea, that the not so important markups could be inserted here as additional answers. I would give a pipe to my post, it will fix it to the top, and so the complete or more detailed references could be put below that, while a 5-minute to learn tutorial could remain on the top. – peterh - Reinstate Monica Sep 12 '16 at 11:41
• And, if the plan is to add in other answers with more stuff, it just sounds more and more like the plan is to duplicate all the work over on math.se. I see absolutely nothing in your answer that isn't already covered above the fold on math.se, in a way that is much easier to find. There are indeed a few common notations used here but not commonly on math.se, but you have neglected to include them, so I really don't see the point. – Emilio Pisanty Sep 12 '16 at 11:48
• The MathSE doesn't have a PSE-centric minimal subset, and it won't ever have. Actually, it doesn't even hat a minimal tutorial. The goal is the minimal quick tutorial, which is really minimal, really quick, but really tutorial. – peterh - Reinstate Monica Sep 12 '16 at 11:49
• (edited version of misunderstable first comment) This is what I used until now to direct them to learn. My only problems with this are: 1) it is out of the PSE, hasn't a PSE-centric view 2) Everybody included what he considered important, the result is a nearly complete reference what is impractical to learn from a zero-latex knowledge. | Although I think it is quite useful (better as most google docs) for people already knowing latex, but looking for a specific markup. – peterh - Reinstate Monica Sep 12 '16 at 11:53
• A PSE-centric minimal subset to the MathJax will be always only one, and its place is only here on the meta. It is the significant difference, what makes this post different from the lot of docs elsewhere. The only reason why it didn't exist until now was the lack of the MathJax support on the meta site, but fortunately there is a workaround to this problem with a little work. I suspect, maybe a new ask to the CMs/SE team, to enable MathJax also on the meta site, could maybe help a lot. – peterh - Reinstate Monica Sep 12 '16 at 12:04

(La)tex is a extensible textual document format for mathematical symbols. Although it is huge, you need only to know a very small subset of it to be able to write real formulas in your posts.

MathJax is a Javascript library what makes the Latex formatting usable in a HTML/Javascript/Css environment. The StackExchange site network uses MathJax on most of the sites what requires it, the Physics SE is one of them.

Its markup on the level you need is very simple, much easier even as the HTML. Here is what is enough for you. You can learn it in around 5 minutes.

• Anything what you want to be shown in page as formula, you have to include between two \$s. So, a text like$a^b will be shown so: . • If you use double dollars, the formula will be center-aligned in a new line. • + and - are working as common: . • For multiplication, you can use 1) nothing (ab$ is ) 2) \cdot ($a\cdot b$ is ) 3) and some others. • For fractions, there is a more complex syntax: is expressed by $\frac{a}{b}$. • Here you can see, you can use {} for grouping the terms. It is essentially like () in math, but it is only for the positioning of the elements and it will be invisible in the result. • You can use powers, or you can write anything in the top-right index with a ^. For example, $a^b$ will be . • You can get things into the bottom-right index by a _: $a_b$ will be . • Square root is going so: $\sqrt{a}$ will be . • For the common functions, e (in the sense of 2.71...), h (the Planck constant) and c (speed of light), you can use them simply as texts (thus, without the leading \). • and the other greek letters can be expressed by a leading backslash, like: $\pi$, $\delta$, $\epsilon$. The capital greek letters can be done usually by capital markup: $\Pi$, $\Delta$, will be . • Degree, grad is a little bit tricky. There is the $\circ$ to show a little circle: . Put this into the top-right index: $42^\circ C$ will be . • Infinity is \infty (). A good option to exercise if you start to write a question or an answer on the main site. Below your textbox, you will see, how it will seem after post (Warning: don't post your tries, it will contaminate the site! Discard them after you're ready!). Homework: formulate in MathJax the well-known time dilation formula of the SR: • Related Meta MSE post: MathJax basic tutorial and quick reference. – user36790 Sep 12 '16 at 3:15 • On the degree symbol: This isn't standard LaTeX, but MathJax is perfectly happy to take the unicode degree symbol, i.e. try $45°\$. – Emilio Pisanty Sep 12 '16 at 11:38
• Everybody: if you think something is missing, drop a comment and I will do the handwork. – peterh - Reinstate Monica Sep 12 '16 at 12:54