Re: Re: HTMLSave and GIF size
- To: mathgroup at smc.vnet.net
- Subject: [mg25885] Re: [mg21109] Re: HTMLSave and GIF size
- From: coliste at ccr.jussieu.fr (Roberto COLISTETE-JUNIOR)
- Date: Tue, 7 Nov 2000 02:55:57 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Dear Mathematica users, The code cited below by P.J. Hinton didn't work with me. I use Mathematica 4.0.2 for Windows. I just want to choose the page width when exporting notebooks to HTML, with GIFs or without (in texts, for example). Maybe there is a simple trick... Thanks in advance, Roberto Colistete Junior P.J. Hinton wrote: > > In article <831igt$df7 at smc.vnet.net>, Pasquale Nardone > <Pasquale.Nardone at ulb.ac.be> writes: > > >how can I change the gif size > >of the MathOutput ? > > > >(they are too small) > >thanks a lot > > What version of Mathematica are you using? If you are running > Mathematica 3.0, there isn't much you can do, but 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. > > -- > P.J. Hinton > Mathematica Programming Group paulh at wolfram.com > Wolfram Research, Inc. > Disclaimer: Opinions expressed herein are those of the author alone.