I am about to send a Mathematica notebook to someone and I would like to make sure it does not contain any information that could personally identify me. I would also like to produce pdf files from the notebook and would like them to be metadata-free. Do I need to 'scrub' the file from some intrinsic metadata (as you would need to do, carefully, say, for an MS Word file), or do they generically not include any such information?

If they do contain metadata,

  • what can it be?
  • where is it? and
  • how can I scrub it?
  • 12
    $\begingroup$ Not directly, but I suppose it could store the file path of custom stylesheets, which might identify you. You can turn off FileOutlineCache in the options inspector, which only leaves the notebook expressions behind (paths will still remain). You might also want to disable/remove the CellChangeTimes so mask when you were active/your time zone, etc. $\endgroup$
    – rm -rf
    Sep 8, 2013 at 21:44
  • 11
    $\begingroup$ You can examine the entire notebook in a text editor to make certain it doesn't contain anything you don't want to include, but honestly, it will only have in it what you put in it. $\endgroup$
    – Jagra
    Sep 8, 2013 at 23:01
  • 1
    $\begingroup$ Thanks to both, that's good to know. As it's part of a refereeing process it's important for the journal to know that there isn't something hidden in there. $\endgroup$ Sep 8, 2013 at 23:36
  • 6
    $\begingroup$ I will emphasize what @Jagra says: check in a text editor. I've made pdfs from notebooks, and learned that they contained identifying information I'd have preferred not be there. Indeed, an important case was precisely for a referee report. Taking this one step further: also check in a text editor any file you might send, that was generated from the nb. $\endgroup$ Sep 9, 2013 at 15:50
  • 2
    $\begingroup$ Unfortunately, no. The reason being I no longer recall the details (this was maybe 2 years ago). It may have been relatively benign, something like just having the name of the original notebook complete with the .nb extension. Not such a bad thing usually, but a strong identifier if one happens to be the only possible referee who uses Mathematica. It is also possible that there was a file path but I don't think it was that serious. $\endgroup$ Sep 9, 2013 at 19:45

1 Answer 1


On the encouragement of Kuba, I will collect in an answer the multiple comments (with due credit to rm -rf, Jagra, and Daniel Lichtblau) that do, to a large extent, answer the question. For me, the most important points are the following:

  • Mathematica notebooks do not, by themselves, store explicit personally identifying information such as author names, as you might get with e.g. MS Word, and pdfs printed from it.

  • However, there can be certain types of information in the notebook (including but not limited to cell editing times, custom style sheet locations, and the file path or filename of the notebook) that can show up in the notebook or pdfs printed from it, and which can reveal traits (such as timezone / active times, operating system, or the very use of Mathematica itself) which, depending on context, can end up identifying you. These features can be disabled as follows:

    • To remove the cell editing times,
      • go to Cell $\to$ Notebook History, and
      • click Clear History.
    • To prevent Mathematica from recording cell editing times,
      • go to Cell $\to$ Notebook History, and
      • uncheck the Track Notebook History option.
    • To remove the file outline cache,
      • go to Format $\to$ Options Inspector,
      • choose Show Option Values $\to$ Selected Notebook,
      • go to Notebook Options $\to$ PrivateNotebookOptions, and
      • change "FileOutlineCache" to False.

    Doing this will make the notebook much easier to read in a file editor, and therefore help in finding any further information you might wish weren't there.

  • Most importantly, notebooks can be opened externally with any text editor; with the exception of Graphics objects they are quite transparent to read. Thus, if this is a concern, you can and should have a good look at the notebook to see if there's anything there that you'd rather not be.

For the examples above, disabling CellChangeTimes will remove cell editing times from the notebook; turning off FileOutlineCache in the options inspector will leave only the notebook expressions behind, though paths to the stylesheets will remain. If you print a pdf from the notebook, it may still be a good idea to run it through a pdf metadata removal tool such as this one if metadata is an issue, just to be sure. The notebooks themselves, though, will have nothing in them that's not visible through a text editor.

  • $\begingroup$ In Mathematica 12.3. Edit > Preferences > Advanced, you can uncheck "Enable notebook history tracking". $\endgroup$ Dec 4, 2021 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.