Help talk:Displaying a formula

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Wikipedia Help Project (Rated NA-class, Mid-importance)
WikiProject icon This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
 NA  This page does not require a rating on the project's quality scale.
 Mid  This page has been rated as Mid-importance on the project's importance scale.

MathML broken again?

This is probably the wrong place to ask this, feel free to direct me elsewhere.

I'm still getting fallback svg images in Firefox, even though I've got MathML in my prefs. It's been broken a long time for me, I'm not sure it ever worked after MathJax was removed. Should this work? Discussion above suggests it was fixed for everyone else in August 2015. Is there some way I can debug this? How is the fallback decision made? Kendall-K1 (talk) 15:28, 2 June 2016 (UTC)

Unfortunately this became more complicated. While the user setting is no longer needed the native MathML plugin is required. See The good news is, that there is also information on the font setup, so that really good looking MathML is produced in the end. --Physikerwelt (talk) 16:00, 2 June 2016 (UTC)
(Edit conflict) The relates to T131177 which has changed the default renderer for all users. Part of that change is to was "As a result we reconsidered to decision to delver MathML as default for firefox users. Now they get SVG's as well and need to install a add on which provides really good MathML support."
The discussion about dropping MathML for firefox was at Wikipedia talk:Special:Preferences
You can reenable the MathML with a bit of CSS
.mwe-math-fallback-image-inline {
	display: none !important;

.mwe-math-fallback-image-display {
	display: none !important;

.mwe-math-mathml-a11y {
		position: inherit;
Add this to your Special:MyPage/vector.css and the MathML will reappear. --Salix alba (talk): 16:48, 2 June 2016 (UTC)
Installing the FF plugins did it. Sorry if I missed it, but this really needs to be documented somewhere. Kendall-K1 (talk) 17:16, 2 June 2016 (UTC)

I am not sure if this is related to this section per se, but I see no option to create a new section while not logged in... Something that has been broken for a little while here (maybe a month or two? not sure) is the displayed size of formulae. The bounding box for the svg images is the correct size, but the images themselves appear microscopic. Opening the images in a new tab shows the formulae at the proper size, but this workaround still leaves formula-heavy pages nearly illegible. It also renders the point in the "benefits of TeX" section of the article about formula size being larger in TeX vs. HTML invalid. Regardless of whether user preferences can fix this anomaly, it should not be the case that one must log in before a page can approach legible (hence the intentional being not-logged-in for this comment). (talk) 02:45, 7 July 2016 (UTC)

Thank you Salix alba for the .css snippet - that fixes it. The discussion Wikipedia talk:Special:Preferences does not seem entirely relevant; it addresses the question of the default rendering and it's not clear why this should override user preferences. I had supposed that correct rendering had stopped due to some bug that would eventually be fixed if I was very patient - so thanks again, --catslash (talk) 01:52, 12 March 2017 (UTC)
I've added a new rule to the above css to prevent the display maths produced with the <math display="block"> tag, which is how Visual Editor creates display maths. --Salix alba (talk): 16:29, 28 August 2017 (UTC)

About chemical equations

If I have any grammar or spelling errors, please feel free to change.

On this page,the example of chemical equations like <chem>{A2}+B2->2AB</chem>;and for beautiful,I suggest changing them to like <chem>A2{+}B2->2AB</chem>.--脂肪酸钠 (talk) 09:00, 2 April 2017 (UTC)

Not sure <chem>A2{+}B2->2AB</chem> () is bettern than <chem>{A2}+B2->2AB</chem> (). Looking in some text books there seems to be a large space around the plus sign. --Salix alba (talk): 10:45, 22 April 2017 (UTC)

Accented character

The accented character in <math>ń\left(D\right)</math> causes the tag to not render. Advice? Lfstevens (talk) 21:17, 4 July 2017 (UTC)

Try \acute{n}. --Deacon Vorbis (talk) 22:04, 4 July 2017 (UTC)

How to start a new line?

It seems that \\ does not work. Golopotw (talk) 00:39, 23 July 2017 (UTC)

It does within certain environments, like align (and related ones), but not otherwise. --Deacon Vorbis (talk) 00:44, 23 July 2017 (UTC)

LaTeX Incorrect Rendering

(In reference to edit Special:Diff/811387351 on the triangular numbers page) Under what conditions could/would the LaTeX markup (eg "<math></math>") be displayed instead of the intended formula? Specifically, what could cause all the LaTeX markup in a single section of a page to render that way? (It's possible the issue was caused by my browser not fully loading the page) If possible, please point me to any "best practices" documentation for Wikipedia's LaTeX implemention. —Leopardpaw (talk) 09:02, 21 November 2017 (UTC)

@Leopardpaw: Your Math settings in the appearance section of the preferences would cause that if it were set to "LaTeX source", instead of MathML with SVG and PNG. —TheDJ (talkcontribs) 09:26, 21 November 2017 (UTC)
@TheDJ: Thank you for the quick response. In this case, I am primarily using a mobile browser (which may be part of the issue). It might have been due to a combination of interacting with Wikipedia's mobile site and my browser's setting, since as soon as I pushed my edit, the LaTeX rendered properly.

As a note, I did check the settings you referrenced, and it is set to render MathML. Thanks again. —Leopardpaw 09:48, 21 November 2017 (UTC)

@Leopardpaw what likely happened, is that when you added it, the page was rendered before the math fragment was finished. In theory this should not happen, but sometimes it does. Reloading the page, or making a WP:NULLEDIT usually fixes the problem. —TheDJ (talkcontribs) 09:47, 5 December 2017 (UTC)

Work around for LaTeX \phantom?

I intend to re-use given structures for displaying formulas by (slightly) modifying the existing content, without spending much effort on redesigning an elaborate alignment. This quick-and-dirty method seems reasonable to me, especially when considering the rate of acceptance for changes in WP. Cleaning up LaTeX-source may be scheduled for times after establishing content, possibly carried out by expert gnomes.

Since I am no expert in LaTeX, I humbly ask for cheap tricks, possibly saving me to, e.g., dig into arrays with elaborate aligning. Best regards, Purgy (talk) 09:08, 5 December 2017 (UTC)

Do you have an example of the expression you would like to display. --Salix alba (talk): 09:36, 5 December 2017 (UTC)
@Purgy Purgatorio Note that we don't support full LaTeX, only the math subset of LaTeX (specifically amsmath). —TheDJ (talkcontribs) 09:50, 5 December 2017 (UTC)
We don't even fully support amsmath: \genfrac, \substack, and \operatorname* all don't work, for example. –Deacon Vorbis (carbon • videos) 13:46, 5 December 2017 (UTC)
... yes, I got to learn this already (\dddots -> \overset), nevertheless I ask the experts for some work around. Purgy (talk) 19:50, 5 December 2017 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── I would enjoy most a generic answer to Howto mimic \phantom in WP?, but I do understand that this is maybe too much or meaningless to ask for. The last encounter with this problem was the following:

Having this:

and wanting something, approximated by this:

but not by using the ridiculous and unsatisfactory "\;\;\" but rather "\phantom {-}", or possibly "\phantom {{}-}". Aligning with the rude "&" did not work for me because of the minimally introduced whitespace, and \mspace does not work either. I mused about this already in other environments, but started to ask around on this occasion. As said, I am no expert, but really, I do like experts' answers. Purgy (talk) 19:50, 5 December 2017 (UTC)

Well, \phantom would certainly be nice to have for other things too, but here, you can achieve the same effect using the array environment, which is essentially what cases does. (Note, use \text{} here, not \mbox{}).
Deacon Vorbis (carbon • videos) 20:22, 5 December 2017 (UTC)
Thank you for having done the work, which I so eagerly strive to avoid. As mentioned in the thread starter I search for a quick-and-dirty method to re-use, as extensively as possibly, existing structures and definitely want to avoid re-casting the whole environment.
Mournfully, by your suggestion, I see my chances, for some artifice of \LaTex (you cannot have even this in its full glory) to trick WP-rendering to my desires, dramatically degrading. Any more sages around, please? Purgy (talk) 08:42, 6 December 2017 (UTC)

Difference between \bold and \mathbf?

This text is in \bold

And this is the same string in \mathbf

There doesn't seem to be any difference between the two, so which one should be used? And why is there no reference to \bold anywhere except for section — Preceding unsigned comment added by Megafish40 (talkcontribs) 19:44, 10 December 2017 (UTC)

The \bold command does not appear in The Not So Short Introduction to LATEX 2ε. It might be a hang over from the old texvc package which had some odd non standard syntax.--Salix alba (talk): 23:47, 10 December 2017 (UTC)
@Megafish40: Correct, there are many texvc commands that weren't actual standard mathmode commands or that were common LaTeX commands or shortcuts, which were added in the early days for convenience. \bold is defined as an alias for the proper \mathbf. So while the result is the same, \mathbf, is what you really should be using, because it makes the formula interoperable with most latex renderers. —TheDJ (talkcontribs) 10:48, 11 December 2017 (UTC)

Spacing in arrays

I perceived that

{[email protected]{}l}

generates an error, and

{[email protected]{4em}l}

is ignored. Did I do something wrong, or is there a workaround? Specifically, I would like to be able to set the arrays-inherent spacing to zero. Purgy (talk) 12:06, 14 January 2018 (UTC)

It sure doesn't look like there's much control over the spacing commands here. You can try using 6 \!s before every entry in the second column. That seems to give about the right negative space, but that's almost certainly a bad idea. What are you trying to do? Maybe there's another way. –Deacon Vorbis (carbon • videos) 14:05, 14 January 2018 (UTC)
It is similar to what I wanted to do recently with \phantom. I want to have approximately this:
but I dislike doing it with \;\;\ , and would like to avoid the surplus white space before and after the "=", which should remain aligned, of course.
Thank you for your efforts. Purgy (talk) 15:38, 15 January 2018 (UTC)
Unfortunately, I don't think that's going to be reasonable given the limited spacing commands available, especially missing \phantom{}. I think using a plain align block would be just fine here. I suspect that even in a full TeX install, getting such fine control over vertical alignment (in a robust way) within an alignment block would require some significant wizardry (to the point where I'd just look for separate packages that do it for you already). –Deacon Vorbis (carbon • videos) 15:51, 15 January 2018 (UTC)

Writing chem ionic equation

How do I write:

Fe2+ + Cu2+

using <chem>? I cannot figure out how to get the "+" between the pair of ions to render correctly. Here are my attempts at the left-hand side:

<chem>Fe2+ + Cu2+</chem>
<chem>Fe+2 + Cu+2</chem>
<chem>Fe^{2+} + Cu^{2+}</chem>
<chem>Fe^{+2} + Cu^{+2}</chem>

DMacks (talk) 20:09, 20 January 2018 (UTC)

<chem>Fe^2+ + Cu^2+</chem> seems to work . --Salix alba (talk): 20:17, 20 January 2018 (UTC)

Thanks! DMacks (talk) 02:28, 24 January 2018 (UTC)
Retrieved from ""
This content was retrieved from Wikipedia :
This page is based on the copyrighted Wikipedia article "Help talk:Displaying a formula"; it is used under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA). You may redistribute it, verbatim or modified, providing that you comply with the terms of the CC-BY-SA