Mastering LaTeX Equations: A Comprehensive Guide for Beginners on Physics Forums

  • LaTeX
  • Thread starter Redbelly98
  • Start date
In summary, LaTeX is a typesetting system used in physics forums. It is easy to type in, but there are some important bugs. The comprehensive list of formulas can be found at mirror.ctan.org/info/symbols/comprehensive/symbols-a4.pdf.
  • #36


Greg Bernhardt said:
Where are we putting it? Great job everyone!
O
I would prefer a special subforum in Forum feedback where we store all the FAQ's. Or perhaps a sticky post??
 
Physics news on Phys.org
  • #37


micromass said:
O
I would prefer a special subforum in Forum feedback where we store all the FAQ's. Or perhaps a sticky post??

Let's sticky it and then we can unstick this one
https://www.physicsforums.com/showthread.php?t=386951
 
Last edited:
  • #38


If we simply un-stick the old sticky thread and leave it visible, I think we should add a warning right at the beginning that it's been superseded, with a link to the new FAQ.
 
  • #39


jtbell said:
If we simply un-stick the old sticky thread and leave it visible, I think we should add a warning right at the beginning that it's been superseded, with a link to the new FAQ.

good point, we can prolly delete it
 
  • #40


There are a few more details I would like to change, but right now I need to eat something. I'll edit my suggestions into this post about an hour from now.

I think we can definitely publish this today.
 
  • #41


Slightly OT - Greg, I know you were in contact with Mathjax developers, the table doesn't render correctly in Opera, see attachment.
 

Attachments

  • Untitled-1.png
    Untitled-1.png
    11.6 KB · Views: 34
  • #42


I realized that instead of explaining what I want to change, I can just quote the post, remove the quote tags and make the changes myself. Edit: I found several mistakes when I got out of the shower, including a paragraph that I had messed up by pasting a piece of text in the wrong place. I have fixed those mistakes now.

I think this is good enough to publish today.



How do I work with LaTeX here?
Those fancy mathematical symbols are being made with something called LaTeX. It's easy to include LaTeX code in your posts at Physics Forums. You just need to type the LaTeX code that produces the formula you want between [itеx] and [/itеx]. For example, if you type

Code:
[itex]\lambda^2[/itex]
the result will be [itex]\lambda^2[/itex].

Alternatively, you can type LaTeX code between [tеx] and [/tеx]. These tags do essentially the same thing as the itex tags, but the formula will be displayed indented on a separate line. So if you type

Code:
[tex]\Lambda^2[/tex]
the result will be [tex]\Lambda^2[/tex] For the ones already familiar with LaTeX: itex tags are analogous to $, and tex tags are analogous to $$.

The easiest way to learn LaTeX is to see what others have done. If you see a post with a nice equation in it, just click QUOTE (at the bottom of the post) to see what the author did.

Punctuation If you're using tex tags and you want a comma or a period after your formula, you should put it before the closing tex tag. If you're using itex tags, it doesn't matter if you put it before or after the closing itex tag. Also, when you use tex tags, the software will put a blank line before and after the formula. So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. The following example illustrates these ideas.

Code:
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by [tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by [tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].

Important bug vBulletin (the forum software) has a feature that will sometimes break correct LaTeX code. If you type more than 50 characters without a space, vBulletin will insert one for you after the 50th character. This will break the code unless you're lucky enough to have the space end up before a LaTeX command rather than in the middle of it. To prevent this from happening, you will have to make sure that your code contains a space at least once every 50 characters. If you often write long pieces of LaTeX code, you may want to start to routinely type extra spaces that will be ignored by the LaTeX processor, for example before equality signs and LaTeX commands that aren't arguments of other LaTeX commands.

Another bug is that if you edit a post that contains LaTeX code without going to advanced edit mode, the code will not be parsed when you view the thread immediately after saving the changes. The math looks fine to everyone else, but you will need to refresh the page (in your browser) to see the math again.​


A very short introduction to LaTeX
The previous section explains how to include LaTeX code in posts, but it doesn't explain LaTeX. So in this section, we will explain how to type common mathematical formulas in LaTeX.

Special characters The following characters have a special meaning in LaTeX: # $ % { } _ ^ \ ~
So if you want one of these characters to be displayed, you must type the code for the symbol rather than the symbol itself. The LaTeX codes for the first six of these symbols are: \# \$ \% \{ \} \_

Spacing LaTeX ignores most of the spaces and end-of-line characters you type. For example

Code:
[tex]
x     y
z
[/tex]
will produce [tex]x y
z[/tex] There is a number of LaTeX commands that you can use to control the horizontal distance between characters. \ or ~ (followed by a space) inserts a space. The difference is that ~ ensures that LaTeX will not break the line at that space. \, inserts a small space. \! inserts a small negative space (moves the cursor a little to the left). \quad and \qquad displays insert larger spaces. You can also use the \hspace command to explicitly specify the width of the space. For example,

Code:
[tex]
a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j
[/tex]
gives [tex]a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j[/tex] To get the result [itex]f(x) \ \text{if} \ x>0[/itex], you can't just type

Code:
[itex]
f(x) if x>0
[/itex]
The result will be ugly: [itex]f(x) if x>0[/itex]. Any of these codes will do a better job:

Code:
[itex]f(x)\ \text{if}\ x>0[/itex]
[itex]f(x)~\text{if}~x>0[/itex]
[itex]f(x)\text{ if }x>0[/itex]
These are the results: [itex]f(x)\ \text{if}\ x>0[/itex], [itex]f(x)~\text{if}~x>0[/itex], [itex]f(x)\text{ if }x>0[/itex]. The \text command tells LaTeX to interpret what comes next as text, instead of as variables.

Subscripts and superscripts To put a subscript on a variable, use the _ symbol. To put a superscript on a variable, use the ^ symbol. For example, if you type

Code:
[itex]
x_y,\ x^y
[/itex]
the result is [itex]x_y,\ x^y[/itex]. If you want to display just the subscript or the superscript, and not the variable, type {} where the variable would normally be. This trick is also useful when the horizontal positioning of the indices is important, as in the following example.

Code:
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex]
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex] Subscripts and superscripts work with integrals, limits, summations, and several other symbols. For example,
Code:
[tex]
\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/tex]
will give us [tex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/tex] If you do the same thing between itex tags, then you get [itex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex]. The subscript is written next to the limit instead of beneath it. If you don't like this, you can use the \displaystyle command. For example,

Code:
[itex]
\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/itex]
will give [itex]\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex].

Grouping By default, most LaTeX commands act only on the first character or command on its right. (\displaystyle is one of the exceptions). To make them act on longer pieces of input, use curly brackets { }. For example

Code:
[itex]
x^{10}+x^10
[/itex]
gives [itex]x^{10}+x^10[/itex]. If you want to limit the scope of a \displaystyle command, place the curly brackets as in this example

Code:
[itex]\lim_n x_n={\displaystyle\lim_n x_n}[/itex]
The result is [itex]\lim_n x_n={\displaystyle\lim_n x_n}[/itex].

You can nest brackets within brackets as deeply as you want to build up a complicated expression. For example

Code:
[itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex]

gives [itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex].

Delimiters The delimiters [itex](~),[~], \{~\}[/itex] are typed as ( ), [ ], \{ \}. Note that a curly bracket must be preceded by a backslash. If you want larger delimiters, then you can use the \big, \Big, \bigg and \Bigg commands. For example

Code:
[tex]
xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)
[/tex]
will give [tex]xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)[/tex] You can also let LaTeX choose the size of your delimiters. This can be done by typing \left and \right in front of the delimiter. For example

Code:
[tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex]
will give [tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex] The size of the delimiters is determined by the size of what's between them. Because of this, there must be a \right for each \left and vice versa. So if you only want one of the delimiters to be displayed, you still have to tell LaTeX where the region that determines the size begins or ends, by typing "\left." or "\right." (i.e. you type a period instead of a delimiter), as in the following example.

Code:
[tex]
\left\{
\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}
\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex]
[tex]
\left\{\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex] The array environment is explained in one of the documents linked to after the table of common symbols below.

Different fonts Sometimes we wish to type things in a different font. For example Blackboard bold, Calligraphic, Fraktur or Sans serif. [tex]
\begin{align}
&\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\end{align}
[/tex] The codes
Code:
[itex]\mathbb A[/itex]
[itex]\mathcal A[/itex]
[itex]\mathfrak A[/itex]
[itex]\mathsf A[/itex]
give the results [itex]\mathbb A[/itex], [itex]\mathcal A[/itex], [itex]\mathfrak A[/itex] and [itex]\mathsf A[/itex] respectively.

