Help talk:Displaying a formula
| WikiProject Help | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||
[edit] 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)
[edit] 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 > — 146.142.66.132 13 Mar2007 (was unsigned, undated)
[edit] Bugs in relation to TeX <math>
[edit] 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:
- 103 or 1,000.
- but unfortunately, the actual result is:
- 103 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.
[edit] Bug or undocumented handling of links
- Curiously, without the pipe, a straightforward link is not attempted to be created:
- [[<math>10^{3}</math>]] or 1,000.
- is shown as:
- [[103]] 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>
[edit] 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)
[edit] Operator names force image render
While gcd 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)
[edit] Excellent help
Thanks to the people who produced this article - much appreciated.
Daryl Williams
[edit] Formulas as SVG?
Are there any plans to make formulas render as SVG, rather than PNG? 131.107.0.80 (talk) 00:06, 3 November 2009 (UTC)
Or better : Are there any plans to move to jsMath ? Bunder (talk) 19:30, 17 February 2010 (UTC)
Even better: MathJax, the successor of jsMath. Writing a plugin to support it should be trivial. For DokuWiki, such a plugin exists and is maintained by the author of this comment. Is anyone interested to collaborate with me on implementing jsMath and MathJax support for wikipedia? Where are such issues discussed? ylloh (talk) 00:28, 16 March 2010 (UTC)
- This looks very promising! In fact, I was playing around a bit in making a quick and dirty port to wiki. If anybody is curious, you can plug the importScript('User:Nageh/mathJax.js'); line into your local layout script file (monobook.js, vector.js, ...). Also, you need to set math rendering to "Leave it as TeX" in your preferences. And you need the required TeX fonts from the MathJax homepage in your computer's font directory. It's an incomplete port, and in fact also MathJax has rather incomplete TeX support for now, but it's nice for a preview. Hope we can have real support for this some day! Nageh (talk) 20:32, 5 April 2010 (UTC)
- Great! This is a very elegant solution! It looks really nice already, but I am going to test it thoroughly. ylloh (talk) 10:37, 8 April 2010 (UTC)
- 1.0 of MathJax is now out ! It might be the time to include it in wikipedia Xmlizer (talk) 06:01, 5 August 2010 (UTC)
- It is over time. I am waiting for months now to get the wmf branch of wikimedia updated, but it never happens. Without the relevant bugs fixed, it does not make sense to use above MathJax plugin. I'll keep you updated. Nageh (talk) 09:01, 5 August 2010 (UTC)
- Good news! Thanks to a MediaWiki developer I could convince in updating the WMF branch we finally have some workable inline LaTeX support on Wikipedia! (Though still in some kind of beta phase.) Instructions for testing as above. Have fun! Nageh (talk) 17:59, 6 November 2010 (UTC)
- It is really working now! but with lots of problems. It hasn't implemented all LaTeX features as supported by Texvc now. Besides, it is not fully compatible with the special situation of Wikipedia. It cannot distinguish the display math from inline math for Texvc distinguishes them by a colon. And Mathjax won't load in preview. Still a long way to go before it can be deployed on Wikipedia. But thanks anyway.--Netheril96 (talk) 01:51, 7 November 2010 (UTC)
- Hey, thanks for testing! Yeah, MathJax doesn't support the complete set of texvc commands, which even allows HTML in addition to AMS! But most pages render just fine. I've fixed another bug and included custom macros for the popular \infin and \bold parameters, and all the articles referenced on your user page display fine as well now!
- Regarding your statements that MathJax is not fully compatible with the special situation of Wikipedia, I do not understand exactly what you mean. For example, while MathJax can it is MediaWiki's fault that we cannot distinguish between inline math and display math! (If really desirable it could be possible to implement it as a hack, such as when there is an empty line before and after the math statement.) Hm, why do you say that MathJax won't load in preview? It works for me.
- Just should out on my talk page if you'd like something specific to be supported and I'll see what I can do. Nageh (talk) 11:16, 7 November 2010 (UTC)
- It is really working now! but with lots of problems. It hasn't implemented all LaTeX features as supported by Texvc now. Besides, it is not fully compatible with the special situation of Wikipedia. It cannot distinguish the display math from inline math for Texvc distinguishes them by a colon. And Mathjax won't load in preview. Still a long way to go before it can be deployed on Wikipedia. But thanks anyway.--Netheril96 (talk) 01:51, 7 November 2010 (UTC)
- Good news! Thanks to a MediaWiki developer I could convince in updating the WMF branch we finally have some workable inline LaTeX support on Wikipedia! (Though still in some kind of beta phase.) Instructions for testing as above. Have fun! Nageh (talk) 17:59, 6 November 2010 (UTC)
- It is over time. I am waiting for months now to get the wmf branch of wikimedia updated, but it never happens. Without the relevant bugs fixed, it does not make sense to use above MathJax plugin. I'll keep you updated. Nageh (talk) 09:01, 5 August 2010 (UTC)
- 1.0 of MathJax is now out ! It might be the time to include it in wikipedia Xmlizer (talk) 06:01, 5 August 2010 (UTC)
-
-
-
-
-
- I have come across an inofficial list of texvc commands. Turns out most of them are just alternate spellings of existing LaTeX/AMS commands.
I have included almost all of them now; what is missing from the list are \subsetneq, \supsetneq, \textvisiblespace, and \weierp. Nageh (talk) 14:20, 7 November 2010 (UTC)All of them should be supported now. Let me know if you come across a command not supported by this plugin. - What needs to be done now is add better font support. But for the moment it will do. Nageh (talk) 14:37, 7 November 2010 (UTC)
- It does not seem to support the optional argument of \\, see WP:RDMA#Calculus.—Emil J. 19:30, 1 December 2010 (UTC)
- \color does not work:
only colors the "a", and
does not render at all.—Emil J. 17:53, 13 January 2011 (UTC)
- I have come across an inofficial list of texvc commands. Turns out most of them are just alternate spellings of existing LaTeX/AMS commands.
-
-
-
-
I've just been looking at this, seeing how it works. I like it, but find it's too slow for everyday use, at least with my setup (Safari, OSX). But I've just found some TeX it does not understand, at Bivector#Projective geometry. It looks like the problems with the logical operators, \or and \and, and looking at Help:Displaying a formula they seem to be synonyms for \vee and \wedge which are probably more appropriate anyway (wedge is used elsewhere in the article).--JohnBlackburnewordsdeeds 15:03, 7 November 2010 (UTC)
- I think you still have the old script versions cached. Try forcing a reload bypassing the cache (Shift-Ctrl-R in Mozilla, don't know for Safari).
- Yeah, it's a bit slow on maths heavy pages. The MathJax developers have packed their scripts somehow, I'll need to confer with them to see what can be done to improve the speed. Nageh (talk) 15:28, 7 November 2010 (UTC)
- I tried reloading (not normally needed with Safari, it usually picks up changes right away) and it made no difference. I'm including it like so:
importScript('User:Nageh/mathJax.js');
-
- Is there any way to check which version I'm using?--JohnBlackburnewordsdeeds 15:58, 7 November 2010 (UTC)
- The problem is that dynamically loaded subscripts are not affected by a page reload. Try opening this page and force a reload there (you may search for textvisiblespace to make sure it's the latest version), then try again. Sorry, no other way for checking the version. Nageh (talk) 16:09, 7 November 2010 (UTC)
- Still not working even after trying the above, and we've already done much than should be needed. Meanwhile I've noticed a rendering issue in another article, at Maxwell's equations#Table of 'in vacuum' equations: this rather odd formatting
- The problem is that dynamically loaded subscripts are not affected by a page reload. Try opening this page and force a reload there (you may search for textvisiblespace to make sure it's the latest version), then try again. Sorry, no other way for checking the version. Nageh (talk) 16:09, 7 November 2010 (UTC)
- Is there any way to check which version I'm using?--JohnBlackburnewordsdeeds 15:58, 7 November 2010 (UTC)
-
-
- is meant to be a loop over a double integral, but the loop is offset with MathJax enabled. The TeX is pretty odd though.--JohnBlackburnewordsdeeds 16:41, 7 November 2010 (UTC)
- I always have to manually reload the script files when I edit them because the old ones keep staying in the cache otherwise. Maybe it's yet another file cached on your setup, as there is everything rightly displayed on my computer for the one page you gave.
- Regarding Maxwell's equations#Table of 'in vacuum' equations, that's actually due to a bug in MediaWiki. See here. Nageh (talk) 17:19, 7 November 2010 (UTC)
- is meant to be a loop over a double integral, but the loop is offset with MathJax enabled. The TeX is pretty odd though.--JohnBlackburnewordsdeeds 16:41, 7 November 2010 (UTC)
-
-
=> There has been some interest on using MathJax by using user JavaScript. I have just put an extension up with MathJax support: Extension:MathJax. This extension is of course installed on the server and so all fonts are there as well. The extension does a little bit more than just render math tags by MathJax:
- it allows you to use the usual TeX math environments ($...$ and $$...$$) for writing math,
- as MathJax supports the
\tag{}construct, you can number formulas in the usual way (i.e., towards the right margin), - Extension:MathJax implements automatic numbering of formulas using
\label{}and lets you reference them by the usual\eqref{}macro.
If any body is interested in improving this code: please contact me! Dirk Nuyens (talk) 21:18, 15 November 2010 (UTC)
- So awesome, but when will Wikipedia install this extension?--Netheril96 (talk) 05:51, 16 November 2010 (UTC)
- That is the reason why I started this user extension. For what it's worth, Dirk has inspired me how to support display math as well, which I just implemented. Of course everything else is supported as well. I really don't care whether MathJax is supported officially (so I scrap my code) or not (so I can contribute if necessary), but it is worth having some way or the other to use MathJax. And the MathJax devs are constantly looking to improve the speed. Nageh (talk) 07:51, 16 November 2010 (UTC)
- Nice work!! But still Mathjax won't load in my preview. WikEd is active.--Netheril96 (talk) 12:39, 16 November 2010 (UTC)
- Ah, now I understand which preview you mean! Your problem is not so easy to solve because MathJax doesn't know that another script has dynamically added new elements into the DOM, so there is no typesetting. The problem is that standard event HTML handling does not support notifications that would be required. I'd have to look into DOM level 2 event handling, but this is rather new and not really cross-browser compatible (thanks to IE). Anyway, this will take some time, so for the moment this doesn't work. Btw, it will also not work with a Wikipedia supported extension unless specific support is added. Nageh (talk) 19:31, 19 November 2010 (UTC)
- Maybe it is not too difficult to solve. For example, the ajaxPreview script has an workaround to this problem as explained in this section of it's documentation. Maybe something similar could be made with WikEd. Helder 23:26, 22 November 2010 (UTC)
- Nice work!! But still Mathjax won't load in my preview. WikEd is active.--Netheril96 (talk) 12:39, 16 November 2010 (UTC)
- That is the reason why I started this user extension. For what it's worth, Dirk has inspired me how to support display math as well, which I just implemented. Of course everything else is supported as well. I really don't care whether MathJax is supported officially (so I scrap my code) or not (so I can contribute if necessary), but it is worth having some way or the other to use MathJax. And the MathJax devs are constantly looking to improve the speed. Nageh (talk) 07:51, 16 November 2010 (UTC)
-
-
-
- Now it is probably me who is missing something, but I'm also using WikEd, and MathJax works in preview just fine.—Emil J. 11:06, 23 November 2010 (UTC)
-
-
For those interested, I have updated MathJax to version 1.1. At the same time the frontend was updated and should now be working with wikEd and ajaxPreview. Other changes include suppression of loading on pages without maths and combined script files for faster loading. Mainly due to MathJax 1.1 maths rendering is a lot faster now. Instructions here, feedback there. Thanks, and cheers, Nageh (talk) 23:15, 20 March 2011 (UTC)
[edit] 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.
[edit] Basic LaTeX syntax
This article is more of a reference for those who occasionally forget a particular symbol than a introduction of LaTeX formula writing. I think we should dedicate a section to the basic understanding of LaTeX pertinent to math formulas. --Netheril96 (talk) 09:56, 25 March 2011 (UTC)
[edit] 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)
[edit] 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)
- 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)
-
-
-
- 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)
-
-
[edit] 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!
- Actually, I don't know whether I am talking about "Latex" or "Tex" (I don't understand much of computers). — Preceding unsigned comment added by 201.25.245.49 (talk) 20:41, 7 July 2011 (UTC)
- 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)
[edit] 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)
[edit] 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)
[edit] 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)
[edit] 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 | |
| Normal forced latex png rendering: |
![]() |
| Normal forced latex png rendering with scriptstyle: |
![]() |
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)
[edit] 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)
[edit] 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)
[edit] 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)
[edit] 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)
- Thanks a lot!
[edit] 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:
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|... and that didn't function. I read the contents of Help:Template#Nesting templates and still don't understand what i'm doing wrong... If this nesting feature can be resolved then any number of these integrals can be linked by nesting them.--F=q(E+v^B) (talk) 14:10, 13 December 2011 (UTC)
-
-
- Huh? Use the source, [Luke]. As I said above, your template defines a table, which – as defined in the template – cannot be nested. There is really no need for a table, just take the [File:] link. Copy the sandbox template's source over to the main template, adapt it for oiiint, and you can get rid of oiint+oiiint. Nageh (talk) 14:57, 13 December 2011 (UTC)
-
Sorry, my fault, what was I thinking... now I know what you mean by a table defined in the template. (Admittedly I didn't properly understand how to create template pages so I looked at an example and typed a simalar wiki markup. It resulted in the inclusion of table formatting). It tried them out and they work splendidly - thanks to you again. As far as I can tell no additional features are required. The link {{Oiint+Oiiint}} in the article will be removed and the template itself can be nominated for deletion.--F=q(E+v^B) (talk) 17:28, 13 December 2011 (UTC)
- The template {{Oiint+Oiiint}} has been deleted a few minuites ago (at 17:36). Excellent!--F=q(E+v^B) (talk) 17:43, 13 December 2011 (UTC)
You beat me. I was just in the process of doing that. Anyway thanks for your help too!--F=q(E+v^B) (talk) 19:18, 13 December 2011 (UTC)
- I've created separate documentation pages for both of them so I could add categories, for future interwiki links etc. I noticed while doing so the alignment is a bit off: text to the right of all the oiiint examples is misaligned at least in part. The problem is the subscripted fraction
. The TeX renderer positions it correctly but when rendering uses a bounding box around only the things that are visible. The top of the fraction is ignored. So the 'S', or the 'S' and the other text, gets centred. I don't even know if it's possible to work around this. One fix would be to integrate the subscript into the integral, as \oint_C does, which would also deal with the more subtle horizontal alignment problems. This would clearly work but I don't know how many images and templates it would require.
- And one other thing: the images really should be SVGs. This will mean they scale well to all sizes: right now it looks like they've been prescaled so are effectively fixed size. I'm not volunteering though as I've no experience of creating curves in e.g. Inkscape.--JohnBlackburnewordsdeeds 22:03, 13 December 2011 (UTC)
-
- Since TeX renders the surrounding PNGs as fixed size, I thought these images should do the same. There is no change that will ever change size. I even turned anti-aliasing down a bit as not to fall out of tone with the rest of the nice jagged-edge formula. :) — Edokter (talk) — 22:55, 13 December 2011 (UTC)
-
-
- Well... In fact, one functionality that I see still missing is the support for different font sizes using the TeX \xxxstyle commands (e.g., using a style parameter in the template). For this, it would be convenient if the images could be flawlessly scaled. Alternatively, of course, you could upload all the different PNG images. Nageh (talk) 23:01, 13 December 2011 (UTC)
-
- (←) I'll see what I can do. Does MathJax not support \oiint and \oiiint either? Or does it still depend on TeX? — Edokter (talk) — 12:23, 14 December 2011 (UTC)
Excellent. Also:
- Thanks to JohnBlackburne for creating the documentation.
and probably:
There is no easy way to incorperate the symbol for the region into the integral image so that the user can choose any letter. Only one fixed symbol can be used if in the image itself. How could a variable character be incorperated using templates? Tables are out of the question. There is no way to type LaTeX into a template without typing the <math></math> code and positioning the symbol to exactly at the base of the integral (I'm not sure if it can even be done with LaTeX on wiki, if it can it would still be hard), by this I mean setting up all the maths syntax such that the user can enter the letter and its passed to the template, then output as LaTeX...Others have reccomended PNG and not SVG here. SVG has its obvious benefits over any other format but PNG matches with the LaTeX rendering.
Thanks to everyone who has assisted with this. I feel like such a jerk not doing any of these things myself.....
P.S. I typed the div. theorem wrong - this is a case where no circle should be on the volume integral, since the volume would have to close on itself (into the 4th dimension...). All thats needed is to integrate in each coord direction.
-- F = q(E + v × B) 22:53, 13 December 2011 (UTC)
- There is no easy way to incorperate the symbol...' You do read what I write, right? It's fixed, it's working now using CSS trickery. Nageh (talk) 22:58, 13 December 2011 (UTC)
I wrote that before you posted your recent comment, and blindly missed it then pasted it. I'll leave it for others to comment on this. And yes I do read what you write. Its worth it.-- F = q(E + v × B)
- Ok, never mind, it was just a moment of sigh. :) Also, don't mind about us doing all that recent work, this is how Wikipedia works! :) Nageh (talk) 23:07, 13 December 2011 (UTC)
- Don't underestimate the power of template coding :) Perhaps it is easy to incorporate the {\dfrac{}{}}_{region} part; you can shift any image—even TeX-generated ones—to any position in the template. Question is: how flexible is the region part? How many symbold can be theoretically included? — Edokter (talk) — 23:05, 13 December 2011 (UTC)
- I've tried fixing the subscript problem myself, with an additional parameter and so changes to the integrand one which seems to work, but all examples and any uses would need updating. It's at Template:Oiint/sandbox, the middle example in particular.--JohnBlackburnewordsdeeds 23:22, 13 December 2011 (UTC)
- I've gone ahead and updated them with the additional parameter, and updated the documentation of each to match, at the sametime rewriting them for clarity and to add some headings.--JohnBlackburnewordsdeeds 07:59, 17 December 2011 (UTC)
I thought it was a mismatch with MathJax font sizes but now I noticed that also in the PNG rendering the \oiint and \oiiint PNG images are slightly larger than their \int and \oint counterparts. Can these images be adjusted? Thanks. Nageh (talk) 10:57, 17 December 2011 (UTC)
[edit] "black on white (not transparent)" ?
This is from the start of the section Rendering:
-
- By default, the PNG images are black on white (not transparent)...
Surely it's the other way round, e.g. the background is transparent by default?--JohnBlackburnewordsdeeds 08:11, 17 December 2011 (UTC)
- My guess is that it is somewhere in between: a few pixels around the foreground (a sort of a shadow?) are not transparent, but most of the background is. This is most obvious when putting a formula onto a background coloured via HTML. When setting the background colour of the PNG, only these "shadow" pixels seem to be affected. The effect is not a very nice. — Quondumtc 09:35, 17 December 2011 (UTC)
-
- I was editing Template:Oiint earlier which has a green-tinted documentation section with math formulae and none have any white border, they just look like black on green. I don't know if the behaviour is different if you set the background of the PNG using LaTeX but I've never seen this used.--JohnBlackburnewordsdeeds 09:56, 17 December 2011 (UTC)
-
-
-
- You're probably right about the change. However, take a look at the following (best is if you zoom in with your browser):
-
-
![]() |
![]() |
![]() |
![]() |
![]() |
-
-
-
- The first and the last are clean colour transitions. The middle three have margins of red, white and red respectively. This does not seem to be happening on the green-tinted section mentioned; perhaps the PNG gets its background colour preset there? — Quondumtc 11:18, 17 December 2011 (UTC)
- OK, looking again at the examples at {{oiint}} and it's happening there: if I click and drag one of the PNGs over my darker desktop I can see some white fringing around the image. But it's still impossible to see it on the page even though I know it's there; the colour, #ECFCF4 according to my browser, is too close to white for it to be noticeable. As that's as dark as WP pages get it's effectively transparent, definitely not white as the statement suggests.--JohnBlackburnewordsdeeds 11:37, 17 December 2011 (UTC)
- The first and the last are clean colour transitions. The middle three have margins of red, white and red respectively. This does not seem to be happening on the green-tinted section mentioned; perhaps the PNG gets its background colour preset there? — Quondumtc 11:18, 17 December 2011 (UTC)
-
-
only colors the "a", and
does not render at all.—



.


+
. The TeX renderer positions it correctly but when rendering uses a bounding box around only the things that are visible. The top of the fraction is ignored. So the 'S', or the 'S' and the other text, gets centred. I don't even know if it's possible to work around this. One fix would be to integrate the subscript into the integral, as \oint_C does, which would also deal with the more subtle horizontal alignment problems. This would clearly work but I don't know how many images and templates it would require.
and scriptstyle
. I could add images for scriptstyle.
. Three different sizes, effectively. 

