Jump to content

Help talk:Displaying a formula/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 03:43, 1 April 2015 (Archiving 2 discussion(s) from Help talk:Displaying a formula) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2Archive 3

November 2006

See m:Help_talk:Displaying_a_formula

Where is the group which is responsible for maintaining the TeX => PNG converter, since after the discussion on Talk:JPEG, it might be worth making a variation of the processor which replaces the font with \mathsf. — Phil alias Harry 12 Nov2006 (was unsigned, undated)

Please, let us have math notation that works on all browsers !!

I consistently see math notation that is rendered as garbage on my browser. We need to find a way that works everywhere, and enforce its use. Right now, everywhere I see such things, I always have to edit the Wikipage by changing < math > .... < / math > to < math > ... \ < / math > — Preceding unsigned comment added by 146.142.66.132 (talkcontribs) 13 Mar 2007

Bugs in relation to TeX <math>

Bug interference between TeX <math> and linking

Indeed, I wanted to write this:
[[1 E3|<math>10^{3}</math>]] or 1,000.
and expected to see this, but with a link on the exponential term:
or 1,000.
but unfortunately, the actual result is:
or 1,000.
It appears that the pipe disrupts TeX completely so as to produce "UNIQ4dea438b3445795a-math-0000000A-QINU" or similar string, not even always the identical one for an identical expression between the brackets. This occurs as well with \, or \,\! at the beginning, about halfway or at the end between the math tags. Note that the link actually does point to 1 E3 in all cases, the above is in html:
<a href="/wiki/1_E3" title="1 E3">UNIQ4dea438b3445795a-math-0000000A-QINU</a> or 1,000.
Curiously, without the pipe, a straightforward link is not attempted to be created:
[[<math>10^{3}</math>]] or 1,000.
is shown as:
[[]] or 1,000.
which is in html:
[[103]] or 1,000.
thus the brackets outside the math tags simply remain brackets, as if these were written as [[...]]
I assume it simply means that the wiki knows it cannot accept a TeX png as href destination within an anchor: <a href="(wherever)"><img src="(wherever)"></a>

Bug in mouseover preview

I had wished to use this on the top line of articles like Kilo, because the mouseover preview (if installed by the reader) on a linked article name, which renders the first part of the article, makes 103 appear as 103 (the sup tag does not work). A math notation however, is reasonably properly shown upon mouseover (apparently only if the math is not within a link), e.g. when hovering over this: 1 E+9 m³, as "between 1 and 10 cubic kilometres (10^{9} m³ to 10^{10} cubic metres).", instead of without math ridiculously as "between 1 and 10 cubic kilometres (109 to 1010 cubic metres)."
In short, I wanted to circumvent this one bug, only to find a more disturbing UNIQetc one.
There now appears to be one way to solve the problem:
[[1 E3|103]] or 1,000.
is perfectly correctly rendered and linked:
103 or 1,000.
But unfortunately (though very logically), the original goal is not attained: the mouseover preview shows this as 103 and not as 10^{3}.

SomeHuman 5 Apr2007 21:45-6 Apr2007 10:23-21:37 (UTC)

Operator names force image render

While will render as text for those who prefer to see text whenever possible, fails to produce the same result. So, no other languages of Wikipedia that use native operator names will gain much advantage from this option. ᛭ LokiClock (talk) 12:44, 5 June 2011 (UTC)

Excellent help

Thanks to the people who produced this article - much appreciated.

Daryl Williams

PNG Rendered Images Scaled/Squashed

Hey Folks,

I'm running Firefox 3.5.8 on Ubuntu Karmic and when I look at a math page with PNGs rendered from embedded tex, the PNGs are all squashed. If I view them separately, outside of the page that contains them (right click view image), the PNGs look great. But within the page, they're getting scaled just a little tiny bit and that makes them all look horrible and annoying.

UPDATE: this appears to be a result of firefox's text zoom feature. it may or may not make sense to fix the image render sizes such that they're not affected when this feature is used.

Notation for arc

In LaTeX, it's possible to write \overarc {AB} to show the notation for arc. But in Wiki, \overarc just doesn't work currently. Strange. Missing package?