Note: The blackboard bold font only works with capital letters.


Frequently used symbols This is a list of some of the most useful symbols and their LaTeX codes:
[tex]
\begin{array}{l|c|c}
\hline
\text{Infinity} & \text{\infty} & \infty \\
\text{Reduced Planck's Constant} & \text{\hbar} & \hbar \\
\text{Plus-minus} & \text{\pm, \mp} & \pm, \mp \\
\text{Parallel} & \text{\parallel} & \parallel \\
\text{Perpendicular} & \text{\perp} & \perp \\
\text{For all} & \text{\forall} & \forall \\
\text{There exists} & \text{\exists} & \exists \\
\text{Ellipsis} & \text{\cdots, \vdots, \ddots, \dots} & \cdots, \vdots, \ddots, \dots \\
\hline
\text{Arrows} & \text{\rightarrow, \leftarrow} & \rightarrow, \leftarrow, \leftrightarrow \\
& \text{\Rightarrow, \Leftarrow, \Leftrightarrow} & \Rightarrow, \Leftarrow, \Leftrightarrow \\
& \text{\mapsto, \to} & \mapsto, \to \\
& \text{\uparrow, \downarrow} & \uparrow, \downarrow \\
\hline
\text{Relations} & \text{\geq, \leq, \neq} & \geq, \leq, \neq \\
& \text{\gg, \ll, \equiv} & \gg, \ll, \equiv \\
& \text{\approx, \cong, \sim} & \approx, \cong, \sim \\
\hline
\text{Superscript} & \text{x^n} & x^n \\
\text{Subscript} & \text{x_i} & x_i \\
\text{Tensor indices} & \text{R_{ab}{}^{cd}} & R_{ab}{}^{cd} \\
\text{Fraction} & \text{\frac{1}{2}} & \frac{1}{2} \\
\text{Square root} & \text{\sqrt{16}} & \sqrt{16} \\
\text{Nth root} & \text{\sqrt[4]{16}} & \sqrt[4]{16} \\
\text{Absolute value} & \text{|x|} & |x| \\
\text{Norm} & \text{\|\vec{x}\|} & \|\vec{x}\| \\
\text{Accents} & \text{\hat{p}, \vec{r}, \tilde{z}} & \hat{p}, \vec{r}, \tilde{z} \\
\text{Complex conjugate} & \text{z^*, \bar{z}, z^\dagger} & z^*, \bar{z}, z^\dagger \\
\text{Dirac notation} & \text{\langle \phi | \psi \rangle} & \langle \phi | \psi \rangle \\
\text{Multiplication} & \text{A \cdot B, A \times B} & A\cdot B, A\times B \\
\text{Direct Sum} & \text{V \oplus W} & V \oplus W \\
\text{Tensor Product} & \text{S \otimes T} & S \otimes T \\
\text{Function composition} & \text{f \circ g} & f\circ g \\
\text{Element of} & \text{x \in A} & x \in A \\
\text{Not in} & \text{x \not\in A} & x \not\in A \\
\text{Subset} & \text{A \subset B, B \subseteq C} & A \subset B, B \subseteq C \\
\text{Set Union} & \text{A \cup B} & A \cup B \\
\text{Set Intersection} & \text{A \cap B} & A \cap B \\
\text{Set Subtraction} & \text{A \setminus B} & A \setminus B \\
\hline
\text{Binomial coefficient} & \text{\binom{n}{k}, {_nC_r}} & \binom{n}{k}, {_nC_r} \\
\hline
\text{Big stuff} & \text{\bigcup_i A_i} & \bigcup_i A_i \\
& \text{\bigcap_i A_i} & \bigcap_i A_i \\
& \text{\sum_{n=0}^\infty a_n x^n} & \sum_{n=0}^\infty a_n x^n \\
& \text{\prod_{n=0}^\infty a_n} & \prod_{n=0}^\infty a_n \\
\hline
\text{Derivatives} & \text{y', y'', y^{(n)}} & y', y'', y^{(n)} \\
& \text{\dot{x}, \ddot{x}} & \dot{x}, \ddot{x} \\
& \text{\frac{\partial f}{\partial x}} & \frac{\partial f}{\partial x} \\
& \text{\nabla f} & \nabla f\\
& \text{\Box^2 \phi} & \Box^2 \phi \\
\hline
\text{Integrals} & \text{\int e^x\,dx} & \int e^x\,dx \\
& \text{\oint \vec{E}\cdot d\vec{A}} & \oint \vec{E}\cdot d\vec{A} \\
& \text{\iint, \iiint} & \iint, \iiint \\
\hline
\text{Elementary Functions} & \text{\sin x, \cos x, \log (x+y), ...} & \sin x, \cos x, \log(x+y), \dots \\
\hline
\end{array}
[/tex]
Another nice list of frequently used symbols can be found http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols (also a PDF file).

Sadly, not all LaTeX commands are being supported by MathJax. http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands is the full list of supported commands.

Formulas that span multiple lines Longer formulas and systems of equations can be typed using the align environment. An environment is a piece of code that begins with a \begin statement and ends with an \end statement. The align environment begins with \bеgin{align} and ends with \еnd{align}. Inside an align environment (and several other environments), the code \\ ends a line and starts a new one. The & symbol is used to indicate where rows are to be aligned, as in the following example.

Code:
[tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]

This yields [tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]
Note: The \\ code only works in some environments.

Matrices A matrix can easily by typed by the matrix, pmatrix, bmatrix and vmatrix environment. For example, the pmatrix environment is started with \bеgin{pmatrix} and ended with \еnd{pmatrix}. Columns are separated by & and rows are separated by \\ . Here is an example:

Code:
[tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]

This yields [tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]
The matrix, bmatrix and vmatrix environments produce similar results. Only the delimiters are different. See http://www.math-linux.com/spip.php?article132 for more examples.

The cases environment Something like [tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex] can be easily typed using the cases environment. It is started with \bеgin{cases} and ended with \еnd{cases}. Rows must be separated by \\ and & is used to indicate where rows are to be aligned. The example above is produced by

Code:
[tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex]

Another example is

Code:
[tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1       & \text{if } x < 0
\end{cases}
[/tex]

which gives [tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
[/tex] More information about cases, align and similar environments can be found here.​


Sandbox
If you wish to practice writing LaTeX or test some code, a sandbox is available https://www.physicsforums.com/mathjax/test/preview.html . Please do not create threads just to practice LaTeX.​


Additional information
If you have questions, you can ask them in the Math & Science Software subforum.

If you go to advanced edit mode in one of the technical subforums (this doesn't work in the Forum Feedback & Announcements forum for example), you will see a button with a Σ symbol on it, above the input field. If you click on it, a menu with mathematical symbols will appear. When you select a symbol, its LaTeX code will be typed automatically, along with a pair of itex tags.

MathJax (the LaTeX processor) has a few setting that you can change. If you right-click on a LaTeX formula, then a menu will appear. Here's what you can do:

  • Show Source: this shows original LaTeX code. This is handy if you want to see how something is typed.
  • Settings: Allows you to zoom in in equation. So it allows you to see some LaTex symbols bigger. In order for zoom to work, you need to set your zoom trigger. If you set it to "hover" (for example), then you zoom in every time you place your mouse over the LaTeX code.
  • MathJax Help: Has some additional help features for users. Check it out.


Simple non-LaTeX options
If you just want a subscript or a superscript, you can use vBulletin's sub and sup tags. For example, [noparse]x1[/noparse] yields x1, and [noparse]x2[/noparse] yields x2. If you don't want to type these tags, you can use the X2 and X2 buttons above the input field when you're in advanced edit mode.

If you just want to insert a Greek letter or a mathematical symbol in your post, the easiest way is to just click on the symbol you want in the box of symbols to the right of the input field when you're in advanced edit mode. If you need a symbol that you don't see in that box, you can try to find it in https://www.physicsforums.com/blog.php?b=347 .

Do not use these symbols, the sub/sup tags, or any other vBulletin tags in LaTeX mode (i.e. between tex or itex tags).​


Acknowledgements
We are indebted to member and former admin chroot, whose efforts brought LaTeX to Physics Forums in the first place, and forum admin and owner Greg Bernhardt for updating to the currently-used MathJax processor. Numerous other members have provided valuable feedback and helped with the debugging process.​
 
Last edited by a moderator:
  • #43


In the punctuation section, how about breaking the code into two lines, so you don't have to scroll in the CODE box to see everything?

In the first example in the spacing section, y is missing in the code.

I'd add \mathrm to the fonts section, and perhaps give an example like [itex]9.81~\mathrm{m/s}^2[/itex]. A common mistake is to have the units typeset in the italic font.

In the cases section, right after the first typeset example, Can shouldn't be capitalized.

In the additional-information section, commas should be used instead of parentheses to set off the two phrases, and right click should be hyphenated.

In the acknowledgments, the dashes should be commas. If you really want dashes, use the endash (—) instead of two hyphens.

What do you think about removing the TEX and ITEX tags from all the CODE boxes other than in the How do I work with LaTeX? section? It'll make the FAQ look a bit shorter and, I think, cleaner. Or if we keep them, standardize on TEX.

I think the table should be moved to the end of the FAQ.
 
  • #44


vela said:
In the punctuation section, how about breaking the code into two lines, so you don't have to scroll in the CODE box to see everything?
I don't know, don't you think it looks kind of weird with a couple of line breaks inserted? The point of the example is to show how you should type a sentence that contains both tex and itex tags to get the best result, and you wouldn't type these line breaks.
Code:
Let [itex]f:\mathbb R\rightarrow
\mathbb R[/itex] be the function defined by [tex]f(x)
=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].

vela said:
In the first example in the spacing section, y is missing in the code.
No, it was just 35 spaces to the right. I guess 5 spaces will illustrate the point just as well as 35, so I have deleted the rest of them.

vela said:
I'd add \mathrm to the fonts section, and perhaps give an example like [itex]9.81~\mathrm{m/s}^2[/itex]. A common mistake is to have the units typeset in the italic font.
I'm not familiar with the \mathrm command. A result of a google search suggests that it's like \text, but ignores spaces typed between the brackets and behaves slightly differently in other ways too. It doesn't seem to belong in the fonts section, but perhaps right after the place where I explained \text? If one of you guys would like to write a few sentences about it, I certainly wouldn't mind. Similar commands, like \operatorname and \mbox, should perhaps be mentioned too?


vela said:
In the cases section, right after the first typeset example, Can shouldn't be capitalized.

In the additional-information section, commas should be used instead of parentheses to set off the two phrases, and right click should be hyphenated.

In the acknowledgments, the dashes should be commas. If you really want dashes, use the endash (—) instead of two hyphens.
I had totally missed the "Can", and I just noticed that the sentence said "typed be the cases environment". I agree about the commas in the acknowledgments section.

I assume that you meant "are in Advanced Edit mode (click on "Go Advanced" to get there)"? Not sure I like a comma, since it's the part starting with "click" is a complete sentence. Maybe a semicolon? "are in Advanced Edit mode; click on "Go Advanced" to get there. Hm, you know what, I'll just rewrite that part. Check it out now.

Now that I think about it, do we even what to mention that feature? I wouldn't recommend it to anyone.

vela said:
What do you think about removing the TEX and ITEX tags from all the CODE boxes other than in the How do I work with LaTeX? section? It'll make the FAQ look a bit shorter and, I think, cleaner. Or if we keep them, standardize on TEX.
I thought about removing them earlier, but decided not to do it, at least not until we have discussed it. If we don't include them, we should probably change the sentences around them somewhat. For example, instead of "if you type <code>, the result is <result>", we would have to type something like "if you type <code> between tex tags, the result is <result>", or the statement wouldn't be 100% correct.

To standardize on tex would add more length to the post than we can remove by deleting the tags from the code boxes, so I vote against this, but I'm OK with it if you guys want to do it.


vela said:
I think the table should be moved to the end of the FAQ.
I don't know. Maybe. The point of the "a very short introduction to latex" section is to introduce the reader to the most useful latex codes, so it makes sense to keep it in that section. If you would like to move it, then it's OK with me, but one of you will have to do it. I'm done with this for today.
 
  • #45


Fredrik said:
I don't know, don't you think it looks kind of weird with a couple of line breaks inserted? The point of the example is to show how you should type a sentence that contains both tex and itex tags to get the best result, and you wouldn't type these line breaks.
I just meant one line break so you could see the whole thing in the box at once without needing to scroll horizontally:
Code:
Let [itex]f:\mathbb R\rightarrow \mathbb R[/itex] be the function defined
by [tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
No, it was just 35 spaces to the right. I guess 5 spaces will illustrate the point just as well as 35, so I have deleted the rest of them.
Ah, guess I just didn't notice it way over there.
I'm not familiar with the \mathrm command. A result of a google search suggests that it's like \text, but ignores spaces typed between the brackets and behaves slightly differently in other ways too. It doesn't seem to belong in the fonts section, but perhaps right after the place where I explained \text? If one of you guys would like to write a few sentences about it, I certainly wouldn't mind. Similar commands, like \operatorname and \mbox, should perhaps be mentioned too.
It's just a different font, Roman. It's not like \text because you're still in math mode.

I assume that you meant "are in Advanced Edit mode (click on "Go Advanced" to get there)"?
I meant "(for example)" and "(the LaTeX processor)". If you're setting off a complete sentence, then yeah, parentheses or endashes would be appropriate.

I thought about removing them earlier, but decided not to do it, at least not until we have discussed it. If we don't include them, we should probably change the sentences around them somewhat. For example, instead of "if you type <code>, the result is <result>", we would have to type something like "if you type <code> between tex tags, the result is <result>", or the statement wouldn't be 100% correct.
I think people will understand, if they read the first section, that the LaTeX mark-up is understood to be sandwiched between the appropriate tags. To me, the tags seemed to be distracting by cluttering up and obscuring the actual LaTeX. But I can see the case for leaving them in there as well.
To standardize on tex would add more length to the post than we can remove by deleting the tags from the code boxes, so I vote against this, but I'm OK with it if you guys want to do it.
I did mean only in the CODE boxes if the tags were going to be left in. I don't see how that will add length to the post as it currently stands. If anything, it removes characters by replacing ITEX with TEX.
I don't know. Maybe. The point of the "a very short introduction to latex" section is to introduce the reader to the most useful latex codes, so it makes sense to keep it in that section. If you would like to move it, then it's OK with me, but one of you will have to do it. I'm done with this for today.
The table just seems to break the flow of the FAQ explaining the various features of LaTeX. It's not really an explanation; it's more like a reference guide. I'd move it to right before the sandbox section.
 
  • #46


vela said:
I just meant one line break so you could see the whole thing in the box at once without needing to scroll horizontally:
Code:
Let [itex]f:\mathbb R\rightarrow \mathbb R[/itex] be the function defined
by [tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
If you put a line break there, it changes the output.

vela said:
I think people will understand, if they read the first section, that the LaTeX mark-up is understood to be sandwiched between the appropriate tags. To me, the tags seemed to be distracting by cluttering up and obscuring the actual LaTeX. But I can see the case for leaving them in there as well.
Yes, both possibilities are OK with me.

vela said:
I did mean only in the CODE boxes if the tags were going to be left in. I don't see how that will add length to the post as it currently stands. If anything, it removes characters by replacing ITEX with TEX.
You would use "tex" in the code box, even where we use "itex" to produce the output that we say is produced by what's in the code box? That would be misleading.

vela said:
The table just seems to break the flow of the FAQ explaining the various features of LaTeX. It's not really an explanation; it's more like a reference guide. I'd move it to right before the sandbox section.
If you can improve the flow, then go ahead. I'm going to watch some TV now and then go to bed early. If micromass shows up at night again, maybe you can discuss it with him (if you're still here). If you want to delay the publication until tomorrow so you can change a few things first, then make sure that Redbelly98 is aware of it, since he was going to publish it around...right now. (It's certainly OK with me).
 
  • #47


vela said:
What do you think about removing the TEX and ITEX tags from all the CODE boxes other than in the How do I work with LaTeX? section? It'll make the FAQ look a bit shorter and, I think, cleaner. Or if we keep them, standardize on TEX.

I think the TEX and ITEX tags in the code boxes add for clarity. People who are new and still confused about the matter see the code exactly how it should be typed. Moreover, people can just copy-paste the code if they want to test things.
Leaving the tags out is a little bit confusing for newcomers (although not much).

I think the table should be moved to the end of the FAQ.

I feel that the flow of the FAQ should go from important topics to unimportant topics. So the important stuff should be typed first, where most people will see it. I feel that the table is quite important and thus should be in the beginning of the FAQ.
 
  • #48


Fredrik said:
If you put a line break there, it changes the output.
Yes, you're right. I was thinking it would be inside the LaTeX so it wouldn't matter, but it's not. You could put the break right before the TEX tag instead, and it won't change the output.
Code:
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
micromass said:
I think the TEX and ITEX tags in the code boxes add for clarity. People who are new and still confused about the matter see the code exactly how it should be typed. Moreover, people can just copy-paste the code if they want to test things.
Leaving the tags out is a little bit confusing for newcomers (although not much).
Yeah, that was my other thought. Leaving them in is fine with me.
I feel that the flow of the FAQ should go from important topics to unimportant topics. So the important stuff should be typed first, where most people will see it. I feel that the table is quite important and thus should be in the beginning of the FAQ.
OK, sounds good.

I would still suggest you add \mathrm and perhaps \mathbf to the fonts section because bold Roman font is often used to denote vectors and matrices.
 
  • #49


How do I work with LaTeX here?
Those fancy mathematical symbols are being made with something called LaTeX. It's easy to include LaTeX code in your posts at Physics Forums. You just need to type the LaTeX code that produces the formula you want between [itеx] and [/itеx]. For example, if you type

Code:
[itex]\lambda^2[/itex]
the result will be [itex]\lambda^2[/itex].

Alternatively, you can type LaTeX code between [tеx] and [/tеx]. These tags do essentially the same thing as the itex tags, but the formula will be displayed indented on a separate line. So if you type

Code:
[tex]\Lambda^2[/tex]
the result will be [tex]\Lambda^2[/tex] For the ones already familiar with LaTeX: itex tags are analogous to $, and tex tags are analogous to $$.

The easiest way to learn LaTeX is to see what others have done. If you see a post with a nice equation in it, just click QUOTE (at the bottom of the post) to see what the author did.

Punctuation If you're using tex tags and you want a comma or a period after your formula, you should put it before the closing tex tag. If you're using itex tags, it doesn't matter if you put it before or after the closing itex tag. Also, when you use tex tags, the software will put a blank line before and after the formula. So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. The following example illustrates these ideas.

Code:
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].

Important bug vBulletin (the forum software) has a feature that will sometimes break correct LaTeX code. If you type more than 50 characters without a space, vBulletin will insert one for you after the 50th character. This will break the code unless you're lucky enough to have the space end up before a LaTeX command rather than in the middle of it. To prevent this from happening, you will have to make sure that your code contains a space at least once every 50 characters. If you often write long pieces of LaTeX code, you may want to start to routinely type extra spaces that will be ignored by the LaTeX processor, for example before equality signs and LaTeX commands that aren't arguments of other LaTeX commands.

Another bug is that if you edit a post that contains LaTeX code without going to advanced edit mode, the code will not be parsed when you view the thread immediately after saving the changes. The math looks fine to everyone else, but you will need to refresh the page (in your browser) to see the math again.​
A very short introduction to LaTeX
The previous section explains how to include LaTeX code in posts, but it doesn't explain LaTeX. So in this section, we will explain how to type common mathematical formulas in LaTeX.

Special characters The following characters have a special meaning in LaTeX: # $ % { } _ ^ \ ~
So if you want one of these characters to be displayed, you must type the code for the symbol rather than the symbol itself. The LaTeX codes for the first six of these symbols are: \# \$ \% \{ \} \_

Spacing LaTeX ignores most of the spaces and end-of-line characters you type. For example

Code:
[tex]
x     y
z
[/tex]
will produce [tex]x y
z[/tex] There is a number of LaTeX commands that you can use to control the horizontal distance between characters. \ or ~ (followed by a space) inserts a space. The difference is that ~ ensures that LaTeX will not break the line at that space. \, inserts a small space. \! inserts a small negative space (moves the cursor a little to the left). \quad and \qquad displays insert larger spaces. You can also use the \hspace command to explicitly specify the width of the space. For example,

Code:
[tex]
a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j
[/tex]
gives [tex]a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j[/tex] To get the result [itex]f(x) \ \text{if} \ x>0[/itex], you can't just type

Code:
[itex]
f(x) if x>0
[/itex]
The result will be ugly: [itex]f(x) if x>0[/itex]. Any of these codes will do a better job:

Code:
[itex]f(x)\ \text{if}\ x>0[/itex]
[itex]f(x)~\text{if}~x>0[/itex]
[itex]f(x)\text{ if }x>0[/itex]
These are the results: [itex]f(x)\ \text{if}\ x>0[/itex], [itex]f(x)~\text{if}~x>0[/itex], [itex]f(x)\text{ if }x>0[/itex]. The \text command tells LaTeX to interpret what comes next as text, instead of as variables.

Subscripts and superscripts To put a subscript on a variable, use the _ symbol. To put a superscript on a variable, use the ^ symbol. For example, if you type

Code:
[itex]
x_y,\ x^y
[/itex]
the result is [itex]x_y,\ x^y[/itex]. If you want to display just the subscript or the superscript, and not the variable, type {} where the variable would normally be. This trick is also useful when the horizontal positioning of the indices is important, as in the following example.

Code:
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex]
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex] Subscripts and superscripts work with integrals, limits, summations, and several other symbols. For example,
Code:
[tex]
\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/tex]
will give us [tex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/tex] If you do the same thing between itex tags, then you get [itex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex]. The subscript is written next to the limit instead of beneath it. If you don't like this, you can use the \displaystyle command. For example,

Code:
[itex]
\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/itex]
will give [itex]\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex].

