Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

September 2, 2006

TeXnical Issues

Posted by John Baez

Thanks to Jacques Distler, this blog uses some marvelous technology that lets you write comments with equations in them. It’s based on TeX. The TeX - or more precisely itex - is converted to MathML.

As with any sufficiently advanced technology, you can waste a lot of time trying to figure out why the hell it isn’t working.

So, here’s a place for asking questions and giving other people help! I’m not an expert on this stuff, so I hope other people will answer all the questions, leaving me free to think about math.

Before you post questions, please read the following little FAQ, which may grow as time passes.

n-Category Café – TeXnical FAQ

Here are answers to some really basic problems you may have with this blog.
  • Why do all the equations look like gobbledygook?

    Maybe you don’t know math, so all equations look like gobbledygook.

    More likely, you forgot to download the necessary fonts. To do this, read Jacques Distler’s advice. He tells you what to do, depending on what operating system and browser you use. If you use Windows, I recommend switching to Firefox if you haven’t already; then installing the requisite fonts is easy. Your mileage may vary — if you get stuck, see the discussions below, especially this.

    You can check to see you have all the necessary fonts by going to Jason Blevin’s test page. Look at all the symbols, and see which look okay.

  • Why doesn’t it work when I make comments using TeX?

    When you post comments, you are given a choice of “Text Filters”. The default choice is “Convert Line Breaks”. That’s good if you don’t want TeX. But if you want TeX, it won’t work! For TeX, I suggest

    • “itex to MathML with parbreaks” if you like writing in XML, or

    • “markdown with itex to MathML” if you prefer a simple markdown system.

    If you’re used to TeX, please keep in mind that on this system, TeX kicks in only inside equation environments. Outside those, your chosen text filter is in charge!

    There are lots of other things that can go wrong, since itex and MathML are sort of complicated. But, if you keep clicking on “preview” and struggling to decipher the cryptic error messages, you’ll either figure out your problem… or you won’t.

  • Why doesn’t it work when I include HTML links?

    Maybe you’re using “A HREF” instead of the lower-case “a href”. Unlike HTML, the system here is case-sensitive. This should work:

    <a href = "http://math.ucr.edu/home/baez/TWF.html">This 
    Week's Finds</a>

    This would not:

    <A HREF = "http://math.ucr.edu/home/baez/TWF.html">This 
    Week's Finds</a>

    Since we’re engaged in scholarly discussion, I encourage including references with links. If you want to make me really happy, something like this is great:

    <ul>
    <li>
    Ross Street,
    <a href = "http://arxiv.org/abs/math.CT/0303175">Categorical and 
    combinatorial aspects of descent theory</a>.
    </li>
    </ul>
    

    It should give you something like this:

  • Why doesn’t it work when I use “blockquote” to quote someone?

    Again you need lowercase, but also, when using the text filters “Convert Line Breaks” and “itex to MathML with parbreaks”, you need to skip a line before and after the “blockquote” command. So, with these text filters, this should work:

    John Baez said:
    
    <blockquote>
    
    In the 60's, Grothendieck led the reggae group 
    shown in this rare photo:
    
    </blockquote>
    
    

    This would not:

    John Baez said:
    
    <blockquote>
    In the 60's, Grothendieck led the reggae group 
    shown in this rare photo:
    </blockquote>
    

    Other text filters have other demands.

    You may also run into trouble if you just cut and paste the text you’re trying to quote, because it may contain math or other special characters - see below.

  • How come weird stuff happens when I use symbols like & or < ?

    Some symbols have special meanings in HTML. To keep the computer from thinking you intend those special meanings, instead of typing a raw & you have to type

    &amp;

    which is the HTML code for an ampersand. Similarly, instead of < you need to type

    &lt;

    (Extra credit if you can figure out what I have to type for you to see "&amp;".)

  • Can I customize my view of the comments, to help keep track of the mammoth conversations on this fascinating blog?

    A little - at the bottom right of the list of comments, you can click on a little button saying “view chronologically” to see the comments in chronological order. Then it says “view threaded”; clicking on it again restores the original view.

  • Can I customize my view of the comments a lot more, get the comments form to automatically choose “itex to MathML with parbreaks” every time, and stuff like that?

    Only if you’re smarter than me. If you’re using Firefox, you can download Greasemonkey, an add-on which lets you customize your web-browsing experience using little programs called scripts. Mike Stay has written a Greasemonkey script specially for viewing this blog. You can get it here.

Posted at September 2, 2006 8:46 AM UTC

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/916

151 Comments & 2 Trackbacks

blockquote

Concerning the blockquote-tag, the point is that it does require the content included in <blockquote>…</blockquote> to be inside a paragraph environment enclosed by <p>…</p>.

So you either have a text filter chosen which converts line breaks to such <p>…</p> tags and then insert line breaks before and after the blockquote-tag as John says above – or you add in the tags by hand and do

<blockquote><p>text goes here</p><blockquote>

And if the quoted text has itself several paragraphs you type


<blockquote>
<p>
first paragraph
</p>
<p>
second paragraph
</p>
<blockquote>

which produces this output

first paragraph

second paragraph

