Help:Displaying a formula

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search
This screenshot shows the formula E = mc2 being edited using VisualEditor. The window is opened by typing "<math>" in VisualEditor. The visual editor shows a button that allows to choose one of three offered modes to display a formula.

There are three methods for displaying formulas in Wikipedia: raw HTML, HTML with math templates (abbreviated here as {{math}}), and a subset of LaTeX implemented with the HTML markup <math></math> (referred to as LaTeX in this article). Each method has some advantages and some disadvantages, which have evolved over time with improvements of MediaWiki.

For example, the famous Einstein formula can be entered in raw HTML as {{nowrap|''E'' {{=}} ''mc''<sup>2</sup>}}, which is rendered as E = mc2 (the template {{nowrap}} is here only for avoiding a line break inside the formula). With {{math}}, it can be entered as {{math|''E'' {{=}} ''mc''{{sup|2}}}}, which is rendered as E = mc2. With LaTeX, it is entered as <math>E=mc^2</math>, and rendered as <math>E=mc^2</math>.