Grouping By default, most LaTeX commands act only on the first character or command on its right. (\displaystyle is one of the exceptions). To make them act on longer pieces of input, use curly brackets { }. For example

Code:
[itex]
x^{10}+x^10
[/itex]
gives [itex]x^{10}+x^10[/itex]. If you want to limit the scope of a \displaystyle command, place the curly brackets as in this example

Code:
[itex]\lim_n x_n={\displaystyle\lim_n x_n}[/itex]
The result is [itex]\lim_n x_n={\displaystyle\lim_n x_n}[/itex].

You can nest brackets within brackets as deeply as you want to build up a complicated expression. For example

Code:
[itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex]

gives [itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex].

Delimiters The delimiters [itex](~),[~], \{~\}[/itex] are typed as ( ), [ ], \{ \}. Note that a curly bracket must be preceded by a backslash. If you want larger delimiters, then you can use the \big, \Big, \bigg and \Bigg commands. For example

Code:
[tex]
xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)
[/tex]
will give [tex]xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)[/tex] You can also let LaTeX choose the size of your delimiters. This can be done by typing \left and \right in front of the delimiter. For example

Code:
[tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex]
will give [tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex] The size of the delimiters is determined by the size of what's between them. Because of this, there must be a \right for each \left and vice versa. So if you only want one of the delimiters to be displayed, you still have to tell LaTeX where the region that determines the size begins or ends, by typing "\left." or "\right." (i.e. you type a period instead of a delimiter), as in the following example.

