MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Exporting formulae as GIFs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22771] Exporting formulae as GIFs
  • From: "Atul Sharma" <atulksharma at yahoo.com>
  • Date: Fri, 24 Mar 2000 03:28:33 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

$Version
4.0 for Microsoft Windows (July 26, 1999)

When I stumbled across this in the archive, I was delighted. Unfortunately,
I had no luck using it.
And since I have no idea what this code is doing (or why the number of
seconds since Jan. 1, 1901 would even be called as part of a window size
routine!!), I thought I would ask if anyone else had better luck with it? Or
whether the problem of GIF formulae being cut off after the first 4" had
another solution. Since this is the presumably the same method used for the
dynamic display of formulae at the Integrator web site, surely there is a
solution.

:)

A. Sharma

----------------------------------------------------------------------
Atul Sharma MD, FRCP(C)
Pediatric Nephrologist,
McGill University/Montreal Children's Hospital

-*********************************************************
On Dec. 17, P. Hinton wrote:

... for Mathematica 4, there is a simple fix that can be applied.

Add this snippet of code to your kernel init.m file.

[begin snippet]

HTMLSave;
Begin["System`Convert`HTMLDump`"];
createGIF[channel:(_OutputStream | _String), nbExpr_Notebook, opts___] :=
  Module[    {cells, nbopts, convexpr},
    cells = nbExpr /. Notebook[cellList_List, ___] -> cellList;
    nbopts = nbExpr /. Notebook[_, optSequence___] -> {optSequence};
    nbopts = DeleteCases[nbopts, WindowSize -> Automatic, -1];
    (* Needed to keep the front end aware of window size *)
    nbopts = nbopts /. Rule[WindowSize, {width_, height_}] :>
      Rule[WindowSize, {width, 384 + Mod[FromDate[Date[]], 384]}];
    convexpr = Notebook[cells, Sequence @@ nbopts];
    Rest @ System`Dump`PutGIF[convexpr, channel,
      Sequence @@ System`Dump`DisplayToGIFOptions[opts]]  ]End[][end
snippet]

This code will force HTMLSave[] under Mathematica 4 to use the current
notebook window width as the basis for the linebreak calculation of
multiline formulae.  It is very close to what you see on screen.



  • Prev by Date: Re: newby plotting question
  • Next by Date: Re: newby plotting question - problem solved, thanks much!
  • Previous by thread: Re: Working with lists of matrices.
  • Next by thread: Re: Exporting formulae as GIFs