Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror margins #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions book.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@
* settings are different from the baove ones in that they can be overriden
* through CSS to provide more advanced designs (see the above note on
* pagination.css).
*
*
* mirrorMargins: true -- If true outerMargin and innerMargin will be
* contraries for odd and even pages.
*
* outerMargin: .5 (inch)-- This controls the margin on the outer part of the
* page.
*
Expand Down Expand Up @@ -209,6 +212,7 @@
'marginnoteSelector': '.pagination-marginnote',
'maxPageNumber': 10000,
'columnSeparatorWidth': 0.09,
'mirrorMargins': true,
'outerMargin': 0.5,
'innerMargin': 0.8,
'contentsTopMargin': 0.8,
Expand Down Expand Up @@ -365,15 +369,21 @@
headerTopMargin + ";}" +
"\n#pagination-toc-title:before {content:'Contents';}" +
"\n#pagination-tof-title:before {content:'Figures';}" +
"\n.pagination-page:nth-child(odd) .pagination-contents-container, " +
".pagination-page:nth-child(odd) .pagination-pagenumber," +
".pagination-page:nth-child(odd) .pagination-header {" + "right:" +
outerMargin + ";left:" + innerMargin + ";}" +
"\n.pagination-page:nth-child(even) .pagination-contents-container, " +
".pagination-page:nth-child(even) .pagination-pagenumber," +
".pagination-page:nth-child(even) .pagination-header {" + "right:" +
innerMargin + ";left:" + outerMargin + ";}" +
"\n.pagination-page:nth-child(odd) .pagination-pagenumber," +
+(paginationConfig['mirrorMargins']?
("\n.pagination-page:nth-child(odd) .pagination-contents-container, "
+ ".pagination-page:nth-child(odd) .pagination-pagenumber,"
+ ".pagination-page:nth-child(odd) .pagination-header {"
+ "right:"+outerMargin+";left:"+innerMargin+";}"
+ "\n.pagination-page:nth-child(even) .pagination-contents-container, "
+ ".pagination-page:nth-child(even) .pagination-pagenumber,"
+ ".pagination-page:nth-child(even) .pagination-header {"
+ "right:"+innerMargin+";left:"+outerMargin+";}"):
/*else*/
("\n.pagination-page .pagination-contents-container, "
+ ".pagination-page .pagination-pagenumber,"
+ ".pagination-page .pagination-header {"
+ "right:"+outerMargin+";left:"+innerMargin+";}"))
+ "\n.pagination-page:nth-child(odd) .pagination-pagenumber," +
".pagination-page:nth-child(odd) .pagination-header {" +
"text-align:right;}" +
"\n.pagination-page:nth-child(even) .pagination-pagenumber," +
Expand Down