Code:
[tex]
\left\{
\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}
\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex]
[tex]
\left\{\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex] The array environment is explained in one of the documents linked to after the table of common symbols below.

Different fonts Sometimes we wish to type things in a different font. For example Blackboard bold, Calligraphic, Fraktur or Sans serif. [tex]
\begin{align}
&\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\end{align}
[/tex] The codes
Code:
[itex]\mathbb A[/itex]
[itex]\mathcal A[/itex]
[itex]\mathfrak A[/itex]
[itex]\mathsf A[/itex]
[itex]\mathrm A [/itex]
[itex]\mathbf A [/itex]
give the results [itex]\mathbb A[/itex], [itex]\mathcal A[/itex], [itex]\mathfrak A[/itex], [itex]\mathsf A [/itex], [itex]\mathrm A [/itex] and [itex]\mathbf A[/itex] respectively.

Note: The blackboard bold font only works with capital letters. Frequently used symbols This is a list of some of the most useful symbols and their LaTeX codes:
[tex]
\begin{array}{l|c|c}
\hline
\text{Infinity} & \text{\infty} & \infty \\
\text{Reduced Planck's Constant} & \text{\hbar} & \hbar \\
\text{Plus-minus} & \text{\pm, \mp} & \pm, \mp \\
\text{Parallel} & \text{\parallel} & \parallel \\
\text{Perpendicular} & \text{\perp} & \perp \\
\text{For all} & \text{\forall} & \forall \\
\text{There exists} & \text{\exists} & \exists \\
\text{Ellipsis} & \text{\cdots, \vdots, \ddots, \dots} & \cdots, \vdots, \ddots, \dots \\
\hline
\text{Arrows} & \text{\rightarrow, \leftarrow} & \rightarrow, \leftarrow, \leftrightarrow \\
& \text{\Rightarrow, \Leftarrow, \Leftrightarrow} & \Rightarrow, \Leftarrow, \Leftrightarrow \\
& \text{\mapsto, \to} & \mapsto, \to \\
& \text{\uparrow, \downarrow} & \uparrow, \downarrow \\
\hline
\text{Relations} & \text{\geq, \leq, \neq} & \geq, \leq, \neq \\
& \text{\gg, \ll, \equiv} & \gg, \ll, \equiv \\
& \text{\approx, \cong, \sim} & \approx, \cong, \sim \\
\hline
\text{Superscript} & \text{x^n} & x^n \\
\text{Subscript} & \text{x_i} & x_i \\
\text{Tensor indices} & \text{R_{ab}{}^{cd}} & R_{ab}{}^{cd} \\
\text{Fraction} & \text{\frac{1}{2}} & \frac{1}{2} \\
\text{Square root} & \text{\sqrt{16}} & \sqrt{16} \\
\text{Nth root} & \text{\sqrt[4]{16}} & \sqrt[4]{16} \\
\text{Absolute value} & \text{|x|} & |x| \\
\text{Norm} & \text{\|\vec{x}\|} & \|\vec{x}\| \\
\text{Accents} & \text{\hat{p}, \vec{r}, \tilde{z}} & \hat{p}, \vec{r}, \tilde{z} \\
\text{Complex conjugate} & \text{z^*, \bar{z}, z^\dagger} & z^*, \bar{z}, z^\dagger \\
\text{Dirac notation} & \text{\langle \phi | \psi \rangle} & \langle \phi | \psi \rangle \\
\text{Multiplication} & \text{A \cdot B, A \times B} & A\cdot B, A\times B \\
\text{Direct Sum} & \text{V \oplus W} & V \oplus W \\
\text{Tensor Product} & \text{S \otimes T} & S \otimes T \\
\text{Function composition} & \text{f \circ g} & f\circ g \\
\text{Element of} & \text{x \in A} & x \in A \\
\text{Not in} & \text{x \not\in A} & x \not\in A \\
\text{Subset} & \text{A \subset B, B \subseteq C} & A \subset B, B \subseteq C \\
\text{Set Union} & \text{A \cup B} & A \cup B \\
\text{Set Intersection} & \text{A \cap B} & A \cap B \\
\text{Set Subtraction} & \text{A \setminus B} & A \setminus B \\
\hline
\text{Binomial coefficient} & \text{\binom{n}{k}, {_nC_r}} & \binom{n}{k}, {_nC_r} \\
\hline
\text{Big stuff} & \text{\bigcup_i A_i} & \bigcup_i A_i \\
& \text{\bigcap_i A_i} & \bigcap_i A_i \\
& \text{\sum_{n=0}^\infty a_n x^n} & \sum_{n=0}^\infty a_n x^n \\
& \text{\prod_{n=0}^\infty a_n} & \prod_{n=0}^\infty a_n \\
\hline
\text{Derivatives} & \text{y', y'', y^{(n)}} & y', y'', y^{(n)} \\
& \text{\dot{x}, \ddot{x}} & \dot{x}, \ddot{x} \\
& \text{\frac{\partial f}{\partial x}} & \frac{\partial f}{\partial x} \\
& \text{\nabla f} & \nabla f\\
& \text{\Box^2 \phi} & \Box^2 \phi \\
\hline
\text{Integrals} & \text{\int e^x\,dx} & \int e^x\,dx \\
& \text{\oint \vec{E}\cdot d\vec{A}} & \oint \vec{E}\cdot d\vec{A} \\
& \text{\iint, \iiint} & \iint, \iiint \\
\hline
\text{Elementary Functions} & \text{\sin x, \cos x, \log (x+y), ...} & \sin x, \cos x, \log(x+y), \dots \\
\hline
\end{array}
[/tex]
Another nice list of frequently used symbols can be found http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols (also a PDF file).

Sadly, not all LaTeX commands are being supported by MathJax. http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands is the full list of supported commands.

Formulas that span multiple lines Longer formulas and systems of equations can be typed using the align environment. An environment is a piece of code that begins with a \begin statement and ends with an \end statement. The align environment begins with \bеgin{align} and ends with \еnd{align}. Inside an align environment (and several other environments), the code \\ ends a line and starts a new one. The & symbol is used to indicate where rows are to be aligned, as in the following example.

Code:
[tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]

This yields [tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]
Note: The \\ code only works in some environments.

Matrices A matrix can easily by typed by the matrix, pmatrix, bmatrix and vmatrix environment. For example, the pmatrix environment is started with \bеgin{pmatrix} and ended with \еnd{pmatrix}. Columns are separated by & and rows are separated by \\ . Here is an example:

Code:
[tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]

This yields [tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]
The matrix, bmatrix and vmatrix environments produce similar results. Only the delimiters are different. See this web page for more examples.

The cases environment Something like [tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex] can be easily typed using the cases environment. It is started with \bеgin{cases} and ended with \еnd{cases}. Rows must be separated by \\ and & is used to indicate where rows are to be aligned. The example above is produced by

Code:
[tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex]

Another example is

Code:
[tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1       & \text{if } x < 0
\end{cases}
[/tex]

which gives [tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
[/tex] More information about cases, align and similar environments can be found here.​
Sandbox
If you wish to practice writing LaTeX or test some code, a sandbox is available https://www.physicsforums.com/mathjax/test/preview.html . Please do not create threads just to practice LaTeX.​
Additional information
If you have questions, you can ask them in the Math & Science Software subforum.

If you go to advanced edit mode in one of the technical subforums (this doesn't work in the Forum Feedback & Announcements forum for example), you will see a button with a Σ symbol on it, above the input field. If you click on it, a menu with mathematical symbols will appear. When you select a symbol, its LaTeX code will be typed automatically, along with a pair of itex tags.

MathJax (the LaTeX processor) has a few setting that you can change. If you right-click on a LaTeX formula, then a menu will appear. Here's what you can do:

  • Show Source: this shows original LaTeX code. This is handy if you want to see how something is typed.
  • Settings: Allows you to zoom in in equation. So it allows you to see some LaTex symbols bigger. In order for zoom to work, you need to set your zoom trigger. If you set it to "hover" (for example), then you zoom in every time you place your mouse over the LaTeX code.
  • MathJax Help: Has some additional help features for users. Check it out.
Simple non-LaTeX options
If you just want a subscript or a superscript, you can use vBulletin's sub and sup tags. For example, [noparse]x1[/noparse] yields x1, and [noparse]x2[/noparse] yields x2. If you don't want to type these tags, you can use the X2 and X2 buttons above the input field when you're in advanced edit mode.

If you just want to insert a Greek letter or a mathematical symbol in your post, the easiest way is to just click on the symbol you want in the box of symbols to the right of the input field when you're in advanced edit mode. If you need a symbol that you don't see in that box, you can try to find it in https://www.physicsforums.com/blog.php?b=347 .

Do not use these symbols, the sub/sup tags, or any other vBulletin tags in LaTeX mode (i.e. between tex or itex tags).​
Acknowledgements
We are indebted to member and former admin chroot, whose efforts brought LaTeX to Physics Forums in the first place, and forum admin and owner Greg Bernhardt for updating to the currently-used MathJax processor. Numerous other members have provided valuable feedback and helped with the debugging process.

The authors of this FAQ are
  • Fredrik
  • micromass
  • Redbelly98
  • vela
 
Last edited by a moderator:
  • #50


micromass said:
Acknowledgements
We are indebted to member and former admin chroot, whose efforts brought LaTeX to Physics Forums in the first place, and forum admin and owner Greg Bernhardt for updating to the currently-used MathJax processor. Numerous other members have provided valuable feedback and helped with the debugging process?​
Question mark at the end?
The authors of this FAQ are
  • Borek
  • Frederik
  • micromass
  • Redbelly98
  • vela
[/INDENT]
You misspelled Fredrik's name. :wink:
 
  • #53


Micro, delete me from the list of authors - my picocontribution is not worth mentioning. Besides, people will start to think I know LaTeX, which is not true.
 
  • #54


vela said:
Yes, you're right. I was thinking it would be inside the LaTeX so it wouldn't matter, but it's not. You could put the break right before the TEX tag instead, and it won't change the output.
Wow. I had no idea. This is really surprising to me. OK, then I don't mind inserting that extra line break, but if we do, I want insert an extra sentence that explains it. So I want to change
So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. The following example illustrates these ideas.​
to
So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. However, you can type a single line break before a tex tag without changing the output. The following example illustrates these ideas.​
And one final nitpick: The example I added that shows how to limit the scope of a \displaystyle has the itex tags on the same line as the latex code, while all of the other code boxes that contain a single code example have the tags on separate lines. So I would like to change this one to look like the others.

I think we can go ahead an publish this. (The mentor who posts it can make the minor changes I suggested above).
 
  • #55


I have one very small thing to add. I think the very first example should be a longer formula, such as

[tex]x^2 + y^2 + z^2 = \lambda^2[/tex]

rather than simply [itex]\lambda^2[/itex]. The reason is that the most common LaTeX error I see is that people try to use it for individual symbols, one at a time (and then often using sup/sub tags to attempt to position exponents and subscripts!). I can't imagine how many hours it must take them to compose posts this way, but it always makes the formulas completely unreadable, and frankly, I won't bother answering a question that isn't presented clearly.

I think the main cause is that people who are new to LaTeX simply do not realize that you can put an entire formula into a set of tex tags rather than just putting one symbol.

P.S. It drives me freaking nuts that the software puts an extra blank line after closing tex tags. I don't want to have to type everything all blocked together. It is easier to read the source code, and therefore easier to compose posts, if some extra line breaks are allowed.
 
  • #56


Ben Niehoff said:
The reason is that the most common LaTeX error I see is that people try to use it for individual symbols, one at a time (and then often using sup/sub tags to attempt to position exponents and subscripts!). I can't imagine how many hours it must take them to compose posts this way, but it always makes the formulas completely unreadable, and frankly, I won't bother answering a question that isn't presented clearly.

I think the main cause is that people who are new to LaTeX simply do not realize that you can put an entire formula into a set of tex tags rather than just putting one symbol.
I have seen that too. I don't think that these people are typing their LaTeX. They're probably using the LaTeX menu in advanced edit mode. (Not available in this forum, but open a thread in the Quantum Physics forum for example, and click "Go Advanced". Then click the Ʃ symbol above the input field).

Edit: Found another mistake. Please delete the word "displays" from "\quad and \qquad displays insert larger spaces" before publishing.

Another one: "has a few setting that" should be "has a few settings that"

Edit 2: I figured I might as well fix those mistakes. I followed Ben's suggestion and made the first examples of itex and tex more complicated, while making sure that the examples still use both \lambda and \Lambda. I also added the typewriter font, and the descriptions of the last few fonts. I changed the language a bit in the first paragraph after the table, and I changed "environment" to "environments" in one place.

I decided to change a detail in the description of the MathJax options, and ended up changing the whole thing.
 
Last edited:
  • #57


How do I work with LaTeX here?
Those fancy mathematical symbols are being made with something called LaTeX. It's easy to include LaTeX code in your posts at Physics Forums. You just need to type the LaTeX code that produces the formula you want between [itеx] and [/itеx]. For example, if you type

Code:
[itex]Ax=\lambda x[/itex]
the result will be [itex]Ax=\lambda x[/itex].

Alternatively, you can type LaTeX code between [tеx] and [/tеx]. These tags do essentially the same thing as the itex tags, but the formula will be displayed indented on a separate line. So if you type

Code:
[tex]\Lambda^T\eta\Lambda=\eta.[/tex]
the result will be [tex]\Lambda^T\eta\Lambda=\eta.[/tex] For the ones already familiar with LaTeX: itex tags are analogous to $, and tex tags are analogous to $$.

The easiest way to learn LaTeX is to see what others have done. If you see a post with a nice equation in it, just click QUOTE (at the bottom of the post) to see what the author did.

Punctuation If you're using tex tags and you want a comma or a period after your formula, you should put it before the closing tex tag. If you're using itex tags, it doesn't matter if you put it before or after the closing itex tag. Also, when you use tex tags, the software will put a blank line before and after the formula. So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. The following example illustrates these ideas.

Code:
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].
Let [itex]f:\mathbb R\rightarrow\mathbb R[/itex] be the function defined by
[tex]f(x)=x^2,[/tex] for all [itex]x\in\mathbb R[/itex].

Important bug vBulletin (the forum software) has a feature that will sometimes break correct LaTeX code. If you type more than 50 characters without a space, vBulletin will insert one for you after the 50th character. This will break the code unless you're lucky enough to have the space end up before a LaTeX command rather than in the middle of it. To prevent this from happening, you will have to make sure that your code contains a space at least once every 50 characters. If you often write long pieces of LaTeX code, you may want to start to routinely type extra spaces that will be ignored by the LaTeX processor, for example before equality signs and LaTeX commands that aren't arguments of other LaTeX commands.

Another bug is that if you edit a post that contains LaTeX code without going to advanced edit mode, the code will not be parsed when you view the thread immediately after saving the changes. The math looks fine to everyone else, but you will need to refresh the page (in your browser) to see the math again.​


A very short introduction to LaTeX
The previous section explains how to include LaTeX code in posts, but it doesn't explain LaTeX. So in this section, we will explain how to type common mathematical formulas in LaTeX.

Special characters The following characters have a special meaning in LaTeX: # $ % { } _ ^ \ ~
So if you want one of these characters to be displayed, you must type the code for the symbol rather than the symbol itself. The LaTeX codes for the first six of these symbols are: \# \$ \% \{ \} \_

Spacing LaTeX ignores most of the spaces and end-of-line characters you type. For example

Code:
[tex]
x     y
z
[/tex]
will produce [tex]x y
z[/tex] There is a number of LaTeX commands that you can use to control the horizontal distance between characters. \ or ~ (followed by a space) inserts a space. The difference is that ~ ensures that LaTeX will not break the line at that space. \, inserts a small space. \! inserts a small negative space (moves the cursor a little to the left). \quad and \qquad insert larger spaces. You can also use the \hspace command to explicitly specify the width of the space. For example,

Code:
[tex]
a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j
[/tex]
gives [tex]a\!b\,c\ d~e\quad f\qquad g\ \ \ \ h~~~~i\hspace{20mm}j[/tex] To get the result [itex]f(x) \ \text{if} \ x>0[/itex], you can't just type

Code:
[itex]
f(x) if x>0
[/itex]
The result will be ugly: [itex]f(x) if x>0[/itex]. Any of these codes will do a better job:

Code:
[itex]f(x)\ \text{if}\ x>0[/itex]
[itex]f(x)~\text{if}~x>0[/itex]
[itex]f(x)\text{ if }x>0[/itex]
These are the results: [itex]f(x)\ \text{if}\ x>0[/itex], [itex]f(x)~\text{if}~x>0[/itex], [itex]f(x)\text{ if }x>0[/itex]. The \text command tells LaTeX to interpret what comes next as text, instead of as variables.

Subscripts and superscripts To put a subscript on a variable, use the _ symbol. To put a superscript on a variable, use the ^ symbol. For example, if you type

Code:
[itex]
x_y,\ x^y
[/itex]
the result is [itex]x_y,\ x^y[/itex]. If you want to display just the subscript or the superscript, and not the variable, type {} where the variable would normally be. This trick is also useful when the horizontal positioning of the indices is important, as in the following example.

Code:
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex]
[tex]
\Lambda^\mu_\nu,\ \Lambda_\nu^\mu,\ \Lambda^\mu{}_\nu,\ \Lambda_\nu{}^\mu
[/tex] Subscripts and superscripts work with integrals, limits, summations, and several other symbols. For example,
Code:
[tex]
\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/tex]
will give us [tex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/tex] If you do the same thing between itex tags, then you get [itex]\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex]. The subscript is written next to the limit instead of beneath it. If you don't like this, you can use the \displaystyle command. For example,

Code:
[itex]
\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}
[/itex]
will give [itex]\displaystyle\lim_{n\rightarrow +\infty} {\frac{\sin(x)}{x}}[/itex].

