# Italic variable appears as \$n\$ in browser title

See Sum of $n$ consecutive numbers divided by $n$ for an example.

The title of this question has the variable $n$ in italics. When rendering in the browser title bar it is displayed as \$n\$. I am using Chrome 12.0.742.112 on Mac.

-
I fixed your link and edited your title to reflect its intention better. I don't think it's possible to have math rendered in title bar of the browser window (since the appearance of the browser window is usually taken care of by the OS), so it's probably unavoidable. If this is true, what would you do about titles such as this one? So I guess the dollar signs are the least of problems. – t.b. Jul 9 '11 at 9:25
Properly, dollar signs are the LaTeX command for $math$ mode, not italics (the command for which is \textit{}). I'm not sure there's anything to be done about this - the browser surely does not know to get rid of LaTeX commands when deciding what to put in the title bar. – Zev Chonoles Jul 9 '11 at 9:28
@Zev: The title of the browser window is specified using html via the <title> tag - look at view page source in your browser - so one could certainly make some changes, but I don't see a reasonable way to do that in a better way than it is now. – t.b. Jul 9 '11 at 9:31
Ah, this shows how much I know about web page design :) Thanks for the info, Theo. – Zev Chonoles Jul 9 '11 at 9:33
Thanks Theo. I was thinking that perhaps the $sign and those should be parsed and stripped out of the <title> tag. – Carl Jul 9 '11 at 9:42 I understand. It's certainly a good observation. Let's see what the designers of the site decide what they can/want to do about this. There are related issues: for example markup/html is turned off in question titles, but I guess this is by design in order to have the question list appear more or less displayed uniformly. – t.b. Jul 9 '11 at 9:52 ## 2 Answers I was thinking that perhaps the$ sign and those should be parsed and stripped out of the <title> tag.

Open question: is there any sane way to reduce to a "pure ASCII" version of LaTeX? Obviously stripping $ is not even beginning to touch the surface of what would be needed. I am leaning toward "that is a crazy idea to even entertain", so perhaps what you're suggesting is not possible? - To your open question: yes, there is a sane way to reduce to a "pure ASCII" version of LaTeX. It is called LaTeX. :) (There are more symbols in LaTeX then allowed in ASCII, or even the extended version, so your choices are either to code them [which is what LaTeX is for, so why bother?], or convert everything to Unicode. That is doable, on a character-by-character basis, or a symbol-by-symbol basis, but you lose hella formatting that the end result is likely to be worse.) – Willie Wong Jul 9 '11 at 10:22 @Willie: To expand on that: While it is certainly possible to do something about it, you're doomed as soon as sub- and superscripts are involved, e.g.$\sum_{k=1}^{n} k^2$(we see such things quite often in titles). I think it's probably best to live with it and leave it the way it is now. This is a minor design issue which takes a huge amount of effort to correct with very little gain, IMO. – t.b. Jul 9 '11 at 10:29 @theo I guess the question is, is sum_{k=1}^{n} k^2 more readable than $sum_{k=1}^{n} k^2$? Hardly much of a change at all, I know.. but I guess stripping the $ is all we can realistically do – Jeff Atwood Jul 9 '11 at 10:31
@Jeff: It looks maybe a bit nicer from a purely aesthetic point of view. Most people here are trained to parse (La)TeX, so I don't think they're bothered by the dollar-signs. While in the specific instance of the sum it is probably more readable without $ and \ I wouldn't start stripping those out - to my eyes $2\frac{x-\sin{x}}{\pi}$ is more readable than anything else you could reasonably achieve. – t.b. Jul 9 '11 at 10:44 Also, LaTeX is a fairly standardised language with its little idiosyncrasies. To correctly strip everything requires you to essentially re-implement a large chunk of the math parsing code in LaTeX with the end result of returning something that doesn't look that much different anyway. (Also, if you take a look at sci.math, you'd see that there's not so much of a standard ASCII representation. Conventions followed by the most frequent contributors, yes; standards, no.) – Willie Wong Jul 9 '11 at 11:11 If you really want aesthetics, the best way is to encourage people to write descriptive titles using English words, instead of symbols, whenever possible. – Willie Wong Jul 9 '11 at 11:13 @willie that should be opened as a meta topic; I think the key is to have enough non-math words in the title.. a bit of $$ isn't that unreadable, it's the all math markup titles I kind of object to. – Jeff Atwood Jul 9 '11 at 11:17 How does this all impact the non LaTeX inclined, the non-mathematical geniuses and those of us who are just searching for answers to questions? – Carl Jul 11 '11 at 5:54 @Willie: The answer to the open question is a clear no. (La)TeX is not designed to produce ASCII output; Theo's$2\frac{x-\sin{x}}{\pi}$is a good example demonstrating this. (On the contrary, (La)TeX is designed to produce nicely typeset text out of a pure ASCII file!) – Hendrik Vogt Jul 11 '11 at 11:27 @Hendrik: I invite you to read my comment above again. (If you still don't catch my drift, try reading the first sentence with 'LaTeX' replaced by, oh, say 'C++'.) – Willie Wong Jul 12 '11 at 10:54 @Carl: in an ideal world, there would be (I quote Jeff) "enough non-math words in the title". (I take non-math here to mean not written in mathematical notation.) In this non-ideal world, I dunno, maybe guesswork, luck, plus good use of tags? – Willie Wong Jul 12 '11 at 10:59 @Willie: Oh my, sorry. I clearly overlooked the :). Thanks! – Hendrik Vogt Jul 12 '11 at 11:24 The HTML and XHTML standards specify that the title elements must contain only text strings and not other elements. In particular, there can be no formatting or mark-up specifications. So @Carl's suggestion of "parsing and stripping" is explicitly forbidden in an HTML document. (For example, emphasized text in HTML looks like .... <em>emphasized</em> ... and it is explicitly disallowed to have the title element be <title>something <em>emphasized</em> something else</title>. As the math formatting provided by MathJAX is through either CSS magic with fonts, or MathML, they are not allowed to be used in the title elements.) Insofar as textual representations of mathematical strings go, I think leaving it as TeX style mark-up is perhaps most desirable. (Of course, one can always try to avoid using mathmode texts in the titles of questions.) - Do you have any opinion on the question in my answer? – Jeff Atwood Jul 9 '11 at 10:09 'So @Carl's suggestion of "parsing and stripping" is explicitly forbidden in an HTML document' — I don't understand this. As far as I can tell, Carl's suggestion is simply to remove dollar signs (in the <title> element), and this can be done by the Stack Exchange backend. ("Parse" as in "detect"/"look for" dollar signs, not "interpret" them.) The question is whether it looks better to remove dollar signs… I think it makes it slightly better. – ShreevatsaR Jul 10 '11 at 5:28 @Shreevatsa: I interpret what Carl said to be "strip the dollar signs, put math variables in italics, yadayada." But even if we take your reading, would it really be better? Among a bunch of \ints and ^ and _s, I don't think the $ offends so much. Also, I am much happier seeing a TeX math expression enclosed in \$ then when it is not. – Willie Wong Jul 10 '11 at 12:52