TOC Last Entry shifting to next page
Posted: Tue Jul 10, 2018 12:19 pm
Hi,
All the entries in a TOC are properly aligned except the last one.
All the entries in a TOC are properly aligned except the last one.
Code: Select all
@import 'p-optional-numbering-deep.css';
/* To hide the "Chapter NN." labels */
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
content:none !important;
}
:root {
widows:4;
orphans:4;
font-family: arial;
font-size: 11pt;
color: #000000;
font-style: normal;
}
/*-------------------------------
* The FRONT page layout.
*-------------------------------*/
@media print {
*[class~="front-page/front-page"] {
page: front-page;
}
*[class~="front-page/front-page-title"] {
display:block;
text-align:right;
padding-top: 2in;
padding-bottom: 2in;
text-transform: uppercase;
margin-top: 0.8in;
font-size: 32pt;
font-family: arial;
font-weight: bold;
}
@page front-page {
border-top: none;
border-bottom: none;
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden.";
font-size: 9pt;
}
}
}
/*-------------------------------
* The TOC page layout.
*-------------------------------*/
/* Clear the default headers */
@page table-of-contents {
@top-left { content: none; }
@top-center { content: none; }
@top-right { content: none; }
@bottom-left { content: none; }
@bottom-center { content: none; }
@bottom-right { content: none; }
}
@page table-of-contents:left {
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@top-left {
content: string(toc-header) " | " counter(page, lower-roman);
font-size: 8pt;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
@page table-of-contents:right {
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@top-left {
content: string(toc-header) " | " counter(page, lower-roman);
font-size: 8pt;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
/*Do not put a header on the first page of the TOC*/
@page table-of-contents:first:left
{
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
@page table-of-contents:first:right
{
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
/*-------------------------------
* The default page layout.
*-------------------------------*/
@page {
size: A4 portrait;
margin-left: 0.5in;
margin-right: 0.5in;
padding-top: 0.2in;
padding-bottom: 0.2in;
font-family: arial;
font-size: 12pt;
font-style: normal;
margin-top: 0.8in;
border-top: 0.01in solid orange;
margin-bottom: 0.8in;
border-bottom: 0.01in solid gray;
}
@page :left {
@top-left {
content: string(maptitle) string(chaptertitle);
font-size: 12pt;
}
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
@page :right{
@top-left {
content: string(maptitle) string(chaptertitle);
font-size: 12pt;
}
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
/*-------------------------------
* The chapter page layout.
*-------------------------------*/
@page chapter{
/* Currently inherit from the default page.*/
}
/* No headers on the chapter first page. */
@page chapter:first:left{
@top-left {
content: none;
}
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
@page chapter:first:right{
@top-left {
content: none;
}
@top-right {
content: url("logo.png");
width: 506px;
height: 56px;
image-resolution: 300dpi;
}
@bottom-left {
content: "© GreyOrange Pte. Ltd. 2018 - All rights reserved.";
font-size: 9pt;
}
@bottom-right-corner {
content: " | " counter(page);
font-size: 9pt;
}
}
/*-------------------------------
* The tables layout.
*-------------------------------*/
*[class~="topic/table"] {
hyphens: auto;
}
*[class ~= "topic/image"] {
prince-image-resolution: 300dpi;
-ah-image-resolution: 300dpi;
image-resolution: 300dpi;
}
*[outputclass ~= "side-by-side"] > *[class ~= "topic/p"] {
display:inline-block;
width: 45%;
}
*[outputclass ~= "side-by-side"] > *[class ~= "topic/fig"] {
display:inline-block;
width: 45%;
}
:root:after {
page: lp;
display: block;
content: " ";
margin-top: 50%;
text-align: right;
}
@page lp {
background-image: url("BC001.tif");
background-position: top left;
background-repeat: no-repeat;
border-top: none;
border-bottom: none;
@top-right {
content: none;
}
@bottom-left {
content: none;
}
@top-left {
content: none;
}
@bottom-right {
content: none;
}
@bottom-right-corner {
content: none;
}
border-top: 0in;
border-bottom: 0in;
}
Code: Select all
/*
* ======================================================
*
* Page, Chapter and Sections numbering, both in TOC and
* in the content.
*
* ======================================================
*/
/*
* Reset the counters on the root element.
*/
*[class ~= "map/map"] {
counter-reset: page 1
toc-chapter 0
toc-section1 0
toc-section2 0
toc-section3 0
toc-section4 0
chapter 0
section1 0
section2 0
section3 0
section4 0
figcount 0
tablecount 0;
}
/*
* =======================================
* Pages
*/
/*
Reset the page counter on the first topic that follows the TOC placeholder:
<ot-placeholder:toc xmlns:ot-placeholder="http://suite-sol.com/namespaces/ot-placeholder" />
The page counter was used in the p-toc generating numbers for the TOC pages.
*/
*[class ~= "map/map"] > *[class ~= "placeholder/toc"] + *[class ~= "topic/topic"]{
counter-reset: page 1;
}
/*
* =======================================
* TOC
*/
/*
* Increment the counters.
*/
*[class ~= "map/topicref"][is-chapter]:not([is-part]) {
counter-increment:toc-chapter;
counter-reset: toc-section1;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"]{
counter-increment:toc-section1;
counter-reset: toc-section2;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"]{
counter-increment:toc-section2;
counter-reset: toc-section3;
}
/*
All the parts get a part number.
Each chapter gets a chapter number.
All other topicrefs following a part do not have a number.
*/
*[class ~= "map/topicref"][is-part] {
counter-reset:toc-chapter !important;
counter-increment:toc-part;
}
/* All other topicrefs that follow a part should not have a number (i.e appendices) */
*[class ~= "map/topicref"][is-part] ~ *[class ~= "map/topicref"]:not([is-part]) > *[class ~= "map/topicmeta"]:before{
content: none !important;
counter-increment:none;
}
/*
* Showing the counters before the titles from TOC.
*/
/*
*[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before {
display:none !important; /\* In case this CSS is used in cascade with the classic numbering. *\/
}
*/
*[class ~= "map/topicref"] {
position:relative;
}
*[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
display:inline;
}
/*
*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"]:before {
left: -1.5em; /\* Increase the value of width and left as the depth increases. *\/
width:1em;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"]:before {
left: -1.5em;
width:1em;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
left: -2em;
width:2em;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
left: -2.5em;
width:2.5em;
}
*/
*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"]> *[class ~= "topic/navtitle"]:before {
content: counter(toc-part, upper-roman) "." " ";
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"]> *[class ~= "topic/navtitle"]:before {
content: counter(toc-chapter) "." " " !important;
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]> *[class ~= "topic/navtitle"]:before {
content: counter(toc-chapter) "." counter(toc-section1) " ";
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]> *[class ~= "topic/navtitle"]:before {
content: counter(toc-chapter) "." counter(toc-section1) "." counter(toc-section2) " ";
}
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]> *[class ~= "topic/navtitle"]:before {
content: counter(toc-chapter) "." counter(toc-section1) "." counter(toc-section2) "." counter(toc-section3) " ";
}
/*
* =======================================
* Content.
*/
/*
* Increment the counters.
*/
*[class ~= "topic/topic"][is-part]{
counter-increment:part;
counter-reset:chapter;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) {
counter-increment: chapter;
counter-reset:section1;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] {
counter-increment:section1;
counter-reset:section2;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] {
counter-increment:section2;
counter-reset:section3;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] {
counter-increment:section3;
counter-reset:section4;
}
/*
Front Matter and Back Matter and
all other topics that follow a part
should not define string sets, counters, etc..
*/
*[class ~= "bookmap/frontmatter"],
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"],
*[class ~= "bookmap/backmatter"],
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) {
counter-increment:none !important;
counter-reset: part chapter section1 section2 section3 section4 !important;
}
/*
* Alter the string sets that are shown in the header of the page.
*/
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"] {
string-set: parttitle " | " counter(part, upper-roman) " - " content(), chaptertitle ""; /* Avoid propagating a past chapter title on a new part */
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
string-set: chaptertitle " | " counter(chapter) " - " content(), sectiontitle "";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/title"] {
string-set: sectiontitle " | " counter(chapter) "." counter(section1) " - " content();
}
/*
Topics from Front Matter and Back Matter and
all other topics that follow a part
should not define string sets, counters, etc..
*/
*[class ~= "bookmap/frontmatter"] > *[class ~= "topic/title"],
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"],
*[class ~= "bookmap/backmatter"] > *[class ~= "topic/title"],
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) > *[class ~= "topic/title"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]{
string-set: parttitle "", chaptertitle "", sectiontitle "";
}
/*
* Use the numbers in front of titles in the content.
*/
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"]:before{
content: counter(part, upper-roman) ". ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before{
content: counter(chapter) ". ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before{
content: counter(chapter) "." counter(section1) ". ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before{
content: counter(chapter) "." counter(section1) "." counter(section2) ". ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] > *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before{
content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) ". ";
}
/*
Topics from Front Matter and Back Matter and
all other topics that follow a part
should not define string sets, counters, etc..
*/
*[class ~= "bookmap/frontmatter"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/backmatter"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before,
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) > *[class ~= "topic/title"]:before,
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before{
content:none !important;
}
/*/\* To hide the "Chapter NN." labels *\/
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
content:none !important;
}*/