Help talk:Displaying a formula

From Wikipedia, the free encyclopedia

math tag with display=block no longer doing so?

Apologies if this is reported somewhere already, cf. Special:Diff/1284223562 for the moment, given sometime recently the tags stopped displaying as anything but inline. I assume it's on the level of a CSS issue? Remsense   09:04, 6 April 2025 (UTC)

Only part of formula is displayed (with horiz slider). How display entire formula?

I'm looking at Periodic_continued_fraction#Generalized_continued_fraction, and there are a few formulas in that section. The bottom one is an issue: only a part of the formula is displayed (even when browser window is very, very wide), and the user must use sliders (both horizontal and vertical) to see the whole formula.

I thought "well, maybe that is inescapable", but the two formulas above the problematic formula are equally large, and yet they do not require (or display) slilders.

Questions Is there a way to improve the bottom formula so it displays the whole formula?

The configurations that exhibit the problem:

  • Apple MacMini OS 15.1.1; Safari browser
  • Apple MacMini OS 15.1.1; Firefox browser
  • Windows OS 11 MS Edge browser

Configurations that do not exhibit the problem (that is, the full formula is displayed without sliders):

  • Wikipedia app on Android phone.
  • Windows OS 11 Firefox browser

Noleander (talk) 02:06, 7 April 2025 (UTC)

BTW, here are those two formulas, copied verbatim from the above article. The problem shows up in the lower formula, but the upper formula is okay. If you do not see the sliders in the lower formula, refer to the configuration information in post immediately above.
which is simply the aforementioned evaluated at every third term. Combining pairs of fractions produces
Noleander (talk) 02:07, 7 April 2025 (UTC)

Indentation rules

The most used indentation rule for displaying math is to use a colon such that :<math>E=mc^2</math> renders

however if I am reading MOS:INDENT and this page right, we should use two line breaks and <math display=block>E=mc^2</math>

Is this right? This would require a lot of work to change everywhere. Is this recent? Is there anyway to revert to the previous convention? The colon is shorter and simpler, while the double line break and block display does not indent on mobile, and leads to other problems, specially if text is in the same line. ReyHahn (talk) 11:23, 7 April 2025 (UTC)

  • A leading colon is not indentation, it is the definition part of a description list. Using it for indentation produces invalid HTML and is an accessibility error. It has never been correct practice. Lack of indentation and displaying on the same line on mobile is a bug IMO, which I've reported. Hairy Dude (talk) 23:29, 8 February 2026 (UTC)

{align} vs {aligned}

Is {align} silently being converted to {aligned}? In amsmath LaTeX, {align} can only be used in text-mode, whereas on WP it works even in a sub-expression.

Is it ok to use {aligned}? It seems to work.

If so, should this be stated (for anybody wanting to use the same code for amsmath LaTeX and WP)? catslash (talk) 23:46, 14 May 2025 (UTC)

The question is unclear. By {align} and {aligned} do you mean the align and aligned environments? please show the LaTeX source inside <syntaxhighlight lang=latex>...</syntaxhighlight> or the <math>...</math> wikitext inside <syntaxhighlight lang=wikitext>...</syntaxhighlight>. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 11:44, 15 May 2025 (UTC)
Yes, the align and aligned environments. The source:
\left .\begin{aligned}a & = b \\
 & = c \\
 & = d \\
 & \phantom = \vdots \\
 & = z \end{aligned} \right\} 25 \text{ lines}
