Testing LaTeX (powered by MathJax)

In summary: %...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%...%
  • #1
Chris L T521
Gold Member
MHB
915
0
\[\int_0^{\infty}e^{-x^2}\,dx=\frac{\sqrt{\pi}}{2}\]

This is inline: \(\frac{\sqrt{b^2-4ac}}{2a}\)

Other centered equation

$$\Gamma(x)=\int_0^{\infty}e^{-t}t^{x-1}\,dt $$
 
Last edited:
Physics news on Phys.org
  • #2
So LaTex in brackets is centered? Not sure I get the syntax, though I'm trying to scroll through it on the mobile...
 
  • #3
So \ ( and \ ), with no spaces, gives you inline. \ [ and \ ], with no spaces, gives you displayed. \(x^{2}+4x-4=0\), but \[x^{2}+4x-4=0.\]

The first is inline, the second displayed.
 
  • #4
How odd. I was able to do centred fine using the dollar signs, but the others wouldn't work...
 
  • #5
Prove It said:
How odd. I was able to do centred fine using the dollar signs, but the others wouldn't work...

Yeah, it looks like the double-dollar signs are enabled for displayed equations, but the single are not enabled for inline, although MathJax is capable of doing those as well. Chris mentioned to me in an email that the reason for that is there are quite a few algebra problems concerning money, and newbies would have a hard time escaping those characters.
 
  • #6
Chris L T521 said:
$$\Gamma(x)=\int_0^{\infty}e^{xt}t^{x-1}\,dt$$

Apparently LaTeX does not check for math mistakes. ;)
 
  • #7
Ackbach said:
Yeah, it looks like the double-dollar signs are enabled for displayed equations, but the single are not enabled for inline, although MathJax is capable of doing those as well. Chris mentioned to me in an email that the reason for that is there are quite a few algebra problems concerning money, and newbies would have a hard time escaping those characters.

I actually meant starting with the square and round brackets didn't work. Maybe I wasn't doing it right...

Test: \( (a + b)^n = \sum_{r = 0}^n {n\choose{r}}a^{n-r}b^r \)

\[ \lim_{h \to 0}\frac{\sin{h}}{h} = 1 \]

Hmm, now it works ><
 
  • #8
Test:

Some text then inline \(f(x)=\sin(x^2/23)\) OK

\[f(x)=\frac{1}{\sin(x)}\] OK

\( \displaystyle f(x)=\frac{1}{\sin(x)} \)...\( f(x)=\frac{1}{\sin(x)} \) - just messing with the inline form

more text.

The thing that I don't like about the MathJax \ [ ... \ ] delimiters is the amount of white space inserted before and after the LaTeX

Note the [ noparse] [ /noparse] taggs are not working

CB
 
  • #9
CaptainBlack said:
Test:

Some text then inline \(f(x)=\sin(x^2/23)\) OK

\[f(x)=\frac{1}{\sin(x)}\] OK

\( \displaystyle f(x)=\frac{1}{\sin(x)} \)...\( f(x)=\frac{1}{\sin(x)} \) - just messing with the inline form

more text.

The thing that I don't like about the MathJax \ [ ... \ ] delimiters is the amount of white space inserted before and after the LaTeX

Note the [ noparse] [ /noparse] taggs are not working

CB

Since this being called from the MathJax js file, there was no need to create a BBcode for it. Hence, noparse will have no effect on it.
 
  • #10
Chris L T521 said:
Since this being called from the MathJax js file, there was no need to create a BBcode for it. Hence, noparse will have no effect on it.

So question: how do we output raw LaTeX code? Verbatim?
 
  • #11
Ackbach said:
So question: how do we output raw LaTeX code? Verbatim?

It turns out you can do that using the code tags. For example,

Code:
$\displaystyle\int_{\partial M} \omega$

would compile to \( \large{\displaystyle{\int_{\partial M} \omega}} \).
 
Last edited by a moderator:
  • #12
Writing Inline LaTeX

Add "\displaystyle" to the beginning of your inline latex code.

LaTeX without "\displaystyle"

Code:\int_{0}^{\infty}\frac{\ln(x)}{(x-a)(x-b)}dx

