1 Aug 2002 02:11

### Re: Re: [Wikipedia-l] Re: Parsing TeX

On Wed, Jul 31, 2002 at 02:02:48PM -0700, lcrocker@... wrote:
> > I've hacked the phpwiki code to add a new namespace
> > [[math: ]] so you can write formulas like [[math:a^2+b^2=c^2]] or
> > [[math:\sum_{n=0}^{\infty}\frac{1}{n}=\infty]].
> >
> > The code will make TeX create an image (PNG) of the formula. Those
> > images will be cached, they will be created only once and will be
> > shared between articles. ( [[math:E=m c^2]] might be used on many
> > pages ).
>
> That's almost exactly what I had in mind; only I think it would be
> better for the back end to have to have a spearate process
> communicating with the Wiki code over IPC--the "TeX server"--
> which will take formulas and return images, out of a cache if
> they've been rendered already, calling TeX to render them if needed.
> The cache will be indexed by a hash function on a canonicalized
> text of the expression.
>
> The wiki end of this won't be hard.  The other server is the real
> work.  I'm afraid I can't take on that project right now, but if
> that server gets built, I'll be happy to call it.

Hi,

I moved this to wikitech-l since it will be much to detailed for
wikipedia-l.

The code is ready. It doesn't use IPC, no client/server. It only
exec's a shell script.


(Continue reading)

1 Aug 2002 11:37

### Re: Re: Re: [Wikipedia-l] Re: Parsing TeX

On Thu, Aug 01, 2002 at 02:11:46AM +0200, Jens Frank wrote:
>
> For an example see
>
> 	http://jeluf.mine.nu/jf/newcodebase/wiki.phtml?title=Triangle

It looks beautiful. That is going to make a lot of the contributers on
mathematics very happy. A few comments though:

I'd prefer a bit shorter and easier-to-read mark-up. Axel Boldt suggested [$x \leq y$] and Toby Bartels $$x \leq y$$. Since $$already means something in LaTeX I'd prefer Axel's suggestion. Maybe we could even let [$$
x \leq y ] be a displayed formula? There should be a difference between
in-line and displayed formula.

It would be nice if we could stay close to what is done on planetmath.org so
that it wouldn't be too hard to interchange write-ups. They are working with
a separate preamble in which you can include extra packages. That's very
nice if you want to do special stuff like commuting diagrams in category
theory. However, I can see how that would complicate the implementation and
one could ask if it would be worth it. At least our assumed preamble should
be very similar to their default preable.

Concerning safety I think I'd prefer Lee's solution including a time-out for
TeX that takes too long to compute. It's the most robust solution and other
solutions like parsing (a limited subset of) TeX would probably mean that we
would have to decide which subset we support which would probably turn out
to be too restrictive.

-- Jan Hidders

(Continue reading)

1 Aug 2002 12:51

### DNS entry for wikipedia.com

Are there any reasons that the DNS entry for wikipedia.com still
points to the old server rather than to the new? When I type a URL
into a browser, I always omit the "www", expecting that it won't make a
difference.

Axel


1 Aug 2002 13:27

### TeX security

Neil wrote:

>We should also be really cautious about TeX doing insecure things. Is
>there a subset of TeX syntax we could parse and validate before we
>pass it to TeX?

There are two dangerous commands in TeX: the ability to write to
arbitrary files, and the ability to call shell scripts. Both are
disabled in all standard TeX distributions. Parsing and validating is
thus not necessary (and next to impossible without reimplementing a
good chunk of TeX). We have to start TeX in a temporary directory
which is cleaned out afterwards, and we have to guard against
run-away TeX processes which eat time and/or memory. The TeX process
needs to have its resources limited.

See also the discussion at http://groups.google.com/groups?threadm=d55ab765.0111091929.1e4b9af4%40posting.google.com&rnum=1

Axel


1 Aug 2002 13:58

### Re: Re: Re: [Wikipedia-l] Re: Parsing TeX

On Thu, Aug 01, 2002 at 11:37:08AM +0200, Jan.Hidders wrote:
> On Thu, Aug 01, 2002 at 02:11:46AM +0200, Jens Frank wrote:
> >
> > For an example see
> >
> > 	http://jeluf.mine.nu/jf/newcodebase/wiki.phtml?title=Triangle
>
> It looks beautiful.

No it doesn't.

On my Konqueror with fairly big fonts all TeX-generated images are
much too small and placed too low.

Screenshot of paragraph is attached.

What should be done is:
* size of it should be configurable by user
* they should always be vertically aligned in a way that looks nice in
case of bigger or smaller fonts.

1 Aug 2002 13:59

### TeX security

I just realized that TeX by default can also read all files on the
system that the process has permissions to read, and we may want to
restrict that; this is done with the line
openin_any = p
in the file texmf.cf.

Axel


1 Aug 2002 14:13

### Generating TeX

JeLuF wrote:

> The script
> - renders TeX to DVI using LaTeX
> - converts DVI to eps using dvips
> - renders eps to PNG using convert from ImageMagick

Pdftex combined with a pdf-to-png converter should be faster since it
skips a conversion step.

Axel


1 Aug 2002 14:16

### Re: Re: Re: [Wikipedia-l] Re: Parsing TeX

On Thu, Aug 01, 2002 at 01:58:55PM +0200, Tomasz Wegrzanowski wrote:
>
> On my Konqueror with fairly big fonts all TeX-generated images are
> much too small and placed too low.

Strange, because it says 'align="middle"'. What does Konquerer do on
www.planetmath.org? Do you like their set-up if you view with big and small
fonts? On my IE it looks acceptable.

-- Jan Hidders


1 Aug 2002 14:43

### Re: Re: Re: [Wikipedia-l] Re: Parsing TeX

On Thu, Aug 01, 2002 at 02:16:33PM +0200, Jan.Hidders wrote:
> On Thu, Aug 01, 2002 at 01:58:55PM +0200, Tomasz Wegrzanowski wrote:
> >
> > On my Konqueror with fairly big fonts all TeX-generated images are
> > much too small and placed too low.
>
> Strange, because it says 'align="middle"'. What does Konquerer do on
> www.planetmath.org? Do you like their set-up if you view with big and small
> fonts? On my IE it looks acceptable.

http://planetmath.org/?op=getobj&from=objects&id=947

On attached screenshot first and third images (heigth 34)
are aligned well, the second (heigth 37) is a bit too low,
but it's acceptable.

Does TeX have some trick which would allow us to get information about
how generated images should be placed in final text ?
It certainly uses such algorithm internally.
That might be the best solution.

But doing it the way planetmath does is still ok.

3 Aug 2002 22:56

### Why there is no rsync yet ?

It should be easy to add, but it still hasn't been added.
If it's just because Jimbo is too busy, could he give some other
person access to Wikipedia server so that rsync can be set up ?

The fact that tarball is generated only once per day is serious
problem for topological analysis that must be done in Polish
Wikipedia to make optimal start page.



Gmane