Posted by: urs on September 2, 2006 2:09 PM | Permalink | Reply to this

Re: blockquote

If you’re not keen to type XHTML markup, you can also choose the Markdown (without TeX equations) or Markdown with itex to MathML (with TeX) filter and type

> This is a blockquoted paragraph
>
> This is *another* paragraph.
>
>> This is a blockquote **within** a blockquote.
>
> And yet one more paragraph.

to obtain

This is a blockquoted paragraph

This is another paragraph.

This is a blockquote within a blockquote.

And yet one more paragraph.

Also, I’d like to point out that development of the itex2MML filter, that converts TeX to MathML here, is very much user-driven. I’ve tried to implement the most useful subset of LaTeX (with a few MathML-inspired extensions, like \tensor{R}{_\mu_^j^k_l} and \multiscripts{_2}{F}{_1}, which produce Rμ j k l and F1 2 , respectively). But, if there are some TeX commands you wish were implemented, but aren’t, let me know.

As to fonts, the current situation is pretty ugly. My best understanding is here. When the Stix fonts are released, we will finally have a complete set of mathematical symbol fonts, which work on all platforms (Linux, Mac and Windows). But that’s still a ways in the future.

Posted by: Jacques Distler on September 2, 2006 7:10 PM | Permalink | PGP Sig | Reply to this

Making the font package

I’ve tried several times to get this to work, with no success. I’m running the xft-disabled build of firefox on Linux (I think). I try to follow the instructions for creating the font packages here:

http://swissnet.ai.mit.edu/projects/intelligent-book/mathml/#gnu

I discover that there is no “type1inst” command on my distribution (Fedora Core 5). I find a “type1inst” on:

http://www.ibiblio.org/pub/Linux/X11/xutils/

and install it manually. Following instructions by running type1inst on the cmpsfont/pfb, I get messages:

94 fonts found
94 were standard PostScript fonts
——————————————————-
For 94 of these I couldn’t figure out which foundry
the font is from. Thus, these fonts will appear under the
foundry unknown, i.e. X font name -unknown-*.
Please consult the README file to see what this means.

I don’t know if this is a problem or not.

When, as instructed, I run type1inst on the PCF/ directory, I get the message:

There are no PostScript fonts in this directory

So I’m not surprised when I follow the rest of the instructions, and fonts don’t work. (Add to that the fact that my up-to-date Linux distribution seems to handle fonts in a differnt way than the older ones described in these instructions … and, of course, I don’t know anything about fonts …)

Has anybody ever gotten this to work? I’m curious.

Posted by: Charles on September 2, 2006 5:02 PM | Permalink | Reply to this

Re: Making the font package

I’m not sure exactly what you are going for here, but if your goal is to get mathml to display correctly in Firefox, under Fedora Core 5, it’s much easier than what you are trying to do.

First of all, I assume you have root access on the machine you are working on. If not, find a system administrator and ask them nicely to help you. Now, check to see if you have the mathml fonts installed with the following command:

rpm -q mathml-fonts

If they are installed it will return the name of the package. If not, it will say “package mathml-fonts is not installed”. If it is not installed then you can grab it from:

mathml-fonts

This can be installed (as root) using the command:

rpm -ivh xxxx

where “xxxx” is the name of the mathml-fonts rpm you downloaded, above. Alternately, if you are comfortable using “yum” you can find it in the “extras” repository.

Installing the mathml-fonts package should provide the fonts you need. They are truetype fonts, so if you need type 1 fonts for something else then this will not help you.

There is one more thing you have to do. By default, Fedora builds firefox with “Pango” support for text layout. For various reasons this doesn’t quite jive with mathml rendering. Hopefully this will be fixed soon. As root, you need to open the file /usr/bin/firefox, which is actually a script that runs firefox with all the proper variables set, and comment out the lines that tell firefox to use Pango. I think they are somewhere around line 84 in the file. That section of the file will look like this:

#
MOZ_DISABLE_PANGO=1
export MOZ_DISABLE_PANGO
#

You should change it to look like this

#
# MOZ_DISABLE_PANGO=1
# export MOZ_DISABLE_PANGO
#

Once this is done, save the file.

Now when you run firefox it should properly display mathml.

Posted by: Bob McNees on September 3, 2006 6:48 PM | Permalink | Reply to this

Re: Making the font package

I think you meant it the other way around, i.e. you want to remove the comment marks on the lines that disable pango.

Posted by: Mike on September 4, 2006 2:10 AM | Permalink | Reply to this

Re: Making the font package

Whoops! That’s embarassing!

Yes, I switched things around. Initially, that section of the file /usr/bin/firefox will look like this:

#
# MOZ_DISABLE_PANGO=1
# export MOZ_DISABLE_PANGO
#

and it should be altered (this must be done as root!) to look like this:

#
MOZ_DISABLE_PANGO=1
export MOZ_DISABLE_PANGO
#

After this change has been made firefox will no longer use pango for text layout, and mathml should display correctly.


Posted by: Bob McNees on September 4, 2006 3:41 PM | Permalink | Reply to this

Re: TeXnical issues

