Help talk:Displaying a formula

From Wikipedia, the free encyclopedia
Jump to: navigation, 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.
 

Equations broken on iphone[edit]

All equations now render as illegibly small on my iphone. Tried safari, chrome, mercury with lots of user agents. Recent within few days of 22 August 2016. 107.77.213.47 (talk) 05:23, 23 September 2016 (UTC)

What happened to MathML?[edit]

Ok, so first you guys got rid of MathJax. Fine, I can live with that. It was working perfectly well, but whatever. Then you broke MathML. Now we're back to what things were like, ca 2005. What's going on? -- Hongooi (talk) 09:16, 17 August 2015 (UTC)

MathML seems to work, but I suspect that the user math appearance preferences were somehow reset to PNG. I had to manually reset to MATHML. - DVdm (talk) 10:05, 17 August 2015 (UTC)
MathML just displays blanks where the equations should be, in Chrome and MS Edge. -- Hongooi (talk) 14:44, 17 August 2015 (UTC)
Yes, I also get blanks from Edge (on Win10) and from Internet Explorer 11 (both on Win8.1 and Win10). Firefox is perfect on both Win8.1 and Win10. Don't know about Chrome—never used it and never will. - DVdm (talk) 15:18, 17 August 2015 (UTC)
Right, so MathML is broken. It was actually working just a couple of weeks ago, so they should have just let well enough alone. -- Hongooi (talk) 15:26, 17 August 2015 (UTC)
There is a bug for this at [1]. Basically there was a silly mistake in the last update, this is now fixed and is scheduled to go live today. If things are not working in a day or two mention it hear and I'll make sure the bug is updated.--Salix alba (talk): 23:25, 17 August 2015 (UTC)
To clarify the bug was with the SVG fallback mode. True MathML only works in firefox all other browsers use serverside SVG images in this mode. The SVG images were broken but the MathML was fine, which is why things worked in firefox.--Salix alba (talk): 23:29, 17 August 2015 (UTC)
──────────────────────────────────────────────────────────────────────────────────────────────────── I'd hopped it would be fixed by today but according to mw:MediaWiki_1.26/Roadmap it should be thursday.--Salix alba (talk): 21:33, 18 August 2015 (UTC)
Resolved
should be working now.--Salix alba (talk): 09:51, 21 August 2015 (UTC)
Is working indeed, including on the new ugly browsers. Thanks. - DVdm (talk) 11:00, 26 August 2015 (UTC)

How to display circumflex[edit]

Help:Displaying a formula#Special characters says:

But if I test that "can be entered" example:

<math>\# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}</math>

I get:

Failed to parse (unknown function "\textasciicircum"): \# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}

What is the correct way to get "^"? DMacks (talk) 20:43, 21 December 2015 (UTC)

Failed to parse (unknown function "\textasciicircum"): {\displaystyle \# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}}

This section was quite out of date and depended on the texvc renderer. To get all the characters to render you can use

math \# \$ \% ^\wedge \& \_ \{ \} \sim \backslash giving . You can also use \hat and \widehat or \wedge. --Salix alba (talk): 17:40, 6 June 2016 (UTC)

Problem with Greek Letters in fractions and functions.[edit]

I'm trying to display a formula within the math structure that employs Greek letters and keep getting these error statements:

Failed to parse (lexing error): \frac {1} {σ} = 16.3 \frac{P} {T^2} \left ( 0.0342 + \frac {dT} {dh} \right ) \cos β ,

Failed to parse (syntax error): \frac {1} {σ} = 16.3 \frac{P} {T^2} \left ( 0.0342 + \frac {dT} {dh} \right ) \cos β ,

(note the second used the & s i g m a ; code, not the unicode Greek letters).

I tried a number of variations on parts of the formula and finally got the whole thing to work by substituting b for β and s for σ as follows:

It's a clumsy workaround since the source I'm citing uses Greek symbols and I'd like to follow it accurately. Does anyone have any idea of where I'm going wrong. --SteveMcCluskey (talk) 01:28, 4 May 2016 (UTC)

LaTeX dates from before unicode. Rather than using the unicode character αβγδ etc you should use the latex commands \alpha, \beta, \gamma, \delta. So your formula should be
 \frac {1} {\sigma} =  16.3 \frac{P} {T^2} \left ( 0.0342 + \frac {dT} {dh} \right ) \cos \beta,

which renders as . --Salix alba (talk): 07:29, 4 May 2016 (UTC)

Thanks for the help. I pasted in your version and it worked perfectly. --SteveMcCluskey (talk) 14:17, 4 May 2016 (UTC)

MathML broken again?[edit]

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 https://www.mediawiki.org/wiki/Extension:Math. 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 Thttps://phabricator.wikimedia.org/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-mathml-a11y {
		position: inherit;
		clip:inherit;
		width:inherit;
		height:inherit;
		opacity: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). 169.235.228.254 (talk) 02:45, 7 July 2016 (UTC)

fractions[edit]

The only references to displaying fractions are part of very complex formulas that are used as examples of entirely different tags. Can someone add a section on the frac tags themselves? Because I can't get the damn things to work. Maury Markowitz (talk) 16:46, 31 July 2016 (UTC)

There are some simple examples at the start of the Fractions, matrices, multilines section. Just use \frac{a}{b} for just make sure your brackets match. You can also use {a \over b} giving . If you want fractions with numbers the {} can be omitted so \tfrac12 gives . If you post the formula you are struggling with here we might be able to help.--Salix alba (talk): 18:43, 31 July 2016 (UTC)
@Salix alba: You can also omit brackets for letters, not just for digits: \frac xy renders as . The rule is not 'for numbers' but 'for single symbols'. The \frac command takes two simple subexpressions as parameters, which are either single symbols or bracketed subexpressions. By the way, your rule should read 'for single digits', not 'for numbers', because a chain of digits is not a simple subexpresion: \frac 12 7 renders as , and you need brackets to keep appropriate digits together: \frac{12}7. --CiaPan (talk) 09:08, 16 August 2016 (UTC)
And the section Parenthesizing big expressions, brackets, bars explains how to put brackets around fractions. --Salix alba (talk): 02:19, 1 August 2016 (UTC)

How to overstrike (or specific "standard taper" symbol)[edit]

I'm trying to create the standard taper symbol for inline use. The symbol is an overstrike (superposition) of "S" and "T". I can't find a unicode character for it. Is there a generic way to overstrike in MathTeX or other Wikipedia layout modes? I'm currently using an SVG with hardcoded size to match one of WP's default fonts, so I can write "{{standard taper}} 14/20" to get "Standard taper 14/20" that looks fine on one of the default skins, but that's not good if one uses a different fontsize. DMacks (talk) 21:03, 2 October 2016 (UTC)

I thought you might try some number of 'negative spaces' to shift the current position back – but that doesn't seem to work for me;
three are not enough: \mathrm{S \!\!\! T} renders as
four are too much: \mathrm{S \!\!\!\! T} renders as
CiaPan (talk) 06:50, 3 October 2016 (UTC)

Its possible to use negative spaces in math mode none are particularly sucessful

Another methods is the use <span style="position:relative; left:-0.5em; top:-1px"> in CSS. So STor using an overline and bar S̅|.

Both methods seem a bit flaky to me and you image-based solution still looks best.--Salix alba (talk): 07:06, 3 October 2016 (UTC)

Chemistry decimal fractions[edit]

Hi. How can I write a decimal fraction in <ce>...</ce> environment? All the latex tricks I found in the net do not work. Thank you. IKhitron (talk) 12:52, 1 November 2016 (UTC)