How to write inline equations?

  • Thread starter Thread starter Albertus Magnus
  • Start date Start date
  • Tags Tags
    equations Mathjax
AI Thread Summary
To write inline equations in MathJax, use double pound signs (##) for inline LaTeX and double dollar signs ($$) for stand-alone equations. A common issue arises when LaTeX does not render if there's no existing LaTeX on the page; refreshing the page can resolve this. The platform employs "lazy LaTeX rendering," meaning newly posted equations may not appear rendered until the page is refreshed. Users transitioning from other platforms like Stack Exchange may need to adjust to these specific formatting rules. Proper understanding of these conventions is essential for effective communication in mathematical discussions.
Albertus Magnus
Gold Member
Messages
27
Reaction score
27
So far as I can tell the normal way to write inline equations in mathJax is to surround the mathematical code by single dollar signs, or in the case of this site pound signs #. However, this never seems to work. Surrounding the code by double signs for centering and setting apart the equations works normally for me. What am I doing wrong?
For example I can't get this to go inline #\psi^*\psi#, but this works fine ##\psi^*\psi.##
 
Physics news on Phys.org
Here, you need two # or two $ to delimit equations. So ##F=ma## or $$F=ma$$Quote my post to see the syntax.

However, note that there's a known bug that LaTeX won't render if there isn't already LaTeX on the page. If you aren't seeing formatted maths in someone's post, refresh the page. If you aren't seeing it in a preview of your post, refresh the page while in preview mode (the wise poster copies text to clipboard first). You'll be back in edit mode, but maths should now render in preview.
 
  • Like
Likes Nugatory and Greg Bernhardt
Albertus Magnus said:
What am I doing wrong?

Here is the standard set of tips I send via PM to help folks get started with LaTeX at PF:

---------------------------------------------------------------------------------------------------
To post math equations here, it's best to use the LaTeX engine that PF provides. There is a helpful "LaTeX Guide" link below the Edit window to get you started. Note that you put double-$ delimiters at the start and end of each stand-alone line of LaTeX, and double-# delimiters at the start and end of in-line LaTeX that does not need to be on its own line.

Example of in-line LaTeX: ##v(t) = L \frac{di(t)}{dt}##

Example of stand-alone LaTeX:
$$v(t) = L \frac{di(t)}{dt}$$
Also, if you right-click on a LaTeX equation in a post, you get a pop-up menu to let you view the LaTeX source or view it in other formats.

LaTeX isn't supported in thread titles, so you can use simple text math in titles if you want.

Note also that PF uses a feature called "lazy LaTeX rendering" that speeds up page loads. When you first post your LaTeX in a thread, you will not see it rendered that first time. Just refresh your browser page to force it to be rendered, and then it should render whenever you come back to that page/thread in the future. If you edit your post that has LaTeX in it, when you save the edits you will note that the LaTeX has again not rendered. Just refresh your browser to force the LaTeX engine to re-render the equations.

If you have trouble using the Preview feature to check your LaTeX, you can use a website such as https://mathb.in/ or https://latexeditor.lagrida.com/ to preview your LaTeX before you post it.
---------------------------------------------------------------------------------------------------
 
Last edited:
  • Like
Likes PeroK, Albertus Magnus and jtbell
Thanks for all the info. I have got a copy of the LaTex guide and the FAQ as well as the terms and rules for y future reference. I think that my problem was that I was already familiar with using MathJax over at stack exchange (where the system is ever so slightly different) and took it for granted that I could do the same thing here. Use double pound signs for inline equations and dollars for centered separated equations. This differs at Stack Exchange where single and double dollar signs are used respectively, which is similar to the Tex code of which I am already somewhat familiar (I use MikTeX here at home).
 
Single dollar signs are a bad choice for LaTeX in a discussion forum, IMO. Say I want to tell you I bought something for $20 then found it elsewhere for $10. I don't want the bit between the dollars to render as LaTeX, and I prefer not having to scatter escape codes in normal discourse.
 
  • Like
Likes pbuk, SammyS and Greg Bernhardt
I want to thank those members who interacted with me a couple of years ago in two Optics Forum threads. They were @Drakkith, @hutchphd, @Gleb1964, and @KAHR-Alpha. I had something I wanted the scientific community to know and slipped a new idea in against the rules. Thank you also to @berkeman for suggesting paths to meet with academia. Anyway, I finally got a paper on the same matter as discussed in those forum threads, the fat lens model, got it peer-reviewed, and IJRAP...
This came up in my job today (UXP). Never thought to raise it here on PF till now. Hyperlinks really should be underlined at all times. PF only underlines them when they are rolled over. Colour alone (especially dark blue/purple) makes it difficult to spot a hyperlink in a large block of text (or even a small one). Not everyone can see perfectly. Even if they don't suffer from colour deficiency, not everyone has the visual acuity to distinguish two very close shades of text. Hover actions...
About 20 years ago, in my mid-30s (and with a BA in economics and a master's in business), I started taking night classes in physics hoping to eventually earn the science degree I'd always wanted but never pursued. I found physics forums and used it to ask questions I was unable to get answered from my textbooks or class lectures. Unfortunately, work and life got in the way and I never got further the freshman courses. Well, here it is 20 years later. I'm in my mid-50s now, and in a...

Similar threads

Replies
3
Views
1K
Replies
6
Views
1K
Replies
14
Views
2K
Replies
3
Views
2K
Replies
8
Views
1K
Back
Top