You can’t type $x^{*}$ in markdown with itex to mml, because it thinks the asterisk is for emphasis. I got around it by using $x^{\star}$.

Posted by: Mike on September 2, 2006 7:29 PM | Permalink | Reply to this

Markdown Filter

Yikes!

If so, that’s a bug in the filter. Markdown is supposed to ignore things like “*” when they occur within MathML markup.

Thanks for bringing this to my attention. It must be some kind of regression, as this didn’t used to be a problem. I’ll check into it, and hopefully get it fixed ASAP.

Posted by: Jacques Distler on September 2, 2006 7:37 PM | Permalink | PGP Sig | Reply to this

Markdown filter

I’m not reproducing your problem, Mike. Here is x * ($x^{*}$) and here is the same thing as a display equation

x *

($$x^{*}$$). Both seem to work just fine for me.

Posted by: Jacques Distler on September 2, 2006 7:56 PM | Permalink | PGP Sig | Reply to this

Re: Markdown filter

Try that expression all by itself. I get an error and find this in the offending line:

<p>$x^{<em\>}$<math xmlns=’http://www.w3.org/1998/Math/MathML’ display=’inline’><msup><mi>x</mi> <mo></em></mo></msup></math></p>

Clearly the asterisk has been replaced by <em/>.

Posted by: Mike on September 3, 2006 4:01 AM | Permalink | Reply to this

Re: Markdown filter

There’s a bug in itex2MML that I haven’t been able to track down. If the very first character of the input is a “$” (because you happen to start your comment with a formula) then it echoes back the TeX formula, in addition to the processed MathML output.

This (for obvious reasons) screws up the Markdown filter. For silly reasons, the itex to MathML with parbreaks filter is not affected.

The workaround is trivial; Insert a blank space before the first $, and the Markdown filter will work correctly.

Posted by: Jacques Distler on September 3, 2006 4:21 AM | Permalink | PGP Sig | Reply to this

Re: TeXnical issues

Why doesn’t it work when I include HTML links?

If you’re using markdown, then you’d write links like this:

A neat paper by [Abramsky and Coecke](http://arxiv.org/abs/quant-ph/0402130)

and they’d appear like this:

A neat paper by Abramsky and Coecke

You can put a backslash before most symbols to get them to appear, but using the markdown with itex to mml filter, \[ means “center this equation” so I wrap the bracket in dollar signs. I don’t know how to escape a dollar sign under this filter.

Mike Stay has written a “greasemonkey script” that lets you do stuff like this if you’re using Firefox. Don’t ask me what that means.

Firefox is a web browser. Greasemonkey is a plugin for the browser that allows you to preprocess your web pages before seeing them. People write up little programs, called user scripts, that rewrite the web page in a way that’s more useful to them. For example, you can remove ads, rewrite links to go to “printer” versions of articles instead of the click-through ones, change color schemes that are hard on your eyes, etc.

My user script hides all the comments except the one you’re responding to, and also sets the filter to markdown with itex to mml.

Posted by: Mike on September 2, 2006 7:49 PM | Permalink | Reply to this

Choose wisely

You can put a backslash before most symbols to get them to appear, but using the markdown with itex to mml filter, \[ means “center this equation” so I wrap the bracket in dollar signs. I don’t know how to escape a dollar sign under this filter.

The easy answer is: if you’re not using math in your comment, choose the ordinary Markdown filter, where these characters don’t have any special meaning. Then you can just type “$” and “\\[”.

If you really need those characters (outside of equations) and you need equations in the same comment, you can always type “&#x24;” ($) or “&#x5c;[” (\[).

Posted by: Jacques Distler on September 2, 2006 8:10 PM | Permalink | PGP Sig | Reply to this

Re: TeXnical issues

Thanks, folks! As time passes I will try to update the FAQ to provide better answers to the questions, and answers to more questions - but probably always with an emphasis on the questions of the most clueless sort, since I’m sure there are lots of good mathematicians and physicists who are flummoxed by the simplest things here.

I’m afraid that “TeX” and “posting to a blog” are sufficiently scary to prevent a lot of good people from joining in the conversation, because I’ve been getting a certain number of comments via email. I don’t now have the energy to try to help people overcome those barriers, but maybe someday I can include links to places that explain that stuff.

I’m just curious, Jacques - which do you find to be the most efficient filter for posting to your blog? Or do you pick one based on what you’re trying to do? Right now I’m using “itex to MathML with parbreaks” except for posts with no math at all.

Posted by: John Baez on September 3, 2006 12:10 AM | Permalink | Reply to this

Choice of tools

For posting to my blog, I mostly use a blogging client, ecto.app, for MacOSX. It has many nifty features (like user-defined macros for inserting XHTML markup), which make composing posts much more pleasant.

The huge disadvantage is that it uses a non-MathML-aware renderer for its preview function. So I often end up correcting the equations in my posts, after publishing them.

As to filters, I tend to use whichever one seems most appropriate.

For comments, that’s usually either the default (Convert Breaks) or one of the Markdown filters (with or without itex to MathML)

For posts, since I have macro-keys to insert whatever markup I typically use, I tend to rely more on the itex to MathML with parbreaks or the Convert Breaks filters, depending on whether the post has math in it.

Just about the only filters I never use are the Textile filters. But some people like 'em, so I keep them around …

I wish I could recommend one single filter as all-around best, but I can’t.

As much as I like Markdown syntax, for instance, it doesn’t support the cite="..." attribute for <blockquote> elements. I like supplying the URL for something I quote. And you’ll notice that those cite attributes get handled in a particularly nifty way hereabouts.

Posted by: Jacques Distler on September 3, 2006 3:59 AM | Permalink | PGP Sig | Reply to this

Re: TeXnical issues

Long ago, Arthur C. Clarke famously stated that “any sufficiently advanced technology is indistinguishable from magic”, leading Gregory Benford (among others) to conclude that any technology distinguishable from magic is insufficiently advanced. By the same logic, I suppose we should adopt Baez’s Nth Law, “Any technology which does not break in fantastically incomprehensible ways is so insufficiently advanced it’s not worth bothering about.”

Posted by: Blake Stacey on September 3, 2006 12:16 AM | Permalink | Reply to this

Re: TeXnical issues

Nah. Technology that doesn’t break in fantastically incomprehensible ways is obviously magic, ergo the the previously described category of “insufficiently advanced” is sufficient.

But kudos to all of you for pushing mathml with all the attendent development work! I always thought that it was deeply ironic that for almost a decade after the web was invented for the distribution of scientific communication, we didn’t have a reasonable way to include mathematics. Nice to see this finally changing.

Posted by: Ralph Giles on September 4, 2006 1:11 AM | Permalink | Reply to this

Re: TeXnical issues

I wonder if in a few years time those involved in talking about maths on the internet will lament the passing of days when they had to use ASCII. Unlikely, I guess. More reasonable though to lament the passing of the blackboard. Sasha Borovik has a good post on this.

As I predicted, Borovik’s blog is proving very interesting.

Posted by: David Corfield on September 4, 2006 12:59 PM | Permalink | Reply to this

related issues

In one of the comment sections, John wrote

I think I’ll keep posting the “main line” of my Socratic dialog with Urs as comments that will appear on the very bottom of this page, instead of commenting on a comment on a comment….

That’s fine with me.

I just remark that this need not be an either-or decision. Using the button “view chronologically” found at the bottom of each comment section we can always turn the tree of comments into a linear list and see our latest comments appear at the bottom.

Therefore personally I tend to use the nested threading, becasuse - if desired - this is useful for disentangling parallel discussions in a long comment section.

Posted by: urs on September 6, 2006 2:41 PM | Permalink | Reply to this

Re: related issues

Good point. As you’ve probably noticed, I like to sort of “manage” the discussions about my blog entries by writing long comments that sum up what’s been said so far, explain stuff, and pose puzzles. I’d like to have these long comments stand out visibly, but have also trees of discussion consisting of shorter posts where people (including me) are busy talking to each other about millions of things. That’s what I’m trying to achieve. But maybe I’m just being too bossy, trying to run the show too much.

Posted by: John Baez on September 6, 2006 4:20 PM | Permalink | Reply to this

Re: related issues

But maybe I’m just being too bossy, trying to run the show too much.

No, that’s great.

I just thought I should also mention this “threaded/chronological” toggle. On some browsers it is sometimes hard to see (IE) - and it’s a cool feature.

Posted by: urs on September 6, 2006 4:47 PM | Permalink | Reply to this

Re: TeXnical Issues

Is it just me, or did you change the way preview works recently? It doesn’t have the parent_id as part of the URL and thus my greasemonkey script has no way to pick out the message. (Maybe I just never noticed that it only works on the first screen after hitting “Reply to this”.) Is it possible to make the parent_id part of the url when previewing comments?

Posted by: Mike on September 6, 2006 9:21 PM | Permalink | Reply to this

Re: TeXnical Issues

Is it possible to make the parent_id part of the url when previewing comments?

The arguments to an CGI script are appended to the URL, when accessed via an HTTP GET. They are part of the body of the request, when accessed via an HTTP POST.

For sound technical reasons, the comment form is (and always has been) submitted as an HTTP POST.

I don’t see why this should be an issue. There are plenty of other ways greasemonkey could keep track of this information, besides looking at the current URL.

Posted by: Jacques Distler on September 6, 2006 11:07 PM | Permalink | PGP Sig | Reply to this

Re: TeXnical Issues

I’ve changed my script so that it fetches it out of the hidden input tag when it’s not in the URL.

Posted by: Mike on September 7, 2006 6:47 PM | Permalink | Reply to this

Re: TeXnical Issues

Now it also inserts a little button to show / hide each comment; by default, it only shows the one you’re responding to, but you can click now to see others.

Posted by: Mike on September 8, 2006 12:49 AM | Permalink | Reply to this

Search

Is search broken for anyone else?

Posted by: Mike on September 6, 2006 11:00 PM | Permalink | Reply to this

Re: Search

Yes, it seems busted to me. I typed in “doctrine” and then “n-category”, and both times I got:

Movable Type

An error occurred

You are currently performing a search. Please wait until your search is completed.

with no sign that anything would ever happen.

Posted by: John Baez on September 7, 2006 4:32 PM | Permalink | Reply to this

Re: Search

Yet another thing that was broken by the upgrade to MT 3.3x.

For historical reasons, there’s a throttle on the number of simultaneous searches that can be performed.

This worked quite flawlessly through many revisions of MovableType but seems to have broken with MT 3.3x. I’ve gone in and restored the previous behaviour.

Let me know if you have any further problems.

Posted by: Jacques Distler on September 8, 2006 5:24 AM | Permalink | PGP Sig | Reply to this

Input box

Is it a design choice that the box where you type in comments is rather small, or is it just a facet of my particular configuration?

As I see it (in Firefox on Linux), it’s 42 characters wide and 10 high. To me this feels quite claustrophobic, and I’d prefer something much bigger. For instance, when I use a text editor for typing Latex etc, it’s 75 characters wide and 35 high, and I find that comfortable.

Thanks.

Posted by: Tom Leinster on October 14, 2006 2:53 PM | Permalink | Reply to this

Re: Input box

Good point. My box is the same size, and indeed this has always annoyed me.

I’ll ask Jacques how easy this is to change.

Posted by: John Baez on October 20, 2006 11:34 PM | Permalink | Reply to this

fonts… and css

Why do all the equations look like gobbledygook?

Well, what I found in firefox (and mozilla) under Solaris, is that it was gobbledygook even after installing the fonts. The problem is the line for the font-family in the file …/mozilla/res/mathml.css; it gives Symbol precedence over every other math type except CMSY10, and this one is specifyed in uppercase, btw. Putting Symbol at the end of the line seems to solve the gibberish look. Tip from Ian Hutchinson.

Posted by: Alejandro Rivero on October 22, 2006 4:40 PM | Permalink | Reply to this

Two Tips for Perfectionists

For the aesthetic totalitarians among you, who like everything as beautiful as humanly possible:

  1. Due to some slight bug, letters in math formulas come out in roman font if no space is left between them. Thus, if you multiply the variables x and y, you’ll get xy instead of xy unless you put in a space.
  2. Use only right-handed single quotes if you want

    ‘quotes like this’

    If you use a left-handed single quote on the left side, the way you learn to do in TeX, you’ll get

    `quotes like this’,

    which aren’t nearly as pretty.

I hope nobody fixes these ‘bugs’, now that I’ve written reams of material that’s adapted to them.

Posted by: John Baez on December 1, 2006 5:59 AM | Permalink | Reply to this

Re: Two Tips for Perfectionists

Due to some slight bug, letters in math formulas come out in roman font if no space is left between them.

“It’s not a bug; it’s a feature.”

The MathML Specification recommends that the multiletter token, <mi>xy</mi> be rendered in an upright font, whereas the single-letter tokens <mi>x</mi><mi>y</mi> should be rendered in italics.

Question: how to access this feature from itex? TeX doesn’t normally have a concept of multi-letter tokens: $xy$ is treated as two tokens, just like $x y$. In this regard, itex follows the MathML convention. $xy$ is a single two-letter token (converted to <mi>xy</mi>); $x y$ is two one-letter tokens (converted to <mi>x</mi><mi>y</mi>).

There are a few other places (notably tensor notation, prescripts, etc) where itex departs from standard TeX, in the interest of exploiting certain features of MathML.

Use only right-handed single quotes…

The smart quotes feature turns 'foo' "bar" into ‘foo’ “bar” and … into … (a true ellipsis).

I hope nobody fixes these ‘bugs’, now that I’ve written reams of material that’s adapted to them.

I don’t think they’re bugs. And, for reasons similar to yours, I don’t intend “fixing” them.

Posted by: Jacques Distler on December 1, 2006 7:30 AM | Permalink | PGP Sig | Reply to this

Re: TeXnical Issues

This is a problem.

Posted by: Mike Stay on December 6, 2006 2:35 AM | Permalink | Reply to this

Diagrams

I drew this diagram

(1)P 1 (U) p P 1 (X) tra U t tra T i T

when Toby asked

How did you make this diagram, Urs?

I am using hacks like this one:

\array{

P_1(U) &\stackrel{p}{\to}& P_1(X) \\

\mathrm{tra}_U \downarrow \;\; & \sim\Downarrow t & \;\; \downarrow \mathrm{tra} \\

T' & \stackrel{i}{\to} & T

}

Posted by: urs on December 8, 2006 5:21 PM | Permalink | Reply to this

Re: Diagrams

|array|, eh? Thanks, Urs!

Posted by: Toby Bartels on December 8, 2006 7:52 PM | Permalink | Reply to this

Re: Diagrams

You can achieve a lot of fine-grained control using \array{ \arrayopts{...} ... }. But, in this case, is there anything that couldn’t be achieved with the more familiar \begin{aligned} ... \end{aligned} ?

P 1 (U) p P 1 (X) tra U t tra T i T

being produced by

$$
\begin{aligned}
  P_1(U) & \overset{\quad p\quad}{\to} && P_1(X) \\
  \mathrm{tra}_U\downarrow & \sim\Downarrow t &&\downarrow \mathrm{tra} \\
  T' & \underset{\quad i\quad}{\to} && T
\end{aligned}
$$
Posted by: Jacques Distler on December 10, 2006 5:24 AM | Permalink | PGP Sig | Reply to this
Read the post Full Disclosure
Weblog: Musings
Excerpt: A serious MovableType security vulnerability.
Tracked: January 7, 2007 5:19 AM

mimetex public server

I just discovered this: there’s a public server that will take math-mode tex and render it as a gif. (Not that we need it here, but it might be useful to readers.)

Just insert this into your webpage

<img src=”http://www.forkosh.com/mimetex.cgi?c=\sqrt{a^2+b^2}”

    alt=”” border=0 align=middle>

to get this:

Posted by: Mike Stay on February 3, 2007 7:53 PM | Permalink | Reply to this

Re: mimetex public server

Very useful indeed. I wouldn’t want to use up all their bandwidth by using this in by blog, but they might have the cgi available for installation elsewhere.

Posted by: John Armstrong on February 3, 2007 8:39 PM | Permalink | Reply to this

Re: TeXnical Issues

Bruce Bartlett asked me:

I’ve noticed there are a few wizards at the cafe (most notably the hosts and Jacques Distler) who can write down commutative diagrams, insert jpg’s, do accents (like Poincar’e), and even use bold and italic with ease. I don’t know how to do this stuff - it doesn’t seem to work the same way as in LaTeX - so it would be cool if you could explain some of the standard work-arounds.

The key thing to remember is that on this blog, TeX only turns on inside equation environments — that is, inside things like this:

$        $

and this:

$$    $$

and (for numbered equations) this:

 \[     \]

Outside those, your chosen text filter is in charge!

For example:

  • For accents, don’t use TeX commands — they won’t work. Instead, learn how accents and other symbols work in HTML! So, to see

    Poincaré

    don’t write

    Poincar\'e

    Write

    Poincar&eacute;

  • To insert jpgs, you do the usual HTML thing. But, since you’re really using XML, you have to be a good boy and include an ‘alternate text’ for the image in case the one you want is temporarily unavailable. This can be empty. So, to see this:

    (very useful when Urs gets too abstract), you can type this:

    <img src = "http://math.ucr.edu/home/baez/emoticons/cry.gif" 
    alt = ""/>
    

  • I can’t give a complete description of how to draw diagrams, but to get this:
    (1)1 F E B 1 1 F E B 1

    you do this.

    For a longer example, see this post by Urs. Then, see how he did it!

Posted by: John Baez on February 4, 2007 12:07 AM | Permalink | Reply to this

Re: TeXnical Issues

Another route to accents is to learn how your system lets you type in Unicode, rather than remembering all the HTML names.

On my Mac, for example, I can just type option-E followed by a vowel to add an acute accent to that vowel: áéíóú. I’m sure Windows and Unix have something comparable.

Posted by: John Armstrong on February 4, 2007 12:50 AM | Permalink | Reply to this

Commutative diagrams

The key to commutative diagrams (to the extent that we can currently create them here) are the matrix and aligned environments from LaTeX.

\begin{matrix}
...
\end{matrix}

produces an array of centered elements.

\begin{aligned}
...
\end{aligned}

produces an array of elements which are, alternately, right- and left-justified. Typically, it’s used to create multiline equations, but it’s also good for creating a diagram like

A h 1 B g 1 g 2 C h 2 D

More fine-grained control can be had using the \array{} command (which is not standard LaTeX, but is something itex inherited from WebTeX). Its myriad of options are explained here. Some fancy (but hardly the fanciest) examples of its use can be seen in this post.

Yet fancier diagrams, such as those produced by the dcpic package (which, surely, is the darling of every category theorist) could, in principle, be realized using a mixture of MathML and SVG. While I’d dearly love to implement such a thing, it’s beyond what is currently feasible.

The full list of that is implemented here can be found in the itex command summary.

Posted by: Jacques Distler on February 4, 2007 6:27 AM | Permalink | PGP Sig | Reply to this

Re: TeXnical Issues

OK, this is starting to bug me … and since we’re talking about writing mathematics badly …. What’s with all the primes floating at the feet of their letters, like this?

H

Shouldn’t the primes be in superscript position, like this?

H

Maybe it’s a bug in the interpretation software, but to get the prime in superscript position, you have to do it explicitly, like this (except between dollar signs):

H^\prime

Otherwise the prime isn’t superscripted.

Or is this some weird convention I don’t know about?

Posted by: Tim Silverman on February 23, 2007 10:18 PM | Permalink | Reply to this

Re: TeXnical Issues

Tim, your original example looks just fine to me; your second example is really strained and much too high. You’re not using Internet Explorer, are you …?

Although I’m getting some funny stuff here with Firefox too. Let’s see: * <i>M</i>&prime; should be correct: M′ * <i>M</i><sup>&prime;</sup> should be too high: M * $M'$ should be correct: M * $M\prime $ should be too low: M * $M^{\prime }$ should be correct: M

Yet I find that the MathML produced by iTeX (in the last three) is wrong as an interpretation of TeX: * <mi>M</mi><mo>'</mo> instead of <mi>M</mi><mo>&#x02032;</mo> * <mi>M</mi><mo>&#x02032;</mo> instead of something that AFAICT cannot be rendered using Unicode characters * <msup><mi>M</mi> <mo>&#x02032;</mo></msup> instead of <mi>M</mi><mo>&#x02032;</mo>

So it appears that your browser is using MathML fonts that compensate for iTeX’s incorrect rendering. Either that, or MathML has redefined the Unicode character U+2032, which iTeX and your fonts have compensated for but my fonts have ignored.

Well, in any case, I think that I will try not to use primes with iTeX here.

Posted by: Toby Bartels on February 23, 2007 10:50 PM | Permalink | Reply to this

Re: TeXnical Issues

Thanks Toby.

So it’s me?

I’m using Firefox.

$M’$ comes out wrong (too low). I guess this is what other people are using.

Is there something I can do about this?

Posted by: Tim Silverman on February 24, 2007 6:50 PM | Permalink | Reply to this

Primes

Bug reports are so nice.

OK. Let’s see what happens now.

$M'$ → M

$M''$ → M

$M'''$ → M

$M\prime$ → M

$M^\prime$ → M

Better (or, at least, tolerable) now?

Toby says:

$M\prime$ should be too low. … something that AFAICT cannot be rendered using Unicode characters

Well, if it can’t be rendered using Unicode characters, you’re out-of-luck.

Posted by: Jacques Distler on February 24, 2007 9:44 PM | Permalink | PGP Sig | Reply to this

Re: Primes

I’ll tell you what I see, for what it’s worth:

$M’$ low

$M”$ low

$M”’$ high

$M\prime$ low

$M^\prime$ high

My fonts are just a mess.

Posted by: Tim Silverman on February 25, 2007 1:15 PM | Permalink | Reply to this

Re: Primes

Well, if it can’t be rendered using Unicode characters, you’re out-of-luck.

To be fair, probably nobody would want to try it. But somebody might (perhaps thinking of iTeX’s previous treatment of the apostrophe) try $M^\prime $, so that should render correctly (that is, without any actual superscript).

The apostrophe, however, certainly works perfectly for me now! (I’m using Firefox 2, usually on Windows XP.)

Posted by: Toby Bartels on February 27, 2007 2:49 AM | Permalink | Reply to this

SVG in Comments

OK … Why not allow SVG in comments?

A little tweaking was necessary, but you can now do things like this:

Example Young Tableaux in SVG
Some Young Tableaux

or this:

Picture of Trefoil Knot
Framed Trefoil Knot
Posted by: Jacques Distler on April 18, 2007 5:40 AM | Permalink | PGP Sig | Reply to this

Re: SVG in Comments

Excellent! I’ll try one out in the Schur functor thread…

Posted by: John Baez on April 19, 2007 11:45 PM | Permalink | Reply to this

Re: SVG in Comments

Those who would like to use such SV graphics in comments here now and then, but don’t know how to can find more information over at Jacques Distler’s blog.

Jacques suggests to get started to go to the SVG Specification site, copy-and-paste the examples given there and play around with them.

But take care to prefix everything properly.

If in search for SVG inspiration, check out Sam Ruby’s blog which uses it a lot (for decorative purposes, mostly).

Posted by: urs on April 20, 2007 9:19 AM | Permalink | Reply to this

Re: SVG in Comments

There’s always InkScape. But you’ll have to edit the output. In simple cases, it’s easier to just create the figure by hand.

Like this one, for instance:

sphere, cube, tetrahedron
Three Solids
Posted by: Jacques Distler on April 20, 2007 4:18 PM | Permalink | PGP Sig | Reply to this

Re: SVG in Comments

It says “Three Solids”, but I see two!

Posted by: John Baez on April 20, 2007 11:18 PM | Permalink | Reply to this

Legerdemain?

The <svg:desc> element says

sphere, cube, tetrahedron

If you were browsing in a non-SVG-capable browser, you’d see that text, instead of the figure.

Posted by: Jacques Distler on April 21, 2007 2:18 AM | Permalink | PGP Sig | Reply to this

Re: SVG in Comments

I see a beautiful centered picture of a blank space, a cube, and a tetrahedron. I’ve got an up-to-date version of Firefox.

Just a data point…

Posted by: John Baez on April 21, 2007 2:28 AM | Permalink | Reply to this

Re: SVG in Comments

Ulp!

OK. Let’s break it down


Circle with radialGradient fill

versus


Circle with uniform fill

The former was the “sphere” in the previous figure.

A random thought: might you be experiencing bug 372377?

Posted by: Jacques Distler on April 21, 2007 3:29 AM | Permalink | PGP Sig | Reply to this

Re: SVG in Comments

While writing a comment here, I reloaded this page a couple of times. After a while, the SVG output that I saw in the above comments changed.

First everything was displayed beautifully and presumeably the way it was intended.

Then everything appeared in a “negative” kind of way, with bright shades having turned dark, and vice versa.

Reloading even more times then yielded a result as described by John above: the ball with radial gradient fill disappeared entirely, and the cube now appeared with top and front face empty (not filled).

This is for Firefox on Windows (alas).

Posted by: urs on May 2, 2007 4:48 PM | Permalink | Reply to this

Re: SVG in Comments

I believe that was a bug.

Let me know if the problem is fixed for you now.

Posted by: Jacques Distler on May 2, 2007 6:26 PM | Permalink | PGP Sig | Reply to this

Re: SVG in Comments

I’m having similar problems viewing radial gradients in firefox (Linux). I’m trying to track down the bug. If you are experiencing this problem you can help me out by doing the following:

1) Check out my comment in this thread on Jacques’ blog:

Thread

2) Let me know whether or not you see a circle with a radial gradient.

3) If not, click on “Post a New Comment” in that thread. A comment window will pop up. When I do this I see the circle, with radial gradient, properly rendered in this window. Let me know whether or not you see it.

Posted by: Robert McNees on May 9, 2007 10:01 PM | Permalink | Reply to this

Re: SVG in Comments

Yes, exactly the same for me!: Nothing to be seen first, nice graphic visible once I click on “Post a New Comment”.

Firefox 1.5.0.11.

Posted by: urs on May 9, 2007 10:05 PM | Permalink | Reply to this

Re: SVG in Comments

The bug that Jacques described above is definitely part of the problem. The difference between the main thread on his blog and the comments in the pop-up window is that the main thread has a hash # in the address, which kills gradients for some reason.

This explains why you won’t see gradients if you reach this thread via an address containing a ‘#’. However, I don’t think it’s the whole story, because I also experienced a problem with the gradient (in the example above) disappearing after several refreshes. Maybe I accidentally clicked on the ‘permalink’.

In either case, if you are using a recent build of firefox on Windows or Linux (the two cases I have checked), you won’t see gradients in svg for any urls containing a #. Outlines should still appear; it’s just that the example above isn’t stroked.

Posted by: Robert McNees on May 10, 2007 12:57 AM | Permalink | Reply to this

Re: SVG in Comments

You can verify this by appending a # to the end of the url for this page and then clicking reload. Scroll down to this part of the thread and you’ll see that all the gradients have vanished.

Posted by: Robert McNees on May 10, 2007 1:03 AM | Permalink | Reply to this

Re: SVG in Comments

Jacques keeps improving the SVG support here. Now the coding has been simplified a little more. For details, see his SVG Redux.

Posted by: urs on May 2, 2007 4:41 PM | Permalink | Reply to this
Read the post The First Edge of the Cube
Weblog: The n-Category Café
Excerpt: The notion of smooth local i-trivialization of transport n-functors for n=1.
Tracked: May 4, 2007 9:01 PM

Re: TeXnical Issues

I suspect this is probably not something easily fixable in the blogging software but: is there a reason why the comment box appears to be a fixed size in pixels? It’s a bit annoying because I’ve got a largish screen and use larger than default-size fonts but the comment box resolutely sticks to its size, which means I get about 36 characters on a line in the comment box. This makes seeing larger stretches of the text for editing annoying.

Posted by: dave tweed on June 15, 2007 6:10 PM | Permalink | Reply to this

Resizing <textarea>s

I don’t know how many times this question has been asked. The answer is always the same.

All <textarea>s come in a fixed size. This one is 42×10 characters. There is, however, no one size that will suite everyone.

In a browser that supports CSS3 (specifically, the resize property), like Safari, the <textarea> has a thumb that you can drag to resize it.

In other browsers, in particular, in the Mozilla family of browsers, there’s a bookmarklet that allows you to resize any <textarea> with a click of the mouse and a drag.

There are also a couple of Firefox extensions and greasemonkey scripts that do the same thing. (More can be found with a little Googling around.)

Between all of these options, I think you can find something that will work for you. In the longer term, lobby you browser vendor for CSS3 resize support.

[Updated with current, non-broken, links. No, I haven’t tried all permutations and combinations of these solutions. YMMV.]

Posted by: Jacques Distler on June 15, 2007 7:21 PM | Permalink | PGP Sig | Reply to this

Re: Resizing <textarea>s

I’m using Safari and I see no “thumb”.

Posted by: John Armstrong on June 15, 2007 8:12 PM | Permalink | Reply to this

Re: Resizing <textarea>s

I think it only works in Safari 3, which is currently in public beta.

Posted by: Robin on June 15, 2007 8:54 PM | Permalink | Reply to this

Safari

Safari Beta 3 supports the aforementioned <textarea> resizing and inline SVG (as seen in some of the comments above). It’s available for both Mac and Windows.

It doesn’t do MathML, alas.

Posted by: Jacques Distler on June 15, 2007 9:03 PM | Permalink | PGP Sig | Reply to this

Re: Resizing <textarea>s

I’m using Firefox 2.0.0.4 and have installed the extension Resizable Form Fields 0.2.4 and can resize the forms at, for example,the extensions site mentioned above, but I can’t resize the box I’m typing this comment in. Am I missing something?

Posted by: Simon Willerton on June 16, 2007 6:44 PM | Permalink | Reply to this

Resizing textarea

Hooray, the Greasemonkey scripts for resizing the tiny comment box work! I also couldn’t get the Firefox extension