\( \int_{0}^{\infty}\frac{\ln(x)}{(x-a)(x-b)}dx \)

LaTeX with "\displaystyle"

Code:\displaystyle \int_{0}^{\infty}\frac{\ln(x)}{(x-a)(x-b)}dx

\( \displaystyle \int_{0}^{\infty}\frac{\ln(x)}{(x-a)(x-b)}dx \)
 
  • #13
Re: Writing Inline LaTeX

I just realized the LaTeX is showing itself nicely! That's good.

Perhaps a little suggestion: I love to render LaTeX by using the dollar sign, but, is there a way to render fractions, sums, integrals, etc by not using \displaystyle? It's annoying to write it everytime!
 
  • #14
Re: Writing Inline LaTeX

Try double-dollar signs (two to open, two to close).
 
  • #15
Re: Writing Inline LaTeX

Well it didn't work that well, because by using doble dollar sign, it will center the content, and I don't always need to center the content.
 
  • #16
Just thought I'd test out some things too. Here's an inline equation \(u = \phi \cdot \exp \left\{ {{\textstyle{1 \over 2}}\sigma \left( {x + y} \right)} \right\}\) and here's a display (centered) equation \[{\rm{Bond Value}} = {\rm{C}}\left[ {\frac{{1 - \frac{1}{{{{\left( {1 + {\rm{r}}} \right)}^{\rm{t}}}}}}}{{\rm{r}}}} \right] + \frac{{{\rm{FV}}}}{{{{\left( {1 + {\rm{r}}} \right)}^{\rm{t}}}}}\]
So, how'd that work out?
 
  • #17
afwings said:
Just thought I'd test out some things too. Here's an inline equation \(u = \phi \cdot \exp \left\{ {{\textstyle{1 \over 2}}\sigma \left( {x + y} \right)} \right\}\) and...

Ok, that's something I just noticed -- following the MathJax close delimiter -- \) -- even if I add a space, the space doesn't show up in the post. Wonder what happens if I add 2 spaces? Here's a shot at it: \({b^2} - 4ac
% MathType!MTEF!2!1!+-
% feaagGart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfgBPj
% MCPbqedmvETj2BSbqefm0B1jxALjhiov2DGCKCLv2AGW0B3bqefqvA
% Tv2CG4uz3bIuV1wyUbqee0evGueE0jxyaibaieYhf9irFfeu0dXdh9
% vqqj-hEeeu0xXdbba9frFj0-OqFfea0dXdd9vqai-hGuQ8kuc9pgc9
% q8qqaq-dir-f0-yqaiVgFr0xfr-xfr-xb9adbaqaaeGaciGaaiaabe
% qaamaaeaqbaaGcbaGaamOyamaaCaaaleqabaGaaGOmaaaakiabgkHi
% TiaaisdacaWGHbGaam4yaaaa!4201!
\) ok, I added 2 spaces, and still one showed up. Nice to know. (If it's already been pointed out, sorry I missed it.)

Trying something else. Here's a simple matrix: \[\left[ {\begin{array}{*{20}{c}}{10}&{20}\\{30}&4\end{array}} \right]
% MathType!MTEF!2!1!+-
% feaagGart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfgBPj
% MCPbqedmvETj2BSbqefm0B1jxALjhiov2DGCKCLv2AGW0B3bqefqvA
% Tv2CG4uz3bIuV1wyUbqee0evGueE0jxyaibaieYhf9irFfeu0dXdh9
% vqqj-hEeeu0xXdbba9frFj0-OqFfea0dXdd9vqai-hGuQ8kuc9pgc9
% q8qqaq-dir-f0-yqaiVgFr0xfr-xfr-xb9adbaqaaeGaciGaaiaabe
% qaamaaeaqbaaGcbaWaamWaaeaafaqabeGacaaabaGaaGymaiaaicda
% aeaacaaIYaGaaGimaaqaaiaaiodacaaIWaaabaGaaGinaaaaaiaawU
% facaGLDbaaaaa!43CF!
\]
 
  • #18
I'm not following what's going on in the matrix you made. Is that the intended output or did something go wrong?
 
  • #19
Jameson said:
I'm not following what's going on in the matrix you made. Is that the intended output or did something go wrong?

