[racket] Literate Programming and Scribble

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Sep 9 23:31:51 EDT 2010

On Sep  9, Neil Van Dyke wrote:
> Eli Barzilay wrote at 09/09/2010 10:21 PM:
> >   * Compute some "unique" checksum of this content (eg, its sha1) to
> >     be used as the file name,
> 
> If the math source format is in TeX syntax (which most people would
> say it should be), I'd think that you could avoid computing the
> secure hash, and just use an escaped variation of the TeX syntax
> string as the filename.
> 
> Escaped strings longer than the max filename length for the underlying 
> filesystem (255 chars for ext2) can be split into subdirectories,

But these kinds of limits are easy to exceed.  (Not to mention that
you need to think about the host of other tools that might have
problems -- like tarring up a directory, serving it through http,
etc.)


> so long as you don't exceed the effective max pathname limit for
> your OS and tools (which might be 1KB or 4KB or so, unless you have
> the misfortune of running on Windows).
> 
> A side benefit is that your filenames are almost TeX syntax.

...which begs an alternative solution: make a FUSE filesystem where
every file is a png or a pdf of its name.  Something like making

  "/special/tex/...some-formula-in-tex-syntax.pdf"
  "/special/tex/...some-formula-in-tex-syntax.png"

automatically work.


On Sep  9, Karl Winterling wrote:
> Eli Barzilay wrote:
> 
> > Using images sound like the usual fragile solution, so ideally there
> > will be some better solution for both latex/pdf and html in the
> > future.  (But it's been more than a decade that math-in-a-browser is
> > "just around the corner".)
> 
> There's MathJax (http://www.mathjax.org) which accepts LaTeX (yes,
> and \newcommand) or MathML as input and can render images, MathML,
> or HTML-CSS based on browser support and user preferences. It
> supports copy and paste into LaTeX files and any program that
> supports MathML like MathType or Mathematica. Apparently, though,
> people think that the API isn't robust enough yet for Web
> application support.
> 
> MathML is important to support because applications like screen
> readers can use it, but it's a very good way of representing math
> statically.  Unfortunately, math typesetting support is a fairly low
> priority for most applications since few people want it and it
> involves writing nontrivial code (like a TeX parser).

That's exactly the problem -- mathml is something that I looked at (a
*long* time ago), and guess what -- support in major browsers was a
major problem.

MathJax is the best solution I've seen so far -- but it's kind of
cheating...  "If we can't get broad support for renering math, we'll
do it ourselves."  This makes the result much less appealing as proper
support -- like relying on js (probably means that things break left
an right if I want to view local file:// html pages), or like
requiring me to upgrade a js library when they have a new version (or
maybe I can use code from their site, but then I rely on their server
to have my documents in working shape).

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.