On the other hand, it's luckily possible to write \overset{\frown}{AB} as an alternative. I think it worths writing it inside this Math-help page. Subscripts, superscripts, integrals subsection should be a good place to put this. Is that OK for everyone? 石庭豐 (talk) 09:38, 16 June 2011 (UTC)

I've just added it. 石庭豐 (talk) 07:37, 9 July 2011 (UTC)

Better currency symbol support needed

It'd be great if Wikipedia could allow or load packages that provide us with a means of incorporating currency symbols other than dollars and pounds. In working on an international finance article I found that I could not use any of the many workarounds spoken of across the web for inserting a euro symbol into my equation. I guess the necessary packages for those workarounds are not loaded. It's kind of frustrating, because it limits our capacity for examples and in higher level finance things can get really ugly if you have to use abbreviations and text in place of a simple symbol. Maybe there's a method I've not discovered yet, but I feel like I've exhausted all of the potential solutions I turned up via Google. Any other thoughts are welcome. John Shandy`talk 00:57, 22 June 2011 (UTC)

How about the Windows utility called "Character Map" (or equivalent thing in other O/S)? You could go to the range in Unicode for currency (cf http://unicode.org/charts/PDF/U20A0.pdf) and choose the right character, and then do a copy-n-paste.
81.64.224.95 (talk) 16:59, 26 June 2011 (UTC)
The problem is not finding a representation of the character itself for copy/paste, or finding unicode or hex representations of the character. The problem is that LaTeX does not support any of these and cannot render the euro (not just the euro, but the majority of currency symbols other than the dollar), and instead returns a failure to parse error. John Shandy`talk 17:21, 26 June 2011 (UTC)
Do you have any examples of articles where this could be used? It certainly sounds like something that would be useful, but I like probably most of the editors who use LaTeX use it for mathematics, so don't know how much of a need for it there is. It's something that would be needed to be added to the MediaWiki software, which I think takes more effort/justification as it's not just something that can be enabled on en.WP.--JohnBlackburnewordsdeeds 18:37, 26 June 2011 (UTC)
Great question. I certainly understand why it might initially seem superfluous to support more currency symbols. International finance and international economics topics would use them extensively in formula notation and examples (just for a quick example which perhaps isn't the best, see forward exchange rate). At present, the international finance articles are rather weak and largely do not meet WP's core content policies (particularly WP:NOR and WP:V) and so I've been on somewhat of a personal mission to radically rewrite many of them, clean up existing mathematical notation, and add new examples. In doing so, I've realized the lack of supported currency symbols that would make notation clearer and examples easier to follow without having to use hypothetical currencies and stand-in variables that we must then define. I think there are some currency packages that can be loaded into LaTeX that create support for things like \euro \pound \yen, or \EUR \GBP \JPY, etc. Of course, I readily understand that this would require attention from someone who administrates the backend of Wikipedia or develops for MediaWiki. Beyond international finance and economics, I wouldn't see much use, but these branches of economics are rather enormous and extremely prominent in light of globalization and trade liberalization. For now, I think we're getting by, but as Wikipedia continues evolving and these topics keep undergoing improvements, it may call for gathering people from WikiProject Finance and WikiProject Economics to come and voice a consensus that they're needed. And actually, if there's a package that supports the rendering of unicode or hex specifications, then that'd do the trick not only for currencies but for most special symbols - however, pretty much all currency symbols are included in the unicode standard to my knowledge. I haven't read through the entirety of this help article, so if there's already a way to do so then I'm simply unaware of it. John Shandy`talk 19:21, 26 June 2011 (UTC)
OK, I see what you mean. Unfortunately, even though \text{€} works for simple HTML-rendered formulae, this doesn't work for PNG rendered formulae. But is it really necessary to put the correct currency symbol? I mean, I would use A, B, C, etc to represent any currency because your formulae is not specific to only one currency, ie US dollars in your situation. Or I would use USD, EUR, JPY in subscripts if there's no way round.
Furthermore, I don't think there's any help that you ask your question here (in discussion page). IIRC, you have to file a bug (ie a wish) to Wikimedia. Otherwise, you could wait forever and nothing will be changed ;)
Oh by the way, I'm not sure currency symbols other than \euro and \yen could be found in LaTeX official symbols. At least, I'm unable to find any complete list. 石庭豐 (talk) 16:52, 29 June 2011 (UTC)
Yea, I'm thinking the best bet is actually to propose to LaTeX developers that these symbols be supported by default, then I should think that as time moves on, and people update LaTeX installations, the improvement would appear on Wikipedia without ever needing to have Wikipedia exert any effort. For the time being, we do often use stand-in variables like A, B, C, etc. They're not always intuitive or easy to follow though. Nevertheless, it's the solution used for now. I just thought I'd mention it here as a "it'd be nice if _____" kind of thing. Thanks for all the feedback though. John Shandy`talk 18:09, 29 June 2011 (UTC)

Is it possible to simplify the display of mathematical formulas? Am I in the right place?

As for the first question: It may be too pretentious to ask this, but my request is: why doesn't somebody simplify the use of Latex* in Wikipedia? The current "<maht>" seems unnecessarily time-spending. Why not the simple dollar symbol $?. Of course the impulsive adoption of such easily-typeable symbol would cause a nightmare, since many people would have trouble trying to print the actual dollar symbol. However, the time mathematicians would save seems to be quite big (in my view). I have myself had some trouble trying to understand Wikipedia's system (but I concede that this may be my fault). Anyway, I think the number of bothered users is huge. This ultimately must lead to distortion of the proper mathematical style, causing the suppression of formulas for the sometimes more cumbersome verbal explanations. In conclusion, I ask the possibility of use the sign $ as a simple access to Latex in the mathematics portal.

As for the second question: I still do not see clearly whom I should contact. Bugzilla? I this classified as a "problem with the software"?

Thank you for the attention!

One can also use {{math}}. The reason { and < are used as symbols is exactly to avoid characters that people will use often. Not only will people find it cumbersome to type the dollar sign, but they will be confused - that $ should delimit code is an unexpected behavior outside of a programming language. It also adds complexity to the already inelegant coexistence of HTML, templates, and Wiki code (as in the link/image syntax). ᛭ LokiClock (talk) 21:31, 7 July 2011 (UTC)
  • A possible walkaround to type this faster is text expansion such as autohotkeys http://www.autohotkey.com/ for Windows. With it you can type for example mth; (or whatever you define) and you get mathmath (or whatever you define) and the cursor goes to the middle. The readability of the resulting code is still bad though.Ciro.santilli (talk) 08:37, 24 January 2012 (UTC)

Found bug

Please help. I found bug that the math tag cannot render x^{2^k-1} : . (It occurs on x^{2^k} too.) This should be used in Exponentiation by squaring. I do not rely on HTML because some browsers cannot render double superscript. --Octra Bond (talk) 18:59, 26 July 2011 (UTC)

They render for me. What's your platform (browser, OS)? ᛭ LokiClock (talk) 02:54, 27 July 2011 (UTC)
Nevermind. I just see it renders at the moment. (Previously, it showed unexpected error.) --Octra Bond (talk) 06:49, 27 July 2011 (UTC)
Okay. Well if you see it again, see if you can't keep it that way until you isolate it. ᛭ LokiClock (talk) 06:18, 29 July 2011 (UTC)

Something like \begin{cases} but for bracket on right-hand side?

Currently, to make a grouping brackets like in the example below:

we have to use two different syntaxes!

For the left grouping bracket (shown on the right hand side of the example above), we just need to use the predefined \begin{cases} .... \end{cases} syntax. However, for the right grouping bracket, we have to use a matrix embedded inside non-matching bracket: \left . \begin{matrix} ... \end{matrix} \right\}

Syntax difference is not the big problem. The big problem is that the rendered brackets are not symmetrical and that looks really ugly. Of course, we could use the embedded matrix inside non-matching bracket trick instead of \begin{cases} but this seems quite silly not to use the predefined syntax.

So, is there anything like \begin{cases} but produces right bracket? 石庭豐 (talk) 16:33, 2 August 2011 (UTC)

Bug with \sim

In non-PNG rendering, \sim is rendered as ~ or ∼ depending on whether it is preceded by a blank space (or a letter) or not.

  • <math>\sim</math> gives
  • <math> \sim</math> gives

There's an even blatant case but it seems to happen only in Chinese Wikipedia: <math>A/\sim</math> and <math>A/ \sim</math> gives different results. 石庭豐 (talk) 11:40, 4 August 2011 (UTC)

SVG Equations using Inkscape

There is a fairly simple but lengthly way to render latex equations as SVG.

0. If you don't already have inkscape, a simple but effective well-known vector graphics editor for SVG images, it can be downloaded here: http://inkscape.org/. This program is needed for the method.

1. Go to the site (codecogs LaTeX equation editor) at http://www.codecogs.com/latex/eqneditor.php

2. Create equation - either type or use the symbolic templates

3. Set the following parameters (below the editor window);
A. image render = SVG,
B. leave font = sans serif.
C. choose font size carefully; the size that fits best between the usual equation font size on wikipedia (for forced latex png rendering - not html) and when using the \scriptstyle{} function to make the equation appear smaller, is about 10pt[normal] (as close as it gets...). NOTE: the equation will appear in exactly these sizes when all this is complete, so it's easier to set the correct font size now and not worry later. When I have tried changing the size aspect ratio using the command upright=??px (or others simalar to this), it wouldn't work - the image was not re-sized. An alternative and probably quicker way is to type a short collection of letters in the required size and scale the equation image to match.
D. Set any other desired options.

4. At this editor, the image will not appear when rendering is set to SVG [it will for most other formats like png, gif, emf (emf cannot be uploaded onto wikimedia commmons) but the needed one is SVG]. Don't panic, just click on download.

5. There are a couple of routes to take afer clicking download:
A. easier - click open, then save as (not just save) the required file name in an easy-to-access useful directory ect.
B. longer - click save to save it ect, then re-save as some other name in a easy-to-access useful directory ect.

In either case save the file type as plain SVG, NOT just inkscape SVG, otherwise it doesn't work.

6. Upload via wikimedia commons, at http://commons.wikimedia.org/wiki/Special:UploadWizard. Then link the image to the location. At the end of uploading, two links should appear, one for hmtl linking, one for wiki-linking. For the wiki-link syntax eliminate thumb (to eliminate the border and caption - unless wanted), to the required position left, right, centre etc, just change the image parameters to whatever is needed, then that should be it.

Hopefully this helps, this seems to be a long explaination but it is really simple if you can do it.

Here are samples I created, the equation is Ampere's law + Maxwell's correction (one of maxwell's equations of electromagnetism).

SVG Image, eliminate thumb
File:SVG energy formulae2.svg
Normal forced latex png rendering:
Normal forced latex png rendering with scriptstyle:
File:SVG energy formulae2.svg
keep thumb


Yours, Maschen (talk) 20:33, 11 August 2011 (UTC)

You may want to check out this script. Nageh (talk) 21:33, 11 August 2011 (UTC)

A thank you note

A sincere thanks to all who contributed to this page. Makes one's editing life easier. Thank you. Ineuw talk page on English Wikisource 17:29, 25 August 2011 (UTC)

Guideline needed for punctuation on a line with an isolated formula

I note that punctuation is frequently included inside the <math> tags when a formula forms part of a sentence, but is displayed on its own line. Example:

Here the comma is included:

whereas here the period is excluded:

.

Inclusion of the punctuation is semantically incorrect, but I guess people do it this way because the font size and placement of the punctuation (usually a trailing comma or period) is then less jarring. As the semantic content of a TeX formula seems to be emphasized in these guidelines, could we develop a guideline for this punctuation that respects appropriate the semantic content? I would prefer a guideline in which no punctuation appears on the same line as a formula that has been isolated to its own line, even at the expense of dropping the punctuation. Such a guideline should also extend to presentation of more than one mathematical statement on one line, e.g. by use of space only or appropriate mathematical connectives. Quondum (talk) 05:34, 6 October 2011 (UTC)

Ouch. I take that back. There is such a guideline: WP:MOSMATH#PUNC. It isn't my preference, but I respect the guidelines above individual preferences... Quondum (talk) 16:04, 6 October 2011 (UTC)

Clickable Symbols Please

Wouldn't it be great if symbols could link to their article (e.g. ) It's just that, being neither clickable nor copyable it's hard to look up a symbol one doesn't understand.Trideceth12 (talk) 09:20, 26 October 2011 (UTC)

Your link is clickable (just click on the "∈" above that you supplied: it takes you top the appropriate article). The only problem is that its clickability is invisible (until you hover the mouse over it, there's nothing to indicate that it is clickable). I suspect you will not get much response here; perhaps try Wikipedia:Help_desk. Quondum (talk) 09:53, 26 October 2011 (UTC)
You need to point out a specific article where you'd want this to be the case. Because there is no point in making mathematical symbols generally clickable, especially when it comes to such elementary symbols already taught in school. Nageh (talk) 10:40, 26 October 2011 (UTC)
I think this a bad idea for a number of reasons. First such symbols are often small so the link may be difficult to notice. Second the underlining (a user option) might make them look like something else: ⊂ might look like ⊆for example. Third if the symbol is created using <math> tags it might sometimes be text, sometimes an image, again depending on user settings. Fourth if a symbol is part of a formula it might be unclear if the link is for the symbol or for the whole formula or expression. So better if you mean to link a symbol to give it's name nearby and link that, e.g. "∈ (element)". If that can't be done because the symbol is part of some more complex expression then do it separately immediately before or after.--JohnBlackburnewordsdeeds 13:07, 26 October 2011 (UTC)

Help with line breaking, please

I tried to add line breaks to the article of differential diagnosis, but the result was that the formulas failed to parse [1]. Does anyone know how to do it right? Mikael Häggström (talk) 15:58, 29 October 2011 (UTC)

Here's one way, with the first of your equations. Note the \begin{align}, \end{align} and the two ampersands which tell it where to line up
--JohnBlackburnewordsdeeds 16:13, 29 October 2011 (UTC)
Thanks a lot! Mikael Häggström (talk) 05:19, 30 October 2011 (UTC)

NON-IMPLEMENTED INTEGRALS \oiint + \oiiint

Hello. I have a workaround to propose for creating integrals requiring \oiint and \oiiint.

  • Use these image (without the thumbnails), without chainging the size, in front of a the integrand expression.
  • In the actual LaTeX syntax, type {\frac{}{}}_{REGION} at the very start, in which REGION can be replaced by any symbol representing the closed surface or volume of the region in question.

Here are some random examples where it might be used (if in the situation these are applied to, a closed volume is needed):

  • No clue:
"32px"
"28px"
"28px" + "28px"

Just a suggestion.

--F=q(E+v^B) (talk) 14:02, 12 December 2011 (UTC)

I'd say, be bold and add it as another solution to the article. It is certainly no worse than the current suggested workaround. Actually, for a better solution you should create templates for these, i.e., put the image into {{oiint}} or {{oiiint}}, such that they can be easily found and replaced at later times.
Note that if you want other opinions, your best chance is to ask at the WikiProject Mathematics. Nageh (talk) 20:23, 12 December 2011 (UTC)
Of course, will do. Thanks very much for your advice too. I never thought about templates - so obvious as well! --F=q(E+v^B) (talk) 20:36, 12 December 2011 (UTC)
Much too complicated your solution! And the problem you see with multiple use of the template is because you are trying to stuff the image into a table. Have a look at {{oiint/sandbox}} for a very simple and flexible solution.
PS: You misunderstood what Enforcing PNG/JPEG-images? is about. You really should move your text to the \oiint and \oiiint section. And please make your text less wordy. :) Nageh (talk) 10:34, 13 December 2011 (UTC)

Ok. The entry will be made less wordy, though I can't see why it can't be in the current section given that the solution deploys the mathod of using PNG/JPEG images. It doesn't matter - it'll be moved. I'll have a look at this template solution you provided. Thanks -F=q(E+v^B) (talk) 13:09, 13 December 2011 (UTC)

Nageh: In the solutions you provide, you have basically repeated what I have done. I did try to nest templates in exactly the same way as you have, but it didn't work so the template {{Oiint+Oiiint}} is what it is now, though it can only be a mistake on my part. I'll try nesting templates again simalar to how you have done.--F=q(E+v^B) (talk) 13:38, 13 December 2011 (UTC)
On second thought mabey there is something you have done that I have not. How have you made the 3rd template work (nested)? I tried replacing the template {{oiint/sandbox|... with \oiint </math> which gives . Supscripts, superscripts, \overset, \underset also put the text in a smaller size.--Salix alba (talk): 15:07, 28 March 2014 (UTC)
Thanks! --Edgars2007 (talk/contribs) 15:19, 31 March 2014 (UTC)