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.
  • #71
Oops, duplicate post, but there doesn't seem to be a "delete" button in this subforum.
 
Physics news on Phys.org
  • #72
AlephZero said:
This works (with the spaces deleted), but it makes IE8 run unbelievably slow, unless something else is causing that right now.
Thanks. That works without any slowness in Firefox. Let me know if the slowness was just a temporary issue.
 
  • #73
FYI, new MathJax will be out soon. Here are the improvements:

New Features in MathJax v2.0:

• Major speed improvement for HTML-CSS output, particularly in IE:

The HTML-CSS output processing was redesigned to avoid the page reflows that were the main source of the speed problem in Internet Explorer 8 and 9. For test pages having between 20 and 50 expressions, we see an 80% reduction in output processing time for IE8, a 50% reduction for IE9, and between 15% and 25% reduction for most other browsers over the v1.1a times. Since the processing time in v1.1a grows non-linearly in IE, you should see even larger savings for pages with more equations when using v2.0. Forcing IE7 emulation mode is no longer necessary (and indeed is no longer recommended).

• Reduced flickering during typsetting:

In the past, each expression was displayed as soon as it was typeset, which caused a lot of visual flickering as MathJax processed the page. In v2.0, the output is processed in blocks so that typeset expressions are revealed in groups. This reduces the visual distraction, and also speeds up the processing. The number of equations in a block can be controlled through the EqnChunk parameter in the HTML-CSS block of your configuration. See config/default.js for details.

If the page URL includes a hash reference (a link to a particular location within the page), MathJax v2.0 will jump to that location after the page has finished typsetting. (Since the size of the page may have changed due to the mathematical typsetting, that location may no longer be visible on screen, so MathJax moves there when it is done with the initial typesetting.) You can control this behavior with the positionToHash parameter in the main section of your configuration.

• Automatic equation numbering of TeX formulas:

The TeX input jax now can be configured to add equation numbers (though the default is not to number equations so that existing pages will not change their appearance). This is controlled through the equationNumbers section of the TeX block of your configuration (see config/default.js for details). You can request that the numbering follow the AMS-style numbering of environments, or you can request that every displayed equation be numbered. There are now \label, \ref, and \eqref commands to make it easier to link to particular equations within the document.

• Automatic line breaking of long displayed equations:

MathJax now implements the MathML3 specification for automatic line breaking of displayed equations in its HTML-CSS output. This is disabled by default, but can be enabled via the linebreaks section of the HTML-CSS block of your configuration (see config/default.js for details).

• New AsciiMath input jax and SVG output jax:

