Jump to content

Help talk:Displaying a formula: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Sheerun (talk | contribs)
Line 243: Line 243:
::Ah, I see. The example in the book can be produced with <nowiki><math>\left\{3,{3\atop4}\right\}</math></nowiki> <math>\left\{3,{3\atop4}\right\}</math>, you can use an array as above if justification is needed: <nowiki><math>\left\{p,\begin{array}{l}q,r\\s\end{array}\right\}</math></nowiki> <math>\left\{p,\begin{array}{l}q,r\\s\end{array}\right\}</math>.—[[User:EmilJ|Emil]]&nbsp;[[User talk:EmilJ|J.]] 17:34, 25 October 2013 (UTC)
::Ah, I see. The example in the book can be produced with <nowiki><math>\left\{3,{3\atop4}\right\}</math></nowiki> <math>\left\{3,{3\atop4}\right\}</math>, you can use an array as above if justification is needed: <nowiki><math>\left\{p,\begin{array}{l}q,r\\s\end{array}\right\}</math></nowiki> <math>\left\{p,\begin{array}{l}q,r\\s\end{array}\right\}</math>.—[[User:EmilJ|Emil]]&nbsp;[[User talk:EmilJ|J.]] 17:34, 25 October 2013 (UTC)
: Excellent, could be a bit more compact, but works! [[User:Tomruen|Tom Ruen]] ([[User talk:Tomruen|talk]]) 18:08, 25 October 2013 (UTC)
: Excellent, could be a bit more compact, but works! [[User:Tomruen|Tom Ruen]] ([[User talk:Tomruen|talk]]) 18:08, 25 October 2013 (UTC)

== Temporary problem with parsing equations? ==

See this page: https://en.wikipedia.org/wiki/Klein_bottle

It is filled with errors "Failed to parse(unknown function '\begin')". It seems the equations have been there for a long time (I checked recent history), and no one has complained about these errors before in the talk page. So it seems that the problem is with the mediawiki software and is temporary.

