84 Changing Page Margins in PDF Exports
You might want the page margins in your book to be smaller, or larger. You can adjust this using the Custom CSS feature. (Please read this first!).
Changing Margins (Left & Right Pages are the Same)
In your Custom CSS, PDF version, add the following to define your page margins. For instance, if you want to make your top and bottom margins 2in, and your side margins 1.5in, you would add the following code:
@page {
margin-top: 2in !important;
margin-bottom: 2in !important;
margin-left: 1.5in !important;
margin-right: 1.5in !important;
}
NOTE: the !important
is … important. It makes sure your settings override what Pressbooks sets as page size.
Changing Margins (Left & Right Pages are Different)
You may want your left and right pages (recto/verso) to have different margins, so that for instance the outside margins are wide, and the inside margins are tighter. In this case you would add the following:
@page:left {
margin-top: 2in !important;
margin-bottom: 2in !important;
margin-left: 3.5in !important;
margin-right: 1.5in !important;
}
@page:right {
margin-top: 2in !important;
margin-bottom: 2in !important;
margin-left: 1.5in !important;
margin-right: 3.5in !important;
}