MathJax currently processes math in either TeX/LaTeX format, or MathML notation; version 2.0 augments that to include ASCIIMathML notation (see http://www1.chapman.edu/~jipsen/mathml/asciimath.html for details on this format). This is a notation that is easier for students to use than TeX, and has been requested by the user community.

In addition to the HTML-CSS and Native MathML output available in v1.1, MathJax v2.0 includes an SVG-based output jax. This should prove to be more reliable than the HTML-CSS output, as it avoids some CSS, web-font, and printing issues that the HTML-CSS output suffers from, and it currently has no browser-dependent code. The SVG mode even works in some ebook readers (like Apple iBooks and Calibre).

• New combined configuration files:

Pre-defined configuration files that include the AsciiMath and SVG processors are now available with MathJax v2.0.

• MathJax contextual menu now available on mobile devices:

MathJax v2.0 provides access to its contextual menu in mobile devices that are based on the WebKit (Safari) and Gecko (Firefox) engines. For Mobile Firefox, the menu is accessed by a tap-and-hold on any expression rendered by MathJax (this is Mobile Firefox's standard method of triggering a contextual menu). In Mobile Safari, use a double-tap-and-hold. This is the first step toward providing a better interface for mobile devices.

• Improved support for screen readers:

Some issues surrounding the use of screen readers and their interaction with MathPlayer have been resolved in MathJax v2.0. In particular, there are additional menu items that allow the user finer control over some aspects of MathJax's interface that were interfering with some screen readers' ability to properly identify the mathematics. Several stability issues with MathPlayer have also been addressed.

• Many new TeX additions and enhancements:

• New mhchem chemistry extension (adds \ce, \cf, and \cee macros)
• New cancel extension (adds \cancel, \bcancel, and \cancelto macros)
• New extpfeil extension (adds more stretchy arrows)
• New color extension (makes \color work as a switch, as in LaTeX). Adds \definecolor, other color models, LaTeX named colors, \colorbox, \fcolorbox, etc.
• New begingroup extension to allow macro definitions to be localized. Adds \begingroup, \endgroup, \let, \renewenvironment, \global, and \gdef.
• New enclose extension to give TeX access to <menclose> elements. Adds \enclose{type}[attributes]{math} macro.
• New action extension to give TeX access to <maction> elements. Adds \mathtip{math}{tip}, \texttip{math}{tip}, and \toggle{math1}{math2}...\endtoggle macros.
• New \mmToken{type}[attributes]{text} macro for producing <mo>, <mi>, <mtext>, and other token MathML elements.
• New \bbox[color;attributes]{math} macro to add background color, padding, borders, etc.
• New \middle macro for stretchy delimiters between \left and \right.
• New \label, \ref, and \eqref macros for numbered equations.
• Better implementation of \not so it produces proper MathML when possible.
• Better implementation of \dots that selects \ldots or \cdots depending on the context.
• Better implementation of \cases that automatically uses \text on the second entry in each row.
• Safer implementation of \require that only allows loading from extensions directory.
• Allow \newcomand to provide a default parameter.
• Allow \\ to take an optional argument that specifies additional space between lines.
• Allow \\ to be used anywhere (to force a line break), not just in arrays.
• Allow optional alignment parameter for array, aligned, and gathered environments.

• Font enhancements:

• Work around for the OS X Lion STIX font problem.
• Support for STIX-1.1-beta fonts (detection of which version you have, and use data appropriate for that).
• New WOFF versions of the web fonts (smaller, so faster to download).
• Data for more stretchy characters in HTML-CSS output.
• Add support for Unicode planes 1 through 10 (not just the Math Alphabet block) in HTML-CSS output.
• Increased timeout for web fonts (since it was switching to image fonts too often, especially for mobile devices).
• Only switch to image fonts if the first web font fails to load (if we can access one, assume we can access them all).
• Allow <mtext> elements to use the page font rather than MathJax fonts (optionally).
• Provide better control over font used for characters that are not in the MathJax fonts.

• Interface improvements:

• The MathJax contextual menu has been reorganized to make it easier to get the source view, and to control the parameters for MathPlayer in IE.
• The MathJax contextual menu is available in mobile devices (see description above).
• Warning messages are issued if you switch renderers to one that is inappropriate for your browser.
• MathJax now starts processing the page on the DOMContentLoaded event rather than the onload event (this allows the mathematics to appear sooner).
• Native MathML output is now scaled to better match the surrounding font.
• Better CSS styling for NativeMML output in Firefox in order to handle \cal and other fonts.
• MathML output now (optionally) includes class names to help mark special situations generated by the TeX input jax. (This let's the MathML from the Show Source menu item better reproduce the original TeX output.)


• Important changes from previous versions:

• The default renderer for Firefox has been changed from NativeMML to HTML-CSS (in those configurations that choose between the two). The only browser that defaults to NativeMML is now IE with MathPlayer installed.

• NativeMML will now be selected in IE9 when MathPlayer is present (since IE9 was released the same day as MathJax v1.1a, and there had been problems with IE9 beta releases, we weren't sure if MathPlayer would work with the official release, and so did not select NativeMML by default.)

• The tex2jax preprocessor now balances braces when looking for the closing math delimiter. That allows expressions like $y = x^2 \hbox{ when $x > 2$}$ to be properly parsed as a single math expression rather than two separate ones with unbalanced braces. The old behavior can be obtained by setting balanceBraces to false in the tex2jax block of your configuration.

• A one pixel padding has been added above and below HTML-CSS output so that math on successive lines of a paragraph won't bump into each other.

• There is a new MathPlayer submenu of the Math Settings menu in the MathJax contextual menu that allows the user to control what events are passed on to MathPlayer. This allows better control for those using assistive devices like screen readers. When menu events are being passed on to MathPlayer, the MathJax menu can be obtained by ALT-clicking on a typeset expression (so the user can still access MathJax's other features).
 
  • #74
Is it ok for everybody if I add this text:

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 $$.

For example

Code:
The equation ##x+2=3## implies $$x=1.$$

Will yield:

The equation ##x+2=3## implies $$x=1.$$

Any comments?
 
  • #75
Looks good to me. (And I don't think the slowness that AlephZero experienced can have been caused by the use of the Verdana font).
 
  • #76
At the very beginning of the FAQ we have this statement:

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.

But it is enough to right click on the equation and select Show Source from the local menu.
 
  • #77
Borek said:
But it is enough to right click on the equation and select Show Source from the local menu.
I prefer the statement we have, because when they click QUOTE they also see what tags we used, and if we typed spaces or newlines before or after. And the right-click thing is explained at the end, under "additional information", where we say "A right-click will display a menu where you can choose to" followed by a list where the first item is "view the LaTeX source code".

Also, this is rarely an issue, but if a person used a \newcommand in his first latex formula in the post, and then used the new command in the second, someone who just looks at the source code won't see the code that defines the code he sees. (I would recommend against using \newcommand like that, because if someone quotes a formula where the command is used but not defined, on a different page of the thread, then (I assume) that the formula won't be displayed correctly. If you want to use \newcommand, I recommend including the definition with every formula that uses it.)
 
Last edited:
  • #78
Borek said:
But it is enough to right click on the equation and select Show Source from the local menu.
If you want to see the code for several different equations, it's easier to use the Quote method.
 
  • #79
FYI, I have edited post #1 of this thread to contain a link to the publicly viewable FAQ thread.
 

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
280
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
222
  • 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