works fine both as wikitext and LaTeX:
Whereas, if aligned is changed to align, then while it still works as wikitext, as LaTeX it gives the error ! Package amsmath Error: Erroneous nesting of equation structures;. catslash (talk) 16:06, 15 May 2025 (UTC)
Could One consequence is that the formula enclosed in the \left ... \right pair cannot have line breaks in the output. be the problem? Do you need anything from amsmath that is not already in LaTeX2ε? -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 17:14, 15 May 2025 (UTC)
It is the amsmath package which supplies the align and aligned environments. Without \usepackage{amsmath} the above code results in ! LaTeX Error: Environment aligned undefined. or ! LaTeX Error: Environment align undefined.. The code works fine with or without the \left ... \right pair. The question is (1) why does it also work with align in wikitext, (2) is there any reason not to use aligned in wikitext, (3) should the help page say that's is ok to use aligned? catslash (talk) 21:11, 15 May 2025 (UTC)
The "explanation" for the message is circular. Have you tried, e.g., stack exchange? What hapens if you remove the NL (\\)? -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 13:35, 16 May 2025 (UTC)

Inconsistency between <math> and {math} within page

On Astronomical coordinate systems phi sub o renders differently on MacOS Chrome browser (Version 141.0.7390.108 (Official Build) (arm64)) depending on the whether HTML or Latex formatting context is used. This makes the article confusing because this expression appears in both contexts but the visual appearance is inconsistent.

Inside {math} formatting the character phi does not appear.

ϕo, observer's latitude

Inside <math> formatting phi appears correctly.

, observer's latitude Setikites (talk) 15:53, 19 October 2025 (UTC)

Dark-mode

I think this Talk page is for the template used in Formula#Chemical_formulas.In dark mode it's not working for me displaying a white rectangle instead of Butane.

Light mode does work, as does removing the filter (commented out) in the following rule of load.php, which applies to the <img> tag

@media screen {
html.skin-theme-clientpref-night .skin-invert-image img, html.skin-theme-clientpref-night .skin-invert, html.skin-theme-clientpref-night .oo-ui-iconElement-icon:not(.oo-ui-image-progressive):not(.oo-ui-image-destructive):not(.oo-ui-checkboxInputWidget-checkIcon):not(.oo-ui-image-invert):not(.mw-no-invert), html.skin-theme-clientpref-night .oo-ui-indicatorElement-indicator {
	color-scheme: light;
	/* filter: invert(1) hue-rotate(180deg); */
  }
}

I hope this is the right place to repot this. ThanksTc 13 17 19 (talk) 01:32, 6 November 2025 (UTC)

Recent edit

@Altamediandies: Edit permalink/1335113448 introduce a typo LLaTeX vs. {{math}} and deleted an anchor

<span class="anchor" id="LaTeX vs. math template"></span>

. Was the removal of the anchor deliberate?

 Preceding unsigned comment added by Chatul (talkcontribs) 27 January 2026

A diff link would work better in this case, I think:
Special:Diff/1335113448
CiaPan (talk) 16:35, 27 January 2026 (UTC)
I've reverted the edits for now. There were also a bunch of unhelpful incidental markup changes. –jacobolus (t) 11:22, 28 January 2026 (UTC)

math display="block" failing?

The page g-factor (physics) is incorrectly formatted: the display="block" seems to be rendered as several spaces. The "Block" section on this page has the same problem. Johnjbarton (talk) 02:29, 10 February 2026 (UTC)

It looks fine to me. What kind of rendering do you have set in Special:Preferences § mw-prefsection-rendering? It should be set to "SVG". Other modes are still buggy. –jacobolus (t) 03:33, 10 February 2026 (UTC)
Yes, I have SVG. Hmm. I guess I have to reboot :-( Johnjbarton (talk) 03:47, 10 February 2026 (UTC)
Well rebooting did not fix it. Any other ideas?
mwe-math-element-block in my style sheet is setting the inline. If I disable it with the Inspector the display block is corrected. Johnjbarton (talk) 04:02, 10 February 2026 (UTC)
I'm not entirely sure what you are seeing. Maybe you can take a screenshot? Does it look better if you open an 'incognito' browser tab? Does it look better in a different browser? –jacobolus (t) 07:55, 10 February 2026 (UTC)
Debugging screenshot for a math rendering problem
The problem occurs in a incognito tab is Chrome (Mac OS) but not in Safari on the same machine. Johnjbarton (talk) 22:00, 10 February 2026 (UTC)

Related Articles

Wikiwand AI