Jameson, thanks for following up on that. There are really 2 issues shown in my post, neither of which I believe to be MHB's error.

  1. When viewing the forum in FF16 for Windows (and only in that configuration), the character immediately following an inline equation rendered by MathJax overlaps the right edge of the equation. If a period follows the equation, the period ends up inside the equation, like this one (again, this effect only happens on Windows, only in Firefox, and only with Math Renderer > MathML): \(\left( {x,y} \right)
    % MathType!MTEF!2!1!+-
    % feaagGart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfgBPj
    % MCPbqedmvETj2BSbqefm0B1jxALjhiov2DGCKCLv2AGW0B3bqefqvA
    % Tv2CG4uz3bIuV1wyUbqee0evGueE0jxyaibaieYhf9irFfeu0dXdh9
    % vqqj-hEeeu0xXdbba9frFj0-OqFfea0dXdd9vqai-hGuQ8kuc9pgc9
    % q8qqaq-dir-f0-yqaiVgFr0xfr-xfr-xb9adbaqaaeGaciGaaiaabe
    % qaamaaeaqbaaGcbaWaaeWaaeaacaWG4bGaaiilaiaadMhaaiaawIca
    % caGLPaaaaaa!40E2!
    \). I've filed this as a MathJax bug, but it may be a Firefox bug. There are other things going on in Firefox 16. (And it may already be corrected; hard to tell.)
  2. The second issue is related to how MathType codes matrices with the Math Help Boards translator, which will be added to Cut & Copy Preferences when MathType 6.9 is released (no projected release date yet). We've already corrected this.

Bob
 
  • #20
Hi Bob,

Glad it's all working then. I notice in your post how a long string of code renders a very short \(\displaystyle \left( {x,y} \right) \). I'm guessing this is part of the Math Type plugin?

Anyway, it sounds like you're more than on top of things so I won't ask you to explain it all to me. Just let me know if there's anything I can do and if any of the issues are on our end :)Jameson
 
  • #21
Ackbach said:
So question: how do we output raw LaTeX code? Verbatim?
You insert LaTeX code verbatim like this using CODE and /CODE tags enclosed within square brackets. Everything between the tags will be listed verbatim.
Code:
$$X = \sum_{n=0}^5\left(\left(\sum_{j=1}^k   A_{X,n,j}  \cdot  {cos(B_{X,n,j}   +   t \cdot C_{X,n,j})}\right) \cdot t^n\right)$$
which means:
$$X = \sum_{n=0}^5\left(\left(\sum_{j=1}^k A_{X,n,j} \cdot {cos(B_{X,n,j} + t \cdot C_{X,n,j})}\right) \cdot t^n\right)$$
 
Last edited:

FAQ: Testing LaTeX (powered by MathJax)

1. What is LaTeX and how is it used in scientific testing?

LaTeX is a typesetting system commonly used in scientific research to create high-quality documents with mathematical equations and symbols. In testing, it is often used to format and display mathematical equations and statistical analysis results.

2. What are the advantages of using LaTeX in testing?

LaTeX offers precise control over formatting and allows for easy inclusion of complex mathematical equations. It also produces documents with a professional and polished appearance, making them easier to read and understand.

3. How is LaTeX different from other typesetting systems?

Unlike other typesetting systems, LaTeX uses a markup language that separates the content from the formatting, allowing for consistency and flexibility in document design. It also has a large library of packages for specialized formatting needs.

4. Can LaTeX be used for collaborative testing?

Yes, LaTeX is often used for collaborative testing as it allows multiple users to work on the same document simultaneously. This can be done through online platforms or by using version control systems like Git.

5. Is LaTeX difficult to learn and use?

While there is a learning curve involved in using LaTeX, once you become familiar with the syntax and commands, it can be a very efficient and powerful tool for scientific testing. There are also many resources available online for learning and troubleshooting.

Similar threads

Replies
5
Views
2K
Replies
14
Views
2K
Replies
3
Views
857
Replies
11
Views
6K
Replies
15
Views
25K
Replies
12
Views
2K
Replies
8
Views
1K
Replies
7
Views
2K
Back
Top