Message Boards Message Boards

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

How to print a page break?

Posted 1 year ago

I'm afraid it's a silly question, but I don't know the answer.

When printing from a notebook via several Print[...] functions, how can one force a page break, i.e. a new page within the printed form of the notebook, e.g. after: Save as ...pdf.

I know of course the Cell options PageBreakAbove and the like. These can be used to create a notebook with page breaks, but not within the notebook itself.

POSTED BY: Werner Geiger
6 Replies

Werner, maybe this is what you are looking for:

CellPrint[Cell["", "PageBreak"]]
POSTED BY: Henrik Schachner
Posted 1 year ago

Great, Henrik. That's it. Thank you very much.

I don't know why I didn't try CellPrint. I thought it would be inserted directly under the evaluated cell, i.e. at the very beginning of all outputs and not in the correct order of print or other outputs.

Hence I use:

Print["Start"];
Print["1 of 2 lines\n2 of 2 lines"];
Echo["Now a pagebreak:"];
CellPrint[Cell["", "PageBreak"]];
Print["This line shall be on a new page"];
Print["End"];

enter image description here

POSTED BY: Werner Geiger
Posted 1 year ago

In the notebook: Menu item Insert -> Page Break

enter image description here

POSTED BY: Hans Milton
Posted 1 year ago

Hans, that's obvious of course. I asked how to Print a page break, i.e. programmatically, not manually.

POSTED BY: Werner Geiger
Posted 1 year ago

So then, obviously, the way to print a page break is to use the File->Print command.

POSTED BY: Eric Rimbey
Posted 1 year ago

No idea, Eric, what you mean by using File->Print for inserting a page break into output.

Anyway my issue was solved already by Henrik (see above).

POSTED BY: Werner Geiger
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