Grouping By default, most LaTeX commands act only on the first character or command on its right. (\displaystyle is one of the exceptions). To make them act on longer pieces of input, use curly brackets { }. For example

Code:
[itex]
x^{10}+x^10
[/itex]
gives [itex]x^{10}+x^10[/itex]. If you want to limit the scope of a \displaystyle command, place the curly brackets as in this example

Code:
[itex]
\lim_n x_n={\displaystyle\lim_n x_n}=\lim_n x_n
[/itex]
The result is [itex]\lim_n x_n={\displaystyle\lim_n x_n}=\lim_n x_n[/itex].

You can nest brackets within brackets as deeply as you want to build up a complicated expression. For example

Code:
[itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex]

gives [itex]
\sqrt{1+\sqrt{1+\sqrt{1+x}}}
[/itex].

Delimiters The delimiters [itex](~),[~], \{~\}[/itex] are typed as ( ), [ ], \{ \}. Note that a curly bracket must be preceded by a backslash. If you want larger delimiters, then you can use the \big, \Big, \bigg and \Bigg commands. For example

Code:
[tex]
xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)
[/tex]
will give [tex]xe^x = x \Big( \sum_{n=0}^\infty\frac{x^n}{n!} \Big)[/tex] You can also let LaTeX choose the size of your delimiters. This can be done by typing \left and \right in front of the delimiter. For example

