Help talk:Displaying a formula/Archives/2005

From Meta, a Wikimedia project coordination wiki

Request: Higher quality math font

My website is math-intensive, and I'd like to upgrade my font to a higher quality one with super smooth integrals. Even Green's formula looks bad with this font.

http://www.exampleproblems.com/wiki/index.php?title=PDE8

-Thanks -Todd Smith

What don't you like about it? - Omegatron 17:49, 24 Jan 2005 (UTC)


Well, here's the best scan I could get for a comparison:

http://www.exampleproblems.com/wiki/index.php?title=Talk:PDE9

But I can imagine even sharper, smoother images for each symbol.

-Todd

I think the font is pretty nice, except . What does "mbox" mean, anyway?- Omegatron 21:54, 26 Feb 2005 (UTC)


How would I be able to produce the Å in mathematical formula's ?

I need to reproduce the Å symbol in a math formula, I believ that in TeX it is \AA, how is it done in <math></math> tags? --Riaan 12:56, 18 Mar 2005 (UTC)

We probably don't have that symbol.
Yeah. We didn't have \propto for a while, either. I don't know why. You can complain about it. - Omegatron 15:43, 18 Mar 2005 (UTC)
Tried the following, but none are really satisfactory:
<math>\dot \mathrm{A}\!\,</math> gives
<math>\mathrm{A}\!^\circ\!\,</math> gives
<math>\mathrm{A}\!\!^\circ + b\!\,</math> gives
<math>\mathrm{A}\!\!\!^\circ + b\!\,</math> gives
Urhixidur 13:12, 2005 Mar 24 (UTC)
Thanks. Who should I contact regarding this?
--Riaan 10:13, 26 Mar 2005 (UTC)
Logging this under MediaZilla --Riaan 10:17, 26 Mar 2005 (UTC)
Looks like it exists now, but the ring is off-center. <math>\AA</math>: . maybe <math>\mathrm{\AA}</math>: ? - Omegatron 15:21, 3 Jun 2005 (UTC)
Hm... <math>\mbox{Å}</math> works on sv: (see this, where small 'å' is used in an \mbox. It doesn't seem to work here, however... \Mike(z) 22:05, 3 Jun 2005 (UTC)
Now it doesn't work on sv: either. \Mike(z) 13:53, 25 July 2005 (UTC)

This problem is old (formula engine not rendering non-standard characters, albeit they exist in the font), and it has been pending for ages. Ramir 06:23, 23 March 2006 (UTC)

Strike inside TeX

Are there any way to add strikes (<s></s>) inside a TeX markups? I'm trying to explain reducing in fractions. -- WB 08:33, 21 Mar 2005 (UTC)

If not, you might be able to kludge something with negative spaces?
If it was supported, it would look like this?
Failed to parse (unknown function "\strikeout"): {\displaystyle \strikeout {foo}}
Failed to parse (unknown function "\sout"): {\displaystyle \sout {foo}}
Failed to parse (unknown function "\xout"): {\displaystyle \xout {foo}}
- Omegatron 14:41, Mar 21, 2005 (UTC)

Strikethroughs would also be welcome for en:Units conversion by factor-label. Superm401 | Talk 02:56, 15 December 2007 (UTC)

Dotless j

Is this suppored by Wikipedia as I think it is a part of Latex (not that for the life of me I can remember what the hell the code for it is)...

The reason I want it is as looks a bit weird as its normal for j to lose its dot when something else goes on top.

Thanks for any help. --84.13.215.133 19:04, 25 Mar 2005 (UTC)

\imath gives
and
\jmath gives
So you can use
\vec \imath which gives
but not
\vec \jmath which gives
Looks like it lacks of DOTLESS J
Xmlizer 13:14, 2 Apr 2005 (UTC)
That's right, \jmath is a valid TeX command but it's not supported here for some reason. PizzaMargherita 13:14, 19 November 2005 (UTC)

Inequalities?

Is it possible to render the "is not equal to" sign, in TeX markup? I'm not even sure how to make it in HTML... Phoenix-forgotten 23:37, 21 May 2005 (UTC)

. Done by <math>a \neq b</math> \Mike(z) 12:53, 3 Jun 2005 (UTC)

Why do standard HTML characters force PNG ?

I wonder why people did not (yet) add symbols like \in (∈), \infty (∞),... to the list of things that can be easily translated to HTML.

Also, I wonder why so much effort is made in truncating some TeX capacities, e.g. the \limits directive (to put something under a \mathop{=}, e.g.) or \textstyle etc. 194.199.97.94 17:01, 24 May 2005 (UTC)

I prefer writing inline formulae with <math> tags instead of doing it by hand for various reasons (see Help:Formula#TeX_vs_HTML). It is very tiresome that some very simple TeX symbols are not translated into HTML, such as \dots, \cdots, \dot and similar symbols. Is there any chance this might be fixed? Can I help in some way? Klem fra Nils Grimsmo 21:53, 14 December 2006 (UTC)
I agree those characters should be translated into the HTML character references. --70.131.218.104 01:29, 31 December 2006 (UTC)
My settings are "Recommended for modern browsers" which I assume means "has Unicode font support", or else I would choose "HTML if very simple or else PNG". I just wanted to clarify that I understand that not all people have Unicode fonts. --70.131.218.104 06:38, 5 February 2007 (UTC)

Arrows for chemical equations

I wonder if Tex has arrows for chemical equilibrum equations? That is:

----->          ----->            -->
 <--            <-----          <------

Longer arrow to the right

Equally long arrows to both directions
Longer arrow to the left?

--Samulili 20:29, 31 May 2005 (UTC)

You really need \stackrel (not supported), but try this as a starting point:

It's horrible, I know. I'm sure there are dedicated LaTeX packages out there, presumably not supported at present. Have a look at ppchtex. PizzaMargherita 13:52, 20 November 2005 (UTC)

Sorry

I accidentally changed the page - should be back to normal. Sorry

xypic

can we expect xypic support anytime soon? would be awfully nice. ---bgohla

I second this request. Actually, anything that supports commutative diagrams would be awesome. Who are the right people to be asking (read: hassling) about this? Dmharvey 24.60.52.22 10:32, 30 Jun 2005 (UTC)
You need support for package amscd. Alternatively, you may be able to manage with matrix and \stackrel (not supported) and stuff. For feature requests, see Help:Formula#Bug_reports. PizzaMargherita 13:11, 20 November 2005 (UTC)

Maynard Handley's suggestions

Moved here from Help:Formula. -- Jitse Niesen 13:51, 4 August 2005 (UTC)

HOW TO MAKE TRANSPARENT PNGs

(MediaWiki developers. You should roll this into the released versions ASAP. It works and it is easy.)
In the file render.ml in the wiki/math directory, change the third line to

let cmd_convert tmpprefix finalpath = "convert -quality 100 -density 120  -matte -fuzz 1% -fill None -opaque White " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"

Note that we have told convert to apply the commands -matte -fuzz 1% -fill None -opaque White to the conversion. This gibberish has the effect of converting whitespace in the png image to transparency. You will then have to make again.

If you have built up a cache of images in wiki/images/math, you may have to throw them away so that the wiki recreates them, now with transparency. (Maynard Handley)

Hmm... I was trying to make these changes on my wiki, the Knot Atlas, but only got this far before running into trouble. The images produced were blurry and black, like this: File:Bad-texvc-image.png. Any ideas? --Semorrison 04:31, 31 August 2005 (UTC) I'm running ImageMagick v. 5.5.6, which may be the problem? --Semorrison 04:43, 31 August 2005 (UTC)

HOW TO FIX THE VERTICAL ALIGNMENT?

Now that we have transparent, properly-scaled, nice-looking pngs, it is harder to ignore the last remaining visual discrepancy which is that text-inline pngs don't line up quite right with the main text baseline. I also wanted to fix this.
Note that unlike the three fixes above, which are basically theoretically motivated and should probably work across all systems, what I'm going to propose for vertical alignment is something of a hack that may have to be tuned for different browsers, or even for different "main" fonts (ie a page based on Helvetica vs one based on Arial). I offer it as a starting point, with the idea that as other people try it we may find that it works pretty well across all real-world configs, or alternatively that there's a fairly easy way to parameterize it, either by site or by browser, to have it still work OK.

My first though for this was to dick around with the vertical-align of the image, setting it to something that looked OK, like -36%. The problem is that what generates a good base line for a line like sin(x) + abs(y) does not generate a good base line for integrals.

On looking at various samples further, it seemed to me that while the current (vertical-align:middle) scheme works well, it seems to consistently (at least with Safari 1.3 and monobook style) have the TeX baseline just a shade below the HTML baseline. So I figured that if I stick the image vertically centered in a span, and I nudge the span up that slight amount, I'll get the better alignment I want, and the nudge up won't really affect TeX pngs that are stuck on a line by themselves.

So how do we implement this?
Return to file wiki/includes/math.php that we touched a little earlier, look again for

function _linkToMathImage() 

and change the last line to

  return "<span style=\"vertical-align:+.185ex\"> <img class='tex' src=\"$url\" alt=\"$alt\" style=\"height:$heightInEx\" /> </span>"; 

This does what I just discussed, and the .185ex is an empirical value that works well, as I said, for Safari 1.3 and monobook across a large range of font scaling.

So the end result of all our hard work is TeX pngs that are no longer second class citizens. They're transparent, scale like text, look reasonably good, and integrate organically enough into the surrounding text that, to first glance, they look just like standard text.

(Sorry to make such an ugly obviously shouting edit, but I think this stuff is important enough to be acted upon right away, and writing it up as a bug didn't seem appropriate.)

(Maynard Handley)

Hi there Maynard, I don't know how else to contact you but I'll try here.
I think your ideas here possibly have some merit, but the best way for all of use to gauge them is if you can find a way to set up a public wiki somewhere with your code plugged in. I would be interested in seeing it running on a live site, but probably it needs to be tested before running on the REAL live site. Dmharvey 16:59, 4 August 2005 (UTC)

Whitespace details

It says "Spaces and newlines are ignored", but this obviously isn't completely true:

  • \sin x
  • \sinx
    Failed to parse (unknown function "\sinx"): {\displaystyle \sinx}

What are the details of where spaces are important and where they are not? - Omegatron 15:35, 10 August 2005 (UTC)

I can speak for LaTeX (and blahtex), and I believe texvc's rules are very similar.
In math mode, there are only three places that whitespace means anything at all:
  • As you've pointed out above, to separate a command whose name consists of a sequence of alphabetic characters from any subsequent alphabetic characters, and
  • The command "\begin{ matrix}" is not identical to "\begin{matrix}", and
  • The command "\ ", which is equivalent to "\" followed by any nonzero amount of whitespace.
Apart from that, all whitespace is completely ignored. (I think. Maybe you can point out something I've forgotten!)
In text mode the rules are slightly different. LaTeX collapses consecutive whitespace in text mode into single whitespace characters, but these remaining whitespaces are not ignored for the output. However I don't completely trust texvc's implementation of text mode. For example \mbox and \textrm differ in how they accept special characters like "^" and "{" and "\{". Dmharvey 16:46, 10 August 2005 (UTC)
Also, of course "\ sin" is not equivalent to "\sin", and "\ ," is not equivalent to "\," (ditto with "\\"). Dmharvey 16:49, 10 August 2005 (UTC)
I just changed this to:
Similarly to HTML, in TeX extra spaces and newlines are ignored.
PizzaMargherita 13:38, 20 November 2005 (UTC)

\mathrm for mathematical constants

I know there are more important issues to think about, but.

I know that a lot of respectable publishers ignore this rule, but.

If we are feeling really really anal, it is considered good typography to write mathematical constants upright (i.e. using \mathrm).

The only references I can find to this rule are on the web, in newsgroups about TeX, but I'm sure I've read it somewhere autoritative.

Mathematical constants include:

  • e (Euler's constant)
  • i (imaginary unit)

The rationale is:

  • They can otherwise be confused with a variable, e.g. the index in a sum
  • Better semantics
  • More consistent

Also, as somebody already noted above, the differential operator should be \,\mathrm{d}. In the comp.text.tex newsgroup, one of the authors of the amsmath package Michael J Downes admits that they should have provided a \diffd command earlier on and now they don't do it for backward compatibility.

Interesting reads (but I'm sure there are a million others): [article #1] [article #2]

What do you think? Also, I'd be grateful if someone can find a decent reference. PizzaMargherita 18:45, 20 November 2005 (UTC)

Sorry Pizza, I humbly and strongly disagree. This conversation -- regarding "i" in any case, not sure about "e" -- has been had before, probably somewhere in the math wikiproject talk archives on en. The conclusion was that the person who was changing them all to upright was mistaken and a big effort took place to change them all back. I will repeat here what I said there. The vast majority of math texts I have seen use italic i and e and d. I don't think this is because they aren't "anal" enough, or because they are poor typesetters. I think this really is the convention in serious mathematical writing. One may ask, who is Dmharvey to say? Well, the best I can do is that I'm engaged in a PhD in pure mathematics at the moment, and I spend an awful lot of my time buried in math textbooks and journals, seeing italicised i and e and d pretty much everywhere. Perhaps in different fields or different languages it's different, but in pure mathematics in English I think italics wins. You should try and track down that conversation, see what people's arguments were either way. Dmharvey 21:22, 20 November 2005 (UTC)
Sure, sure no big deal. I'm really frustrated because I can't remember where I first read about it. So far the best I could find in the usenet thread above is that it is the "ISO style".
Incidentally, I just found out this in the Italian entry for LaTeX: \int_0^\infty f(x)\,\mathrm{d}x \approx \sum_{i=1}^n w_i \mathrm{e}^{x_i} f(x_i), to give
I'd be interested to read the exchange you mentioned... PizzaMargherita 22:11, 20 November 2005 (UTC)
It might well be a geographical thing. Here's the conversation I meant: en:Talk:Complex_number#The_non-italic_writing_style_of_the_imaginary_unit Dmharvey 22:38, 20 November 2005 (UTC)
Thanks for that. I totally understand where the minority was coming from and I agree with them. I added my thoughts there. PizzaMargherita 00:32, 21 November 2005 (UTC)

Using Times instead of Computer Modern

Has anyone considered using TeX's \mathptmx package for default output? It outputs math set in Times, which AFAIK is the default serif font on most platforms (as opposed to TeX's default Computer Modern, which is available on no platforms). Considering some formulae are output as plain HTML in a serif face, and some are rendered as images, using Times in the images might make them much more consistent. --Anonymous, 29 Nov 2005

Plain HTML on my browser with my settings on my OS is rendered as Wingdings. Just kidding, but definitely no serifs. PizzaMargherita 22:34, 29 November 2005 (UTC)
Are you talking about the math rendered in HTML, e.g. , or the rest of the article text? I'm looking at the source, and math in HTML is wrapped in a <span class="texhtml">, and the default Wikipedia CSS has the declaration span.texhtml {font-family: serif}. What I was trying to say was that on most platforms, in the default configuration, this would be displayed in some variant of Times, so it makes sense to have the images also be set in Times.
Well? Any thoughts? -- Anonymous, 5 Dec 2005

\mathrm for labels

It's good typography to use \mathrm around labels, like . But this makes the TeX a lot harder to read. Apparently we have some extras in texvc, like changing the names of special characters to coincide with HTML entities. Is there a way we could add functionality so that anything preceded by a backslash is rendered upright, like the difference between and , and only use mathrm when that doesn't work, or is that a really bad, hackish idea?

They say LaTeX and TeX are "extendable" with macros. Is that what the HTML entity thing is? — Omegatron 15:19, 1 December 2005 (UTC)

I think that's a "really bad, hackish idea". :-) The difficulty is that we may want to add commands in future, which might conflict with "commands" that people have already used. It's very un-TeX.
What you say about macros, that's not exactly what texvc does. Texvc actually itself translates these nonstandard commands. TeX never sees them. For example, "\part" gets translated by texvc into "\partial", which is standard TeX for the partial derivative symbol. (This is a particularly bad choice of abbreviation, because "\part" is also a standard LaTeX command which divides a document into "parts" (like chapters or something)). Dmharvey 23:19, 1 December 2005 (UTC)


Surface integral

Is there a way to use TeX to render one of those symbolic surface integral symbols? It's unicode character 0222F, a double integral with a closed loop around the two integral symbols.
I believe this is not implemented in texvc (the software driving the TeX implementation on wikipedia). In fact I can't even find a standard LaTeX or AMS-LaTeX command which does this. The best you can do is (and for some reason it gets cut off these days...). Dmharvey 18:55, 8 December 2005 (UTC)
∯ should work with correct browser settings and an appropriate font.
Speaking of which, someone suggested on the technical village pump that unicode special characters be allowed in math expressions, which would be translated by texvc into the appropriate \characters for tex. Is this possible?

For instance, instead of

you could type

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "http://localhost:6011/meta.wikimedia.org/v1/":): {\displaystyle 2 π r^2}

to make the markup easier to read. — Omegatron 17:34, 20 December 2005 (UTC)

Why More Complicated formula not working?

The following works fine:

But the following will give the original writing (please see www.bancova.com)

They do not appear as

but as: >{}_1^2\!X_3^4 \begin{matrix} \sum_{k=1}^N k^2 \end

Any suggestions, please email me to johnuseast@yahoo.com Thanks!!!

If I understand you correctly, you're asking why this formula:
<math>{}_1^2\!X_3^4 \begin{matrix} \sum_{k=1}^N k^2 \end{matrix}</math>
works under en.wikipedia but not at www.bancova.com? Obviously, this would have to be because bancova.com has not installed the requisite wiki software.
Urhixidur 16:21, 19 December 2005 (UTC)

THANK YOU!!! Could you kindly let me know what softwar i need? I installed mediawiki, and wiki version of Latex....do I miss any thing? PLEASE advise! THANK you again!

CAN ANY BODY HELP PLEASE?

Please don't shout. Have you read this? Dmharvey 12:57, 21 December 2005 (UTC)

---Thank you! I have the whole package installed...then my hosting company also installed "Latex"...just does not work....

Have you compiled texvc? Dmharvey 22:08, 21 December 2005 (UTC)

math formula Description: Some one suggested that my mediawiki is not supporting math formula because some other software needs to be installed, would you please have a quick look and see what is missing from my installation?

http://cvs.sourceforge.net/viewcvs.py/*checkout*/wikipedia/phase3/math/README

Problem solved, THANK YOU ALL!!

My web site now can display very nice math formula, due to all your guys hard work!

My special thanks go to www.SiteGround.com support team, a team that I have never seen in the whole hosting world. 1) They response within 5 minutes, all the times; 2) they take care of many things that other hosting companies would walk away from; 3) they have the patience, courage! If there is one Super hosting company, that is www.Siteground.com. They have a wonderul team. They have wonderful open sources software: the best CMS Typo3, the best wiki MediaWiki, the SMS, etc, etc. If you are not web expert and want to have real helps, I would strongly suggest that siteground is one!

Especially for MEDIAWIKI!

BTW: this is the list of team members I got a in the past week:

Kenny: Team Suport Supervisor

Tom: Suport Manage

Val Palmer

Brandon

Terry

Nick

Bill

SiteGround---No.1 Service Hosting Company!

(most of the above unsigned comments were by IP 12.104.10.143) Dmharvey 14:09, 22 December 2005 (UTC)

FTP Hosting, Online Storage and FTP Server Hosting for Business

MilesWeb.com offers managed FTP hosting services. MilesWeb is a one stop solution for all your web hosting, web design and development needs.

Ridgeon Network offers a range of professional Internet services that can be networked together to provide full business solutions. If you are interested in how Ridgeon Network can help you improve your internal and external operations, get in touch and we'll be happy to discuss your requirements.