7
$\begingroup$

Mathematica has a strange behavior with respect to printing and saving to PDF. It remembers the print settings, such as page range and number of copies along with the file. So if I print 50 copies of a file for a large class, and six months later open the file to print a copy for myself, the default is 50 copies. If instead I export the file as PDF, the PDF file will contain 50 copies of the content of notebook. I have been using software since 1974. I have worked extensively with dozens of software packages, word processors, spreadsheets, program editors, software development environments, and computer algebra systems. In my experience, Mathematica is the only software package with this frustrating behavior. Is there a setting or edit of initialization files that will cause Mathematica to default to all pages and 1 copy each time a notebook is opened?

$\endgroup$
5
  • 1
    $\begingroup$ SetOptions[EvaluationNotebook[], PrintingCopies -> 1] $\endgroup$ Jan 25, 2015 at 22:21
  • $\begingroup$ @Mike I've never seen/noticed that before. It doesn't seem "easily found in the documentation" -- would you post an answer? $\endgroup$
    – Mr.Wizard
    Jan 26, 2015 at 22:52
  • $\begingroup$ @Mr.Wizard ok. but it look like it is about to get closed?? $\endgroup$ Jan 26, 2015 at 23:18
  • $\begingroup$ @Mike I voted to leave it open. I think it's a good question. Do you disagree? $\endgroup$
    – Mr.Wizard
    Jan 26, 2015 at 23:19
  • 2
    $\begingroup$ Maybe printing is not regarded as important by WRI? But of course it is and will be and it is possible to produce good and not to large PDF's with Mathematica and also fiddle with all the options, like PrintingCopies, but it is not really fun (e.g.: try to programatically add headers and footers: only possible by inspection and trial and error and luck). $\endgroup$ Jan 26, 2015 at 23:35

1 Answer 1

8
$\begingroup$

A wide variety of print settings can be stored within a given notebook. If you are observing print settings that appear to differ from the default settings then my guess is that inadvertently some unwanted settings have been localized to the notebook. You can check this via the Options Inspector. For your specific problem you can ensure that the notebook will print only one copy by setting the PrintingCopies option for that notebook. You can do this via the Options Inspector:

enter image description here

or programmatically:

SetOptions[EvaluationNotebook[], PrintingCopies -> 1]

Edit

I just noticed that PrintingCopies -> 1 is stored in my FrontEnd init.m file so it may also be worth you checking that and modifying the setting if it exists, or deleting it altogether.

$\endgroup$
5
  • 1
    $\begingroup$ +1 of course. I believe the OP is asserting that PrintingCopies is set every time he prints. I did not confirm this yet but if it is the case then it is not simply "inadvertently some settings have been localized" but an ongoing problem. $\endgroup$
    – Mr.Wizard
    Jan 26, 2015 at 23:29
  • 1
    $\begingroup$ Yes indeed, in 10.0.2 printing (to file) three copies of a Notebook resulted in {PrintingCopies -> 3}. $\endgroup$
    – Mr.Wizard
    Jan 26, 2015 at 23:32
  • 1
    $\begingroup$ @Mr.Wizard the setting of that option when you print must be a Windows thing. On my Mac with 10.0.2 I just queued 50 copies and then again 5 copies with my printer off, the printing task is showing in the printer window but no change was made to the notebook options. I didn't go all the way to let the print job complete to see if that results in the local notebook options being changed. $\endgroup$ Jan 26, 2015 at 23:40
  • 1
    $\begingroup$ It seems as though once the Option has been set for the Notebook it is not changed again, so setting SetOptions[EvaluationNotebook[], PrintingCopies -> 1] should "inoculate" it against automatic changes. $\endgroup$
    – Mr.Wizard
    Jan 26, 2015 at 23:41
  • $\begingroup$ Thank you so much, I had been fighting with this problem for a long time. $\endgroup$
    – Virgo
    Aug 15, 2017 at 1:31

Your Answer

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

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