Message Boards Message Boards

0
|
15575 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Reduce a Mathematica Notebook file size?

I'm working with what I believe to be a pretty basic Notebook in Mathematica 10.4.1.0 on Mac OS X 10.11.6. There are no complicated graphics, and all of the calculations are simple and don't produce large amounts of output. However, the Notebook file size is almost 300 megabytes. I cleared the Notebook history, and resaved the document, but the file size did not change. It has become unwieldy and performance is suffering.

Is there any way to determine what might be causing a Notebook's file size to be so large? Any tips or tricks on how to optimize or reduce the size of the file?

Thank you!

POSTED BY: Christopher Fox
6 Replies

Select large cell and then go:

Cell >> Cover To >> Bitmap

enter image description here

POSTED BY: Sam Carrettie

Concerning graphic outputs, I use the following trick each time I have a big plot

...A plot... // Rasterize

for instance:

ArrayPlot[M] // Rasterize

Using rasterized outputs significantly reduces the notebooks size.

POSTED BY: Vincent Picaud

Thank you, everyone. The Cell Sizes palette was a huge help.

POSTED BY: Christopher Fox

Take a look at:

http://mathematica.stackexchange.com/questions/87102/notebook-cells-space-on-disk-profiler/87117#87117

I use the palette developed by Albert Retey to identify lager cells in my notebooks. Also, you can open the notebook in a good text editor to have a better idea of what is going on.

POSTED BY: Gustavo Delfino

Try splitting the notebook into half, repeatedly, in hope of isolating the source of the problem. Or open the notebook with a text editor that can handle that size: you may be lucky and spot an offending monstrous cell.

POSTED BY: Gianluca Gorni

Notebook history would have nothing to do this this--calculation history is contained in Mathematica memory for the current session, not in the notebook.

If you have 3D graphics then one can get very large notebooks.

If you remove all output and all graphics (do this on a copy of the notebook, of course, so you don't loose your current results) does the size of the file drop down to a reasonable one.

If so, and is should, one can then experiment by deleting just specific parts of the notebook -- particular graphics -- to track down the culprit.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract