How Do I Use LaTeX on This Site?

  • LaTeX
  • Thread starter Chris L T521
  • Start date
  • Tags
    Latex
In summary, MathJax is a new LaTeX rendering program that is compatible with modern web browsers. The delimiters necessary to render the LaTeX codes are what you would typically expect when writing LaTeX documents; however, "$$" and "\[" are used for centering equations, and "\(" is used for inline equations. To see the LaTeX source code, right click the rendered image and select the "Show Math As" option in the drop down menu, followed by "TeX Commands".
  • #1
Chris L T521
Gold Member
MHB
915
0
We are using a new LaTeX rendering program on our site -- MathJax.

MathJax is compatible with all modern web browsers; the only catch is that you must have JavaScript enabled.

The delimiters necessary to render the LaTeX codes are what you would typically expect when writing LaTeX documents; take note that ${command}$ is disabled. However, "$$" and "\[" are used for centering equations, and "\(" is used for inline equations.

To see the LaTeX source code, right click the rendered image and select the "Show Math As" option in the drop down menu, followed by "TeX Commands".

Here are some examples:

Using the "$$" delimiter:

$$\oint_C fdx+gdy = \iint\limits_R\left(\frac{\partial g}{\partial x}-\frac{\partial f}{\partial y}\right)\,dA$$

$$\int_{\partial M} \omega = \int_M d\omega$$

$$e^x = \sum_{n=0}^{\infty}\frac{x^n}{n!}$$

Using the "\[" delimiter:

\[\begin{aligned}\int_0^1 x^2\,dx &= \left.\frac{1}{3}x^3\right|_0^1\\ &= \frac{1}{3}\end{aligned}\]

\[\begin{array}{c|c|c|c|c} 1 & 2 & 3 & 4 & 5\\\hline 6 & 7 & 8 & 9 & 10\end{array}\]

Using the "\(" delimiter:

If \(x\in S^{\prime}\), then \(x\in\text{cl}\,S\).

For any \(a,b,c\in\mathbb{R}\), if \(a<b\) and \(c>0\), then \(a+c<b+c\).

The solution to the differential equation \(\dfrac{dy}{dx}+y=x\) is \(y(x) = x-1+Ce^{-x}\).To me, the only delimiter that we will need to get used to is "\(". I don't think this will be much of a problem later down the road.

Happy LaTeXing! (Smile)
 
Physics news on Phys.org
  • #2
I would suggest to use this LaTeX program together with standard commands. The one I use to write pdf files in I use a double-dollar to center an equation and a single-dollar to make the equation appear smaller and part of the line without skipping, do you know what I am sayin' ? If it is possible to change the default settings then maybe this is a better command because it is consistent with the standard commands.
 
  • #3
ThePerfectHacker said:
I would suggest to use this LaTeX program together with standard commands. The one I use to write pdf files in ...

On a related note, which software do you (all) suggest for a Mac user? I had downloaded "Texit" (or something like that)... it was a 2gig file that I could never get working.

I would love to be able to communicate math via LaTex in .pdf files, so any suggestions along those lines would be greatly appreciated!
 
  • #4
ThePerfectHacker said:
I would suggest to use this LaTeX program together with standard commands. The one I use to write pdf files in I use a double-dollar to center an equation and a single-dollar to make the equation appear smaller and part of the line without skipping, do you know what I am sayin' ? If it is possible to change the default settings then maybe this is a better command because it is consistent with the standard commands.

The double dollar sign is available as I mentioned above (I personally use \[ for centering things in my TeX documents), but there's a reason why MathJax disables (by default) the use of the single dollar sign. Suppose that someone who doesn't know how to use TeX asks the following question:

"Suppose that Jack makes $8.50 an hour and Jill makes $8.25 an hour. How much money will they have total if Jack works 8 hours and Jill works 10 hours?"

Then what will happen is "8.50 an hour and Jill makes" will be TeXified and will confuse the newbie.

If you really want me too, I can add "$" to the list of inline delimiters (it will require me to read the documentation to see how to do it, but it is possible), but whenever they want to use monetary values in their question, they'd have to type $\$8.50$ instead of $8.50.

EDIT: I decided to enable the single dollar sign for inline TeX rendering. I hope you're happy now! (Tongueout)
 
Last edited:
  • #5
Chris L T521 said:
The double dollar sign is available as I mentioned above (I personally use \[ for centering things in my TeX documents), but there's a reason why MathJax disables (by default) the use of the single dollar sign. Suppose that someone who doesn't know how to use TeX asks the following question:

"Suppose that Jack makes $8.50 an hour and Jill makes $8.25 an hour. How much money will they have total if Jack works 8 hours and Jill works 10 hours?"

Then what will happen is "8.50 an hour and Jill makes" will be TeXified and will confuse the newbie.

If you really want me too, I can add "$" to the list of inline delimiters (it will require me to read the documentation to see how to do it, but it is possible), but whenever they want to use monetary values in their question, they'd have to type $\$8.50$ instead of $8.50.

Yes you are correct. The current one must stay. However, if it is possible, can you personalize LaTeX commands for members? If you know how to easily do this then I would appreciate. But if it is too much work then ignore my request.
 
  • #6
ThePerfectHacker said:
Yes you are correct. The current one must stay. However, if it is possible, can you personalize LaTeX commands for members? If you know how to easily do this then I would appreciate. But if it is too much work then ignore my request.

My experience with MathJax is that customised tags for LaTeX are flakey, I have had [tex] [/tex] work when reading the page with chrome, but not with IE8 of Opera.

CB
 
  • #7
The Chaz said:
On a related note, which software do you (all) suggest for a Mac user? I had downloaded "Texit" (or something like that)... it was a 2gig file that I could never get working.

I would love to be able to communicate math via LaTex in .pdf files, so any suggestions along those lines would be greatly appreciated!

I purchased MathType a few weeks ago to use LaTeX in Microsoft Word, and it's really good. They have a Mac version too; you should probably check it out.
 
  • #8
Great job with the install, Chris! We are working on the site almost around the clock between the two of us because right now I'm in Moscow, Russia and he is in the US. We have a twelve hour time difference between us so more or less one of us is doing something all the time. Credit is also due to Ackbach, who helped me research and discuss our potential choices for Latex software. Long story short, until we have a dedicated server we won't be able to run Latex the same way MHF did and for now, mathjax seems like the best option all things considered.
 
  • #9
Jameson said:
Great job with the install, Chris! We are working on the site almost around the clock between the two of us because right now I'm in Moscow, Russia and he is in the US. We have a twelve hour time difference between us so more or less one of us is doing something all the time. Credit is also due to Ackbach, who helped me research and discuss our potential choices for Latex software. Long story short, until we have a dedicated server we won't be able to run Latex the same way MHF did and for now, mathjax seems like the best option all things considered.

Can I just say that the LaTeX on this site looks better than MHF LaTeX ever did? The font sizes are correct, and the baselines are aligned. Great job!
 
  • #10
The Chaz said:
On a related note, which software do you (all) suggest for a Mac user? I had downloaded "Texit" (or something like that)... it was a 2gig file that I could never get working.

I would love to be able to communicate math via LaTex in .pdf files, so any suggestions along those lines would be greatly appreciated!

I use TeXshop. It seems to be free.

Unfortunately, I cannot post a link (I only have one post!). However, the page is http ://pages.uoregon.edu/koch/texshop/.
 
  • #11
In MathType, there's also a MathJax-LaTeX "translator". In both Windows & Mac versions, you can go to the Preferences menu and click on Cut and Copy Preferences (if your Preferences menu says "Translators" instead of "Cut and Copy Preferences", it's too old), choose MathJax-LaTeX from the list at the bottom, and it will produce the correct code to display on MHB. Just remember to either set or un-set the "Inline Equation" flag in the Format menu. Create the equation/expression in MathType, then copy & paste into MHB. There you have it.

So, with that in mind, I'll leave you with this expression, given to me by a mathematician who's also a chemist: \[ + \sum {{{\left( {{{\rm{F}}^ - }} \right)}^t}2\frac{{d\phi }}{{dk}}} \]
(Add sum floride to the t'th to d-phi d-k.)
 
Last edited:
  • #12
\[ \int \sin x \; dx = \cos x + c \]
dose not work how i can enable java ??
sorry it worked
 
  • #13
Amer said:
\[ \int \sin x \; dx = \cos x + c \]
dose not work how i can enable java ??
sorry it worked

You will find that sometimes mathJax is a bit slow, and when using the advanced editor to preview you may need to reload to get the LaTeX to compile (in fact you may find yourself having to reload when posting anyway).

The upside is that MathJax aligns the inline LaTeX material with the rest of the text better than the alternatives.

CB
 
  • #14
latex is it not shown.
i tried to refresh( reload the page ) several times nothing appeared :(
 
  • #15
Fixed. Thank you for pointing this out.
 
  • #16
Can I just say that the LaTeX on this site looks better than MHF LaTeX ever did? The font sizes are correct, and the baselines are aligned.

If I may add an opinion here -- please stay with MathJax! The reason it looks so much better than MHF's LaTeX is because MHF's LaTeX was converted into images for rendering. MathJax uses fonts. Ackbach mentioned one advantage of MathJax -- baselined equations. Another is that the math looks great at any zoom level. Zoom a page with math (I use ctrl+scrollwheel, then ctrl+0 to zoom back to normal) and notice that it looks great at any size. Images won't do that. They'll zoom, but they'll lose quality.

There are downsides to fonts, but not many. As CaptainBlack already mentioned, sometimes MathJax renders differently in one browser than in another. Sometimes this is due to how the browser handles specific fonts, and at the moment IE seems to be the worst. (Why is anyone still using IE anyway?)

For anyone wanting to keep up with MathJax's latest glitches and tweaks, their website does a good job of keeping us informed, as does their Google Group.
 

FAQ: How Do I Use LaTeX on This Site?

What is LaTeX and why should I use it on this site?

LaTeX is a typesetting software used for creating high-quality documents with complex mathematical equations and formatting. It is particularly useful for writing scientific papers and reports. On this site, LaTeX is used to format and display mathematical equations in a visually appealing and professional manner.

How do I use LaTeX on this site?

To use LaTeX on this site, simply enclose your mathematical equation or expression within two dollar signs ($$). For example, to display the equation y = mx + b, you would type $$y = mx + b$$ in your post or comment. This will render the equation in a formatted and readable manner.

Can I customize the appearance of my equations using LaTeX?

Yes, you can customize the appearance of your equations by using various LaTeX commands and symbols. For example, you can change the font size, add superscripts and subscripts, and use various mathematical symbols. A quick internet search can provide you with a list of commonly used LaTeX commands and their corresponding symbols.

Can I use LaTeX on any device?

Yes, you can use LaTeX on any device as long as you have access to the internet and a web browser. This site uses MathJax, a web-based rendering engine, to display LaTeX equations, so you do not need to install any additional software on your device.

Are there any limitations to using LaTeX on this site?

There are a few limitations to using LaTeX on this site. The MathJax engine may not be able to render all LaTeX commands and symbols, so some equations may not display properly. Additionally, there is a character limit for each post or comment, so excessively long equations may need to be split into multiple parts.

Similar threads

Replies
3
Views
878
Replies
14
Views
2K
Replies
1
Views
1K
Replies
2
Views
1K
Replies
3
Views
1K
Back
Top