Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know it is possible to check the box "Include headers on first page" in the "Headers and Footers" dialog box of the Print Settings menu item, but is it also possible to check this using commands in the Notebook itself? It would be for the current notebook.

Thanks for all help, as always!

share|improve this question

2 Answers 2

up vote 2 down vote accepted
SetOptions[EvaluationNotebook[], PrintingOptions -> {"FirstPageHeader" -> True}]

You can open $InstallationDirectory/SystemFiles/FrontEnd/SystemResources/HeadersFootersDialog.nb as text file and find all possible options. For completeness I want add that with

SetOptions[EvaluationNotebook[], PageHeaders -> {{"a1", "a2", "a3"}, {"a4", "a5", "a6"}}]

you can set headers. See also: PageHeaders, PageFooters, PageHeaderLines, PageFooterLines.

share|improve this answer
    
sorry, I didn't mean to copy your answer, my browser didn't refresh (a.k.a. I didn't pay attention) :) –  Pinguin Dirk Sep 12 '13 at 19:55
    
@PinguinDirk Don't worry. Firstly I didn't read question carefully and post only the second part of my answer. When I realized my mistake I delete answer. Then I find true options and undelete it in the same time as you :) –  ybeltukov Sep 12 '13 at 20:02
    
ah that's why it appeared out of the sudden with 28mins on the timer. Advanced cheating :) I am glad my brain didn't play any tricks on me then –  Pinguin Dirk Sep 12 '13 at 20:08
    
@ybeltukov: Why is it necessary to add the curly braces around the "PrintingOptions->..." and doesn't this command work SetOptions[EvaluationNotebook[], PrintingOptions -> {"FirstPageHeader" -> True}] without the "extra" curly braces? Thanks! –  Gabriel Sep 12 '13 at 20:18
    
@Gabriel Yes, they aren't necessary, I deleted them. –  ybeltukov Sep 12 '13 at 20:23

As per @ybeltukov below is what I have in my stylesheet, implemented here as SetOptions

SetOptions[EvaluationNotebook[],
  PrintingStartingPageNumber -> 1,
  PageHeaders -> {
    {Cell[TextData[{CounterBox["Page"]}], "PageNumber"], None, None},
    {None, None, 
     Cell[TextData[{CounterBox["Page"]}], "PageNumber"]}},
  PageFooters -> {{None, None, None}, {None, None, None}},
  PrintingOptions -> {
    "PrintingMargins" -> {{90, 90}, {60, 90}},
    "PaperSize" -> {596, 794},
    "PageSize" -> {596, 794},
    "PageHeaderMargins" -> {60, 60},
    "PageFooterMargins" -> {30, 30},
    "FirstPageFace" -> Right,
    "FirstPageHeader" -> False,
    "FirstPageFooter" -> False}
    ]

I'd recommend having a look at the printing options settings in the options inspector and figure out what you want your base case to be, and then include those settings in a stylesheet within the "Notebook" style data.

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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