Code:
[tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex]
will give [tex]
xe^x = x \left( \sum_{n=0}^\infty\frac{x^n}{n!} \right)
[/tex] The size of the delimiters is determined by the size of what's between them. Because of this, there must be a \right for each \left and vice versa. So if you only want one of the delimiters to be displayed, you still have to tell LaTeX where the region that determines the size begins or ends, by typing "\left." or "\right." (i.e. you type a period instead of a delimiter), as in the following example.

Code:
[tex]
\left\{
\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}
\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex]
[tex]
\left\{\begin{array}{l}
x=r\cos\theta\\
y=r\sin\theta
\end{array}\right.
~~\Rightarrow~~ x^2+y^2
=r^2(\underbrace{\cos^2\theta+\sin^2\theta}_{=1})=r^2
[/tex] The array environment is explained in one of the documents linked to after the table of common symbols below.

Different fonts Sometimes we wish to type things in a different font. For example Blackboard bold, Calligraphic, Fraktur, Sans serif, Roman (upright), bold and typewriter. [tex]
\begin{align}
&\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\\
&\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\end{align}
[/tex] The codes
Code:
[itex]\mathbb A[/itex]
[itex]\mathcal A[/itex]
[itex]\mathfrak A[/itex]
[itex]\mathsf A[/itex]
[itex]\mathrm A[/itex]
[itex]\mathbf A[/itex]
[itex]\mathtt A[/itex]
give the results [itex]\mathbb A[/itex], [itex]\mathcal A[/itex], [itex]\mathfrak A[/itex], [itex]\mathsf A [/itex], [itex]\mathrm A [/itex], [itex]\mathbf A[/itex] and [itex]\mathtt A[/itex] respectively.

Note: The blackboard bold font only works with capital letters.


Frequently used symbols This is a list of some of the most useful symbols and their LaTeX codes:
[tex]
\begin{array}{l|c|c}
\hline
\text{Infinity} & \text{\infty} & \infty \\
\text{Reduced Planck's Constant} & \text{\hbar} & \hbar \\
\text{Plus-minus} & \text{\pm, \mp} & \pm, \mp \\
\text{Parallel} & \text{\parallel} & \parallel \\
\text{Perpendicular} & \text{\perp} & \perp \\
\text{For all} & \text{\forall} & \forall \\
\text{There exists} & \text{\exists} & \exists \\
\text{Ellipsis} & \text{\cdots, \vdots, \ddots, \dots} & \cdots, \vdots, \ddots, \dots \\
\hline
\text{Arrows} & \text{\rightarrow, \leftarrow} & \rightarrow, \leftarrow, \leftrightarrow \\
& \text{\Rightarrow, \Leftarrow, \Leftrightarrow} & \Rightarrow, \Leftarrow, \Leftrightarrow \\
& \text{\mapsto, \to} & \mapsto, \to \\
& \text{\uparrow, \downarrow} & \uparrow, \downarrow \\
\hline
\text{Relations} & \text{\geq, \leq, \neq} & \geq, \leq, \neq \\
& \text{\gg, \ll, \equiv} & \gg, \ll, \equiv \\
& \text{\approx, \cong, \sim} & \approx, \cong, \sim \\
\hline
\text{Superscript} & \text{x^n} & x^n \\
\text{Subscript} & \text{x_i} & x_i \\
\text{Tensor indices} & \text{R_{ab}{}^{cd}} & R_{ab}{}^{cd} \\
\text{Fraction} & \text{\frac{1}{2}} & \frac{1}{2} \\
\text{Square root} & \text{\sqrt{16}} & \sqrt{16} \\
\text{Nth root} & \text{\sqrt[4]{16}} & \sqrt[4]{16} \\
\text{Absolute value} & \text{|x|} & |x| \\
\text{Norm} & \text{\|\vec{x}\|} & \|\vec{x}\| \\
\text{Accents} & \text{\hat{p}, \vec{r}, \tilde{z}} & \hat{p}, \vec{r}, \tilde{z} \\
\text{Complex conjugate} & \text{z^*, \bar{z}, z^\dagger} & z^*, \bar{z}, z^\dagger \\
\text{Dirac notation} & \text{\langle \phi | \psi \rangle} & \langle \phi | \psi \rangle \\
\text{Multiplication} & \text{A \cdot B, A \times B} & A\cdot B, A\times B \\
\text{Direct Sum} & \text{V \oplus W} & V \oplus W \\
\text{Tensor Product} & \text{S \otimes T} & S \otimes T \\
\text{Function composition} & \text{f \circ g} & f\circ g \\
\text{Element of} & \text{x \in A} & x \in A \\
\text{Not in} & \text{x \not\in A} & x \not\in A \\
\text{Subset} & \text{A \subset B, B \subseteq C} & A \subset B, B \subseteq C \\
\text{Set Union} & \text{A \cup B} & A \cup B \\
\text{Set Intersection} & \text{A \cap B} & A \cap B \\
\text{Set Subtraction} & \text{A \setminus B} & A \setminus B \\
\hline
\text{Binomial coefficient} & \text{\binom{n}{k}, {_nC_r}} & \binom{n}{k}, {_nC_r} \\
\hline
\text{Big stuff} & \text{\bigcup_i A_i} & \bigcup_i A_i \\
& \text{\bigcap_i A_i} & \bigcap_i A_i \\
& \text{\sum_{n=0}^\infty a_n x^n} & \sum_{n=0}^\infty a_n x^n \\
& \text{\prod_{n=0}^\infty a_n} & \prod_{n=0}^\infty a_n \\
\hline
\text{Derivatives} & \text{y', y'', y^{(n)}} & y', y'', y^{(n)} \\
& \text{\dot{x}, \ddot{x}} & \dot{x}, \ddot{x} \\
& \text{\frac{\partial f}{\partial x}} & \frac{\partial f}{\partial x} \\
& \text{\nabla f} & \nabla f\\
& \text{\Box^2 \phi} & \Box^2 \phi \\
\hline
\text{Integrals} & \text{\int e^x\,dx} & \int e^x\,dx \\
& \text{\oint \vec{E}\cdot d\vec{A}} & \oint \vec{E}\cdot d\vec{A} \\
& \text{\iint, \iiint} & \iint, \iiint \\
\hline
\text{Elementary Functions} & \text{\sin x, \cos x, \log (x+y), ...} & \sin x, \cos x, \log(x+y), \dots \\
\hline
\end{array}
[/tex]
Another nice list of frequently used symbols can be found http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols (also a PDF file).

Sadly, not all LaTeX commands are being supported by MathJax. http://www.mathjax.org/docs/1.1/tex.html#supported-latex-commands is the full list of supported commands.

Formulas that span multiple lines Longer formulas and systems of equations can be typed using the align environment. An environment is a piece of code that begins with a \begin statement and ends with an \end statement. The align environment begins with \bеgin{align} and ends with \еnd{align}. Inside an align environment (and several other environments), the code \\ ends a line and starts a new one. The & symbol is used to indicate where rows are to be aligned, as in the following example.

Code:
[tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]

This yields [tex]
\begin{align}
(1+x)^n &\geq 1+nx\\
&= \sqrt{(1+nx)^2}\\
&= \sqrt{1+2nx+n^2x^2}
\end{align}
[/tex]
Note: The \\ code only works in some environments.

Matrices A matrix can easily by typed by the matrix, pmatrix, bmatrix and vmatrix environments. For example, the pmatrix environment is started with \bеgin{pmatrix} and ended with \еnd{pmatrix}. Columns are separated by & and rows are separated by \\ . Here is an example:

Code:
[tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]

This yields [tex]
\begin{pmatrix}
1 & 2 & 3 & 4\\
a & b & c & d\\
x & y & z & w
\end{pmatrix}
[/tex]
The matrix, bmatrix and vmatrix environments produce similar results. Only the delimiters are different. See http://www.math-linux.com/spip.php?article132 for more examples.

The cases environment Something like [tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex] can be easily typed using the cases environment. It is started with \bеgin{cases} and ended with \еnd{cases}. Rows must be separated by \\ and & is used to indicate where rows are to be aligned. The example above is produced by

Code:
[tex]
\begin{cases}
2x+y+z & = 0\\
3x+4y+5z & = 0\\
x+2y+8z & = 0
\end{cases}
[/tex]

Another example is

Code:
[tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1       & \text{if } x < 0
\end{cases}
[/tex]

which gives [tex]
u(x) =
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1 & \text{if } x < 0
\end{cases}
[/tex] More information about cases, align and similar environments can be found here.​


Sandbox
If you wish to practice writing LaTeX or test some code, a sandbox is available https://www.physicsforums.com/mathjax/test/preview.html . Please do not create threads just to practice LaTeX.​


Additional information
If you have questions, you can ask them in the Math & Science Software subforum.

If you go to advanced edit mode in one of the technical subforums (this doesn't work in the Forum Feedback & Announcements forum for example), you will see a button with a Σ symbol on it, above the input field. If you click on it, a menu with mathematical symbols will appear. When you select a symbol, its LaTeX code will be typed automatically, along with a pair of itex tags.

A left-click on a LaTeX image will by default display a box with a larger version of the same image. Try it on this one: [tex]x_{j_{2^k}}[/tex] A right-click will display a menu where you can choose to
  • view the LaTeX source code.
  • change the factor by which the larger image is larger than the default size.
  • always scale all LaTeX images to a larger or smaller size.
  • change the zoom trigger, i.e. change what you have to do to make the larger image appear.
  • go to the MathJax help page.
If you change the zoom trigger to "hover", you will only have to hold the mouse pointer over the LaTeX image for the larger version to appear. However, this will also make it harder to right-click to bring up the menu, because a right-click on the larger image does nothing. So if you want to change it back, you have to be fast. Move the mouse pointer over the image, and right-click before the larger image appears.

Another way to see the LaTeX source code is of course to just click the QUOTE button next to the post. This is usually a better way, since it also shows the itex or tex tags, and the text around them, but it doesn't work in locked threads, or when the LaTeX image is in a quote box.​


Simple non-LaTeX options
If you just want a subscript or a superscript, you can use vBulletin's sub and sup tags. For example, [noparse]x1[/noparse] yields x1, and [noparse]x2[/noparse] yields x2. If you don't want to type these tags, you can use the X2 and X2 buttons above the input field when you're in advanced edit mode.

If you just want to insert a Greek letter or a mathematical symbol in your post, the easiest way is to just click on the symbol you want in the box of symbols to the right of the input field when you're in advanced edit mode. If you need a symbol that you don't see in that box, you can try to find it in https://www.physicsforums.com/blog.php?b=347 .

Do not use these symbols, the sub/sup tags, or any other vBulletin tags in LaTeX mode (i.e. between tex or itex tags).​


Acknowledgements
We are indebted to member and former admin chroot, whose efforts brought LaTeX to Physics Forums in the first place, and forum admin and owner Greg Bernhardt for updating to the currently-used MathJax processor. Numerous other members have provided valuable feedback and helped with the debugging process.

The authors of this FAQ are
  • Fredrik
  • micromass
  • Redbelly98
  • vela
 
Last edited by a moderator:
  • #58


Something in the post is setting the window size wider than usual (at least when I view it in Firefox). It looks fine until the Latex compiler renders the actual symbols, at which point the post jumps out to a wide stance.
 
  • #59


marcusl said:
Something in the post is setting the window size wider than usual (at least when I view it in Firefox). It looks fine until the Latex compiler renders the actual symbols, at which point the post jumps out to a wide stance.
That would have to be the table. However, I'm also using Firefox, and when I change the window size to one that's just large enough to get rid of the horizontal scrollbar, the window is a bit smaller than I usually keep it. It's too small to display the right edge of the box with greek letters and other symbols that you see in advanced edit mode.

Are you using some special feature, like "scale all math to 150%"?
 
  • #60


I have posted the new LaTeX as a stickied, locked thread in Forum Feedback:
https://www.physicsforums.com/showthread.php?t=546968

I had delayed doing this since there were still active discussions going on yesterday. I used Fredrik's post #57 with the following changes:

1. Changed the thread title and title for the opening "newbie" section.

2. Changed the two newbie example to be more at the high school level, instead of the examples from linear algebra in Post #57. The two examples I posted cover sub- and superscripts, upper- and lowercase Greek, and fractions. The Greek letters [itex]\theta \text{ and } \Delta[/itex] are used, which are perhaps the most common ones encountered in U.S. high school math and science.

We can still make changes, like if we resolve the wide window issue that marcusl has brought up. If you spot any mistakes, keep posting them here. (And if a new FAQ subforum gets created, the post can be moved there.)
 
Last edited:
  • #61


Great. I like the thread title. Perhaps just "Getting started" would sound a little bit better than "Getting started for newbies"?

Small mistake: I wrote
\ or ~ (followed by a space) inserts a space​
but you don't have to type a space after ~. The codes are "\ " and "~". So for example
\ (followed by a space) or ~ inserts a space​
would be better.
 
  • #62


Good idea, Fredrik, I have made both changes.
 
  • #63


Found another mistake:
A matrix can easily by typed by the matrix, pmatrix, bmatrix and vmatrix environments.​
Should be something like
A matrix can easily be typed using the matrix, pmatrix, bmatrix or vmatrix environments.​

It looks like I somehow forgot to make the following change when I was doing some edits earlier:
Fredrik said:
I want to change
So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. The following example illustrates these ideas.​
to
So you don't have to type any line breaks before the opening tex tag or after the closing tex tag. However, you can type a single line break before a tex tag without changing the output. The following example illustrates these ideas.​
I still want to make that change. But there's obviously no hurry.
 
  • #64


Fredrik said:
That would have to be the table. However, I'm also using Firefox, and when I change the window size to one that's just large enough to get rid of the horizontal scrollbar, the window is a bit smaller than I usually keep it. It's too small to display the right edge of the box with greek letters and other symbols that you see in advanced edit mode.

Are you using some special feature, like "scale all math to 150%"?
No; also, other threads looked fine.
Everything looks good now that I'm reading it on my computer at home, however.
Thanks for putting this together. It is well done and very useful!
 
  • #65


Fredrik said:
[Suggested a couple of changes]
Done.
marcusl said:
Thanks for putting this together. It is well done and very useful!
Agreed!
 
  • #66


Two more suggestions: We're talking about how to display something like "f(x) if x>0". I think it should say something like "f(x)=0 if x>0" instead. (Make sure to change it in all 8 places).

The sentence
This can be done by typing \left and \right in front of the delimiter.​
should be
This can be done by typing \left and \right in front of the delimiters.​
or
This can be done by typing \left or \right in front of the delimiter.​
Hm, my first thought was to choose the first option because it reinforces the idea that you need both a left and a right. However, from a language nazi's perspective, I think the second option is better, because the first one is actually saying that you should type stuff like \left\right(. This is of course harmless because of the example that clarifies what the sentence means. But the fact that the second option doesn't reinforce that you need both a left and a right is also harmless, since it's explicitly stated in the next paragraph.

I'll let you choose. :smile:
 
  • #67


Changes made. (I went with "...\left or \right...")
 
  • #68
There was an error in the table - \leftrightarrow was shown in the right column, but it was not present in the left column. Corrected.
 
  • #69
We should add something about simplified tags. Something like
Simplified tags: Instead of typing [itеx] and [/itеx], you can type #_# and #_#. Instead of typing [tеx] and [/tеx], you can type $_$ and $_$.​
but obviously without the _ characters. I don't see a way to type ## twice without everything between them getting interpreted as LaTeX code. Code tags would work of course, but it's kind of ugly. Anyone see a better way?
 
  • #70
This works (with the spaces deleted), but it makes IE8 run unbelievably slow, unless something else is causing that right now.

[ FONT = "Verdana" ] # # [ / FONT ]
 
Last edited:

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
317
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
236
  • Sticky
  • Quantum Physics
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Feedback and Announcements
Replies
11
Views
143K
  • Feedback and Announcements
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Feedback and Announcements
Replies
3
Views
1K
Back
Top