I will visit later to check if it got fixed. In the mean time please post if you have more clue on this error. - [[User:Subh83| '''Subh83''']] <small>([[User_talk:Subh83|talk]] &#124; [[User:Subh83/contribs|contribs]])</small> 18:36, 7 February 2014 (UTC)

Revision as of 18:36, 7 February 2014

WikiProject iconWikipedia Help NA‑class
WikiProject iconThis 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.
NAThis page does not require a rating on the project's quality scale.

The symbol # not translating correctly in GmailTex and codecogs LaTeX Equation editor

\# produces a dollar sign '$' instead of a pound sign. Seems to be an "off by 1" error. Suggested work-around: use \pound for this symbol since it might cause problems when embedded in html which treats the pound symbol as as special character as well! Alancarre (talk) 15:44, 20 April 2013 (UTC)[reply]

Stretching matrices

Is there a way to make matrices with lots of fractions like this look better?

In LaTeX, I usually just type \renewcommand\arraystretch{1.2}, and that fixes it.. but that doesn't seem to work here. Any other ideas? Thanks, Mark M (talk) 08:41, 25 December 2012 (UTC)[reply]

Like this?:--JohnBlackburnewordsdeeds 09:43, 25 December 2012 (UTC)[reply]

Ah, yes, that would work too, thanks. Do I take it that we don't have a way to stretch the matrices, if so desired? Mark M (talk) 09:55, 26 December 2012 (UTC)[reply]
The original matrix does look a lot better when using MathJax renderer. See Help:Displaying a formula#MathJax.--Salix (talk): 10:32, 26 December 2012 (UTC)[reply]

Use the option parameter of the LaTeX newline command to add some extra line spacing, e.g., \\[3pt]. Nageh (talk) 13:10, 26 December 2012 (UTC)[reply]

Great, that works too. Thanks a lot! Mark M (talk) 18:02, 28 December 2012 (UTC)[reply]
Removed spurious whitespace. Nageh (talk) 19:54, 29 December 2012 (UTC)[reply]

Btw, just in case you prefer smaller fractions you can use \tfrac instead:

Nageh (talk) 19:54, 29 December 2012 (UTC)[reply]

Rendering of unicode

I've cut the following from the rendering section which seems a little off topic for a help page being more of an extensive test/bug report. Preserved here for posterity.--Salix (talk): 22:38, 7 March 2013 (UTC)[reply]

This does not work for special characters, they are ignored unless the whole <math> expression is rendered in HTML:

  • <math>\begin{align} \text{ AaȦȧÄäÁáÀàĀāÂâǍǎĂăÃãÅåẠạ } & \text{ ÆæǼǽ BbḂḃḄḅḆḇ CcĊċĆćĈĉČč Çç DdḊḋĎďḎḏḌḍ Ḑḑ } \\ \text{ EeĖėËëÉéÈèĒēÊêĚěĔĕẼẽẸẹ Ȩȩ } & \text{ FfḞḟ GgĠġḠḡĜĝǦǧĞğ HhḢḣḦḧĤĥȞȟḤḥẖḪḫ Ḩḩ } \\ \text{ IıİiÏïÍíÌìĪīÎîǏǐĬĭĨĩỊị } & \text{ JjĴĵ KkḰḱǨǩḲḳḴḵ Ķķ LlĹ弾ḶḷḺḻ ĻļŁł } \\ & \text{ MmṀṁḾḿṂṃ NnṄṅŃńŇňÑñṆṇṈṉ Ņņ} \\ \text{ OoȮȯÖöÓóÒòŌōÔôǑǒŎŏÕõỌọ } & \text{ ØøǾǿ Œœ PpṖṗṔṕ Qq RrṘṙŔŕŘřṚṛṞṟ Ŗŗ } \\ & \text{ SsṠṡŚśŜŝŠšṢṣ Şş ß TtṪṫẗŤťṬṭṮṯȚț Ţţ } \\ \text{ UuÜüÚúŰűÙùŪūÛûǓǔŬŭŨũŮůỤụ } & \text{ VvṼṽṾṿ WwẆẇẄẅẂẃẀẁŴŵẈẉẘ XxẊẋẌẍ } \\ \text{ YyẎẏŸÿÝýỲỳȲȳŶŷỸỹẙỴỵ } & \text{ ZzŻżŹźẐẑŽžẒẓẔẕ ·×÷ } \\ \end{align}</math>

gives:

See bug 798 for details. Nevertheless, using \mbox instead of \text, more characters may have been supported in the past, but today both operators are supporting the same characters set. For example,

  • <math>\begin{align} \mbox{ AaȦȧÄäÁáÀàĀāÂâǍǎĂăÃãÅåẠạ } & \text{ ÆæǼǽ BbḂḃḄḅḆḇ CcĊċĆćĈĉČč Çç DdḊḋĎďḎḏḌḍ Ḑḑ } \\ \mbox{ EeĖėËëÉéÈèĒēÊêĚěĔĕẼẽẸẹ Ȩȩ } & \text{ FfḞḟ GgĠġḠḡĜĝǦǧĞğ HhḢḣḦḧĤĥȞȟḤḥẖḪḫ Ḩḩ } \\ \mbox{ IıİiÏïÍíÌìĪīÎîǏǐĬĭĨĩỊị } & \text{ JjĴĵ KkḰḱǨǩḲḳḴḵ Ķķ LlĹ弾ḶḷḺḻ ĻļŁł } \\ & \text{ MmṀṁḾḿṂṃ NnṄṅŃńŇňÑñṆṇṈṉ Ņņ } \\ \mbox{ OoȮȯÖöÓóÒòŌōÔôǑǒŎŏÕõỌọ } & \text{ ØøǾǿ Œœ PpṖṗṔṕ Qq RrṘṙŔŕŘřṚṛṞṟ Ŗŗ } \\ & \text{ SsṠṡŚśŜŝŠšṢṣ Şş ß TtṪṫẗŤťṬṭṮṯȚț Ţţ } \\ \mbox{ UuÜüÚúŰűÙùŪūÛûǓǔŬŭŨũŮůỤụ } & \text{ VvṼṽṾṿ WwẆẇẄẅẂẃẀẁŴŵẈẉẘ XxẊẋẌẍ } \\ \text{ YyẎẏŸÿÝýỲỳȲȳŶŷỸỹẙỴỵ } & \text{ ZzŻżŹźẐẑŽžẒẓẔẕ ·×÷ } \\ \end{align}</math>

gives:

But some Latin letters are not supported, including those that include multiple diacritics (e.g. with Latin letters used in Vietnamese) or that cannot be precomposed into a single character (such as the uppercase Latin letter W with ring, even though the lowercase letter is supported as it is encoded as a precomposed character), or that use other diacritics (like the ogonek or the double grave accent, used in Central European languages like Polish, or the horn attached above some vowels in Vietnamese), or other modified letter forms (used in IPA notations, or African languages, or in medieval texts), some digram ligatures (like IJ in Dutch), or Latin letters borrowed from Greek, or small capitals, as well as superscripts abd subscript letters. For example \text{ð} or \mbox{ð}, and \mbox{þ} or \mbox{þ} (used in Icelandic) will give an error:

  • ,
  • ,

Can I make a representation of four characters in a box?

I'm trying to build a template that will allow a user to enter four hexadecimal digits and will output a representation of those digits as if they were a unicode character that failed to render due to lack of font support. I'm thinking that using <math>...</math> tags would be the easiest way for me to do this, but am open to doing it with CSS if possible. The problem I was having with using just CSS is not knowing how to stack the sets of numbers on top of each other. User:Technical 13   ( C • M • Click to learn how to view this signature as intended ) 18:20, 28 March 2013 (UTC)[reply]

The main problem with <math> in English Wikipedia is its persistent usage for miscellaneous formatting which has nothing to do with formulae. It (in MathJax mode) causes a browser to waste a lot of resources. Drop this evil thought – use HTML. Incnis Mrsi (talk) 20:12, 28 March 2013 (UTC)[reply]
Can you make it smaller to more accurately represent the little "failed unicode character" boxes. I have a working sandbox for the project at: User:Technical_13/Template:UniBox which gives User:Technical 13/Template:UniBox. However, this is still too big... How can I get it smaller? User:Technical 13   ( C • M • Click to learn how to view this signature as intended ) 22:37, 28 March 2013 (UTC)[reply]

Png rendering of math mode

I'm trying to add examples in the article String_operations. In MathJax, everything rendered file. However, when I tried Png rendering, I got lexing errors at double quotes in math mode (e.g. Failed to parse (syntax error): {\displaystyle "Hello," \cdot "world" = "Hello,world"} ). After tediously replacing them all by ugly langle/rangle symbols (e.g. ), I got lexing errors at ß (HTML: szlig ß) in math mode (e.g. Failed to parse (syntax error): {\displaystyle \langle Straße \rangle} ). When looking for advice on these issues, I found that in section Help:Displaying_a_formula#Pros_of_TeX, the link at the end of item 2 ("It is more a reason to help improve the situation.") leads to a nonexisting section "Bug_reports". Therefor, I try to find help on this talk page. Jochen Burghardt (talk) 19:06, 25 May 2013 (UTC)[reply]

Section arrows

need examples. Im with difficulties trying to display an equation using \downarrow linking to another under the first one.(Thepalerider2012 (talk) 03:45, 31 May 2013 (UTC))[reply]

dddot

I'd like to use macro dddot from the amsmath package -- any hints? thx. Fgnievinski (talk) 00:29, 21 July 2013 (UTC)[reply]

It looks like it works <math>a\dddot b</math> gives Failed to parse (unknown function "\dddot"): {\displaystyle a\dddot b} .--Salix (talk): 05:21, 21 July 2013 (UTC)[reply]
No it doesn't. 37.123.174.195 (talk) 20:25, 5 September 2013 (UTC)[reply]
It works in MathJax, but not in the default PNG rendering.—Emil J. 21:09, 5 September 2013 (UTC)[reply]

No MathJax on mobile?

Any technical reason why MathJax won't render all on mobile? I'm using Chrome on Android right now and only see unrendered LaTeX code. --bender235 (talk) 19:34, 30 July 2013 (UTC)[reply]

I think its a feature yet to come. Its on the bug tracker at Template:Bug. For now you might have to set the render back to texvc in your preferences when using mobile.--Salix (talk): 22:44, 30 July 2013 (UTC)[reply]
MathJax works nicely on the desktop, so I'd like to reset the render only on mobile. Is that possible? --bender235 (talk) 08:40, 31 July 2013 (UTC)[reply]
You could try adding the following to you Special:MyPage/skin.js. It switches your preference depending on whether you are on a mobile or non mobile. You may need to reload a page once to get it to work.--Salix (talk): 18:49, 31 July 2013 (UTC)[reply]
jQuery( document ).ready( function( $ ) {

    var url = mw.util.wikiScript( 'api' ); 
    var newmath = 0;

  function setMath(val) {
    console.log('setMath' + val);
    newmath=val;
    console.log(url);
        $.ajax({
			url: url,
			data: { action: 'tokens', type: 'options', format: 'json' },
			dataType: "json"
		}).done(doneToken);
  }

  function doneToken(data) {
    console.log(data);
    var toks = data.tokens;
    var opttok = toks.optionstoken;
    console.log(opttok);
        $.ajax({
			url: url, type: 'POST',
			data: { action: 'options', token: opttok, format: 'json' , change: 'math=' + newmath },
			dataType: "text"
		}).done(doneSet);
  }

  function doneSet(data) {
   console.log(data);
 }

   var mobile = ( mw.config.get( 'wgServer' ) == 'en.m.wikipedia.org' );
   var oldmath =  mw.user.options.get('math');
   console.log("Math type " + oldmath + ' mobile ' + mobile );
   if( mobile && oldmath == 6) {
      setMath(0);
   }
  if( !mobile && oldmath == 0) {
      setMath(6);
  }
} );
Works very nicely. Thanks. --bender235 (talk) 20:15, 5 August 2013 (UTC)[reply]

higher resolution?

Is it possible to specify the resolution or the amount of detail used in the images produced by the math tag? The images have always been a little rough, but now that I'm using a new computer with a Retina display, the roughness is even more noticeable. Maybe even two images could be produced from these tags, one for the common resolution displays and one for higher definition displays. --Lance E Sloan (talk) 14:26, 30 August 2013 (UTC)[reply]

Have you tried switching to MathJax?. The setting's at the end of Special:Preferences#mw-prefsection-rendering. It uses text rather than bitmaps to render text so should work better on a Retina display. Given that solution has been (recently) added I don't see anything being done to the bitmap rendering. Work on that seemed to come to a halt a while ago: even before Retina displays there were issues with rendering quality. What you describe is probably feasible but now MathJax is here I don't see anyone doing much with the older bitmap code.--JohnBlackburnewordsdeeds 15:46, 30 August 2013 (UTC)[reply]
MathJax is unreadable compared to Latex. I'd very like too to see Latex renderred with 2x resolution. Sheerun (talk) 18:32, 12 January 2014 (UTC)[reply]

mathop troubles

I'm trying to render the following formula,

except with the superscript "all" and subscript "phases" located above and below the integral signs. With the LaTeX png renderer this doesn't work, though it does work with MathJax. The usage is actually over at WikiSource, transcribing a book by Gibbs, however I guess that nobody would notice my help request over there. You can see the result I am trying to obtain at this page. The code I use here

 \mathop{\int\ldots\int}^{\rm all}_{\rm phases} P \, dp_1 \ldots dq_n = 1,

works just fine in my own LaTeX installation, so I'm not quite sure what I'm doing wrong. --Nanite (talk) 11:25, 31 August 2013 (UTC)[reply]

The PNG renderer is broken by design: for unclear reasons it tries to parse the TeX input, and then output its own version of TeX which is actually passed to the TeX engine. This process is plagued by various miscomprehensions of TeX syntax, in particular, extra braces are output at all kinds of places where they don’t belong. One such place is around constructions such as \mathop{...}, \mathrel{...}, etc., where they tell TeX to make the expression a \mathord atom, undoing the explicit typecast. In other words, although \mathop, \mathrel, \mathbin and friends are syntactically recognized by the renderer, they have no effect.—Emil J. 14:44, 1 October 2013 (UTC)[reply]

Multiple Colors in Table Interfere

Is there some reason having several colors in math mode might cause problems? For instance, compare the various ways "OliveGreen" shows up at User:DukeEgr93/ColorProblems; the big table is basically the same as the one at Help:Displaying_a_formula#Color except the one on my page is all in one math environment and the one on the help page is 68 individual math environments. THere's something...strange...about that, especially if you look at the top examples on my page with the OliveGreens. DukeEGR93 02:24, 17 September 2013 (UTC)[reply]

  • One possibility - if the dvipng command does not have --truecolor in it, there could be issues; could that be it? DukeEGR93 03:29, 17 September 2013 (UTC)[reply]

\mathrm, \mathsf don't always show

Hello

The last two give me a parse error when I try to use them in this section. Can someone help please? Thanks. 219.73.120.132 (talk) 07:37, 20 September 2013 (UTC)[reply]

Interestingly, they work sometimes. It seems intermittent! 219.73.120.132 (talk) 07:39, 20 September 2013 (UTC)[reply]

Someone else @Tardis: has also experienced intermittent faults recently here. I think its time to raise a bug.--User:Salix alba (talk): 08:31, 20 September 2013 (UTC)[reply]
I am also plagued by these intermittent errors; they make editing pages with numerous equations problematic, since the likelihood of at least one being broken when saving is high.Anders Sandberg (talk) 13:24, 1 October 2013 (UTC)[reply]
You could try switching to the MathJax renderer via your preferences. Everything renders fine with that. I don't now how it will affect the end user though.--User:Salix alba (talk): 14:59, 1 October 2013 (UTC)[reply]

Failed to parse (no error message)

I keep getting the above error when trying to edit the Cyclonic separation article. Strange thing is that I will not change anything and the error message either pops up on an edit preview or edit save, or it goes away. It happens on my XP computer and my Windows 7 64 bit computer in different versions of both Firefox and Internet explorer. It did not happen in another article, but I can see the error several times on this page, even before I edited it. Ywaz (talk) 12:35, 3 October 2013 (UTC)[reply]

I'm interested in supporting Coxeter's polytope notation for 4-dimensions, see at [1], almost like , but I need the r to be left-justified. The two row symbol applies for more indices, above/below, separated by commas, in each row, and always left-justified. I also need a symbol like {p,(a/b)}, where a and b are vertically positioned like a fraction WITHOUT a fraction bar, again with possibly a list of symbols above and below, separated by commas and possibly of unequal numbers. Is this possible? Tom Ruen (talk) 16:15, 25 October 2013 (UTC)[reply]

Hmm, MathJax does not seem to accept \genfrac\{\}{0pt}{}{q,p}{r\hfill}, though it works in LaTeX. This way of coding it works: <math>\left\{\begin{array}{l}q,p\\r\end{array}\right\}</math> . I’m not sure I understand how the second one is supposed to look like: ? Anyway, if you need the a and b part left-justified, you can do it the same way as in the first example.—Emil J. 17:16, 25 October 2013 (UTC)[reply]
Almost right, but no (), see example at [[2]] Tom Ruen (talk) 17:19, 25 October 2013 (UTC)[reply]
Ah, I see. The example in the book can be produced with <math>\left\{3,{3\atop4}\right\}</math> , you can use an array as above if justification is needed: <math>\left\{p,\begin{array}{l}q,r\\s\end{array}\right\}</math> .—Emil J. 17:34, 25 October 2013 (UTC)[reply]
Excellent, could be a bit more compact, but works! Tom Ruen (talk) 18:08, 25 October 2013 (UTC)[reply]

Temporary problem with parsing equations?

See this page: https://en.wikipedia.org/wiki/Klein_bottle

It is filled with errors "Failed to parse(unknown function '\begin')". It seems the equations have been there for a long time (I checked recent history), and no one has complained about these errors before in the talk page. So it seems that the problem is with the mediawiki software and is temporary.

I will visit later to check if it got fixed. In the mean time please post if you have more clue on this error. - Subh83 (talk | contribs) 18:36, 7 February 2014 (UTC)[reply]