LaTeX on these boards

Random questions or observations about and around computers
User avatar
Vincent
Posts: 3041
Joined: Fri Apr 07, 2006 12:10 pm
Location: Schtroumpf
Contact:

LaTeX on these boards

Postby Vincent » Sun Feb 21, 2010 10:42 am

Hello,

Thanks to the wonderful Math\TeX CGI ( http://www.forkosh.com/mathtex.html ), 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.
{ Vincent Hugot }

User avatar
Mathias COQBLIN
Membre projet CRT
Posts: 130
Joined: Mon Apr 13, 2009 10:20 pm
Location: 127.0.0.1
Contact:

Re: LaTeX on these boards

Postby Mathias COQBLIN » Sun Feb 21, 2010 4:42 pm

Hm... sexy font selection.
Your mom is so fat she sat on a binary tree and turned it into a linked list in constant time!

User avatar
Vincent
Posts: 3041
Joined: Fri Apr 07, 2006 12:10 pm
Location: Schtroumpf
Contact:

Re: LaTeX on these boards

Postby Vincent » Mon Feb 22, 2010 4:15 pm

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)
{ Vincent Hugot }

User avatar
Vincent
Posts: 3041
Joined: Fri Apr 07, 2006 12:10 pm
Location: Schtroumpf
Contact:

Re: LaTeX on these boards

Postby Vincent » Mon Dec 19, 2011 6:24 pm

There are now two Math\TeX services running: (see http://www.forkosh.com/mathtex.html for use instructions)

Code: Select all

FAT  service:   tex.vhugot.com/cgi-bin/fat.cgi?
THIN service:   tex.vhugot.com/cgi-bin/thin.cgi?


The fat service loads my sk2 package, and thus will render, say, \Sum k1n properly: tex.vhugot.com/$\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:   tex.vhugot.com/$
THIN service:   tex.vhugot.com/!

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: http://tex.vhugot.com/info. Furthermore, build.sh 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:   tex.vhugot.com/cgi-bin/fat.cgi?
THIN service:   tex.vhugot.com/cgi-bin/thin.cgi?


Current Math\TeX version:
\version


edit: googlebot confuses me:
Spoiler: Reveal

Code: Select all

66.249.72.115 - - [20/Dec/2011:00:17:02 +0100] "GET /robots.txt HTTP/1.1" 404 505 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.72.115 - - [20/Dec/2011:00:17:02 +0100] "GET /$%5Cgl HTTP/1.1" 200 421 "-" "Googlebot-Image/1.0"
66.249.72.115 - - [20/Dec/2011:00:18:18 +0100] "GET /$%5Capprox HTTP/1.1" 200 428 "-" "Googlebot-Image/1.0"
66.249.72.115 - - [20/Dec/2011:00:20:26 +0100] "GET /$%5CZ%20%5Cto%20%5CZ HTTP/1.1" 200 595 "-" "Googlebot-Image/1.0"
66.249.72.115 - - [20/Dec/2011:00:22:37 +0100] "GET /$%5Cgl%20x%20y%20.%20E HTTP/1.1" 200 640 "-" "Googlebot-Image/1.0"
66.249.72.115 - - [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: 66.249.72.115
Host name: crawl-66-249-72-115.googlebot.com
66.249.72.115 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 tex.vhugot.com/info.

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.
{ Vincent Hugot }


Return to “Miscellaneous”

Who is online

Users browsing this forum: No registered users and 79 guests