Page 1 of 1

LaTeX on these boards

Posted: Sun Feb 21, 2010 10:42 am
by Vincent

Thanks to the wonderful Math\TeX CGI ( ), I have just added \LaTeX support to these boards.

Additionally, my (embryo of) package sk2 is supported, so expressions like

Code: Select all

will correctly render: inline math :[tex]X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k[/tex]... etc. Compare to displayed equation:

[dtex]X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k[/dtex]
Some variations of fonts (everything in Texlive-full is supported):
[dtex]\usepackage{pxfonts}\x{pxfonts}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k[/dtex]...
will correctly render: inline math :X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k... etc. Compare to displayed equation:

X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k
Spoiler: Reveal
Some variations of fonts (everything in Texlive-full is supported):
\usepackage{pxfonts}\x{pxfonts}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\usepackage{cmbright}\x{cmbright}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\usepackage{euler}\x{euler}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\usepackage{eulervm}\x{eulervm}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\usepackage[math]{iwona}\x{iwona}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\usepackage{mathptmx}\x{mathptmx}\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

\x{Computer Modern (gif)}\gif\qquad X_i \incl A \iff \card{ \Union_{s\in X_i} \ga(s)} \< \Sum k1n \gb_k

NOTE: If you don't see a big math formula above, then something is broken. Please complain on this topic if this is the case ;)

If the formulas look garbled and barely legible, except the last one in the spoiler, then you are using the piece of garbage known as Internet Explorer 6 (culprit in this case: broken PNG support). Do yourself a big favour and switch to a real browser.

Re: LaTeX on these boards

Posted: Sun Feb 21, 2010 4:42 pm
by Mathias COQBLIN
Hm... sexy font selection.

Re: LaTeX on these boards

Posted: Mon Feb 22, 2010 4:15 pm
by Vincent
I have fixed alignment of inline math: it turns out that using

Code: Select all

<img src="..." align="middle">
actually aligns the bottom of the text with the middle of the image in some browsers. (source)
For instance, this is the case in Firefox 3.5.7.

I have therefore fixed it by using absmiddle.

Some test text with lots of inline math: please report if this looks bad in your web browser.
Spoiler: Reveal
  • cas vide trivial: L(ta(A)) = \emptyset , on conclut tout de suite dans tous les cas (linéaire)
  • cas diagonal (=_A \incl id_Q); on peut toujours décider (vide ou non vide), cf remarque dans Théorème 1 (linéaire)
  • cas règles impossibles triviales: eg. f(...q...) \to q'q=_A q'; un terme ne peut pas être structurellement égal à son propre fils. Si enlever les règles de cette forme conduit à L(ta(A)) = \emptyset, alors on conclut (linéaire)
  • cas états impossibles: si l'on a par exemple f(...q_1...)\to q_0,\dots,f(...q_n...)\to q_{n-1} et qu'on n'ait pas de règle qui permette de construire q_i sans q_{i+1}, et si q_0 =_A q_n, alors q_0 n'est pas constructible, pour la même raison qu'au dessus. Ca se détecte bien par une sorte de calcul de point fixe + test de L(ta(A)) = \emptyset, après avoir enlevé toutes les règles utilisant des états impossibles. (le tout doit être \approx quadratique, dans le pire des cas)

Re: LaTeX on these boards

Posted: Mon Dec 19, 2011 6:24 pm
by Vincent
There are now two Math\TeX services running: (see for use instructions)

Code: Select all

FAT  service:
THIN service:
The fat service loads my sk2 package, and thus will render, say, \Sum k1n properly:$\Sum k1n = \Sum k1n. It is meant mainly for my own use on these boards; it is used by the BBcodes. The thin service, on the other hand, does not (and cannot) load sk2. It is meant to be used by anyone who so wishes. That said, both are public and unrestricted, and have access to the totality of the TeXLive distribution.

More technical info:
Spoiler: Reveal

Code: Select all

FAT  service:$
THIN service:!
THIS INFO IS NOW OBSOLETE: turns out this syntax is incompatible with Chrome, for some reason...

Yes, the exact path to the CGI is hidden by the webserver; those interested in knowing how I have set this up can look at the .htaccess file here: Furthermore, gives the exact compilation parameters of the services.

Note that due to the URL rewriting, typing formulae directly in the address bar might be problematic, as browsers are likely to rewrite backslashes as simple slashes... since they do not detect a '?', they do not know that this is part of a CGI's argument and should not be touched... Of course this is irrelevant for use in HTML. In case that's a problem for you, just use the expanded version:

Code: Select all

FAT  service:
THIN service:
Current Math\TeX version:
edit: googlebot confuses me:
Spoiler: Reveal

Code: Select all - - [20/Dec/2011:00:17:02 +0100] "GET /robots.txt HTTP/1.1" 404 505 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +" - - [20/Dec/2011:00:17:02 +0100] "GET /$%5Cgl HTTP/1.1" 200 421 "-" "Googlebot-Image/1.0" - - [20/Dec/2011:00:18:18 +0100] "GET /$%5Capprox HTTP/1.1" 200 428 "-" "Googlebot-Image/1.0" - - [20/Dec/2011:00:20:26 +0100] "GET /$%5CZ%20%5Cto%20%5CZ HTTP/1.1" 200 595 "-" "Googlebot-Image/1.0" - - [20/Dec/2011:00:22:37 +0100] "GET /$%5Cgl%20x%20y%20.%20E HTTP/1.1" 200 640 "-" "Googlebot-Image/1.0" - - [20/Dec/2011:00:24:49 +0100] "GET /$%5Cgl%20x%20.%20(%5Cgl%20y%20.%20E) HTTP/1.1" 200 801 "-" "Googlebot-Image/1.0"
this renders, for instance \Z \to \Z = \Z \to \Z or \gl x . (\gl y . E) = \gl x . (\gl y . E). Nothing exceptional in itself... perhaps googlebot knows how to interact with a mathTeX service, why not... even though the syntax of mine is non-standard (no "mathtex.cgi" in the url). And this is a standard automated test...

Except... neither \Z nor \gl are valid in LaTeX; those come straight out of my own sk2 macro package. And those are not random strings that "coincidentally" hit some of my commands, those are perfectly formed expressions with meaning.

So, either Googlebot has finally become sentient and the singularity is upon us, or there are pesky humans masquerading as bots.

Note that it's not just the user agent string that identifies this as Googlebot: so does the IP:
IP address:
Host name: is from United States(US) in region North America

edit: Even worse, that IP never read this post; or anything on this forum for that matter so the guy would have needed to do so from another IP. And nobody so much as looked at the version of sk2 posted on

I really should stop reading the server logs, there are things that simply make no sense at all.

EDIT: mystery solved: the formulae came from this thread: viewtopic.php?f=19&t=843 . The damn bot should have included the referrer...
edit: now the \TeX code should be displayed on mouse-over with most browsers (both alt-text and title attributes are set to it).

edit: choice of resolutions:
Spoiler: Reveal
Not all resolutions are created equal: Consider for instance (\dpi{140}X \iff Y \implies Z \quad @ \textsf{dpi}=140), the implication sign \implies is visibly crooked. In fact most resolutions have this problem. I tested the range \intRange{120}{200}, and it turns out that only the resolutions in \intRange{120}{123} \union \intRange{149}{157}\union \sset{197} give a clear picture. Compare to (\dpi{123}X \iff Y \implies Z \quad @ \textsf{dpi}=123). So I chose 123 dpi for the default text mode resolution, and 157 dpi for the default displayed mode resolution.