TOC.pdf
Thank you in advance for any help. I have been wracking my brain on this.
In the attached PDF you can see that the page numbers in the chapter lines do not align the same as front and backmatter entries. I need the chapter labels to align-right though and have used the inline-block attribute to do that and to left align the chapter titles. I am using Prince 12.4 and used the following HTML/CSS for the chapter lines
<p class="toc-chapter-line"><span class="toc-chapter-label">Step One</span><span class="toc-chapter-title"><a href="#ch01-5007_IgnatianGuideForgiveness">Find Your Desire</a></span></p>
span.toc-chapter-label {
font-size: 10pt;
font-family: TradeGothicLTStd-Bold;
font-weight: normal;
text-align: right;
display: inline-block;
float: none;
vertical-align: top;
}
span.toc-chapter-title {
margin-left: 10pt;
text-indent: 0;
width: 100%;
display: inline-block;
float: none;
}
Here is all the code for the page if it helps:
<div class="toc"> <h3 class="title">Contents</h3> <h1 class="float-title-FM">Contents</h1> <p class="toc-preface-line"><span class="toc-preface-label"></span><span class="toc-preface-title"><a href="#p01-5007_IgnatianGuideForgiveness">Prologue</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step One</span><span class="toc-chapter-title"><a href="#ch01-5007_IgnatianGuideForgiveness">Find Your Desire</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Two</span><span class="toc-chapter-title"><a href="#ch02-5007_IgnatianGuideForgiveness">Embrace Being a Creature and Name Your Inner Pharisee</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Three</span><span class="toc-chapter-title"><a href="#ch03-5007_IgnatianGuideForgiveness">Honor Anger but Deepen Compassion</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Four</span><span class="toc-chapter-title"><a href="#ch04-5007_IgnatianGuideForgiveness">Trust in Abundant Grace</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Five</span><span class="toc-chapter-title"><a href="#ch05-5007_IgnatianGuideForgiveness">Leave Behind the Locked Room (Forgive Yourself)</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Six</span><span class="toc-chapter-title"><a href="#ch06-5007_IgnatianGuideForgiveness">Let Go and Make Friends with Time</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Seven</span><span class="toc-chapter-title"><a href="#ch07-5007_IgnatianGuideForgiveness">Create New Narratives</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Eight</span><span class="toc-chapter-title"><a href="#ch08-5007_IgnatianGuideForgiveness">Embrace the Child but Become the Parent</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label"> </span><span class="toc-chapter-title"><a href="#ch09-5007_IgnatianGuideForgiveness">Resting Point: Consider a Ritual of Closure</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Nine</span><span class="toc-chapter-title"><a href="#ch10-5007_IgnatianGuideForgiveness">Cultivate Habits of Mercy</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Ten</span><span class="toc-chapter-title"><a href="#ch11-5007_IgnatianGuideForgiveness">Celebrate</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#a01-5007_IgnatianGuideForgiveness">Bibliography</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#id-1.17">Endnotes</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#id-1.18">About the Author</a></span></p> </div>
* Table of Contents */
div.toc {
page-break-before: right;
page: frontmatter;
prince-page-group: start;
margin-left: 0;
margin-right: 0;
padding: 0;
}
.toc p {
/* tweak this to get the hanging indent aligned */
margin-left: 40pt;
text-indent: -51pt;
text-align: left;
font-style: normal;
font-weight: normal;
hyphens: none;
}
p.toc-preface-line,
p.toc-bibliography-line,
p.toc-appendix-line,
p.toc-glossary-line {
margin-top: 6pt;
margin-bottom: 4pt;
/*font-variant: small-caps;*/
}
p.toc-part-line {
page-break-after: avoid;
margin-top: 16pt;
margin-bottom: 2pt;
}
span.toc-chapter-label {
font-size: 10pt;
font-family: TradeGothicLTStd-Bold;
font-weight: normal;
text-align: right;
display: inline-block;
float: none;
vertical-align: top;
}
span.toc-chapter-title {
margin-left: 10pt;
text-indent: 0;
width: 100%;
display: inline-block;
float: none;
}
/* remember to keep the "a" in this selector for styling */
span.toc-part-title a {
font-family: TradeGothicLTStd;
font-weight: normal;
}
p.toc-chapter-line {
page-break-inside: avoid;
margin-top: 6pt;
margin-bottom: 3pt;
margin-left: 78pt; /*make 28pt if Part*/
line-height: 14pt;
}
p.toc-section-line {
margin-bottom: 2pt;
margin-left: 30pt;
text-indent: -12pt;
line-height: 11.5pt;
font-size: 10pt;
font-family: TradeGothicLTStd;
}
/* remember to keep the "a" in this selector for styling */
span.toc-chapter-title a {
}
/* to Generate Page Numbers for TOC, including roman for preface
see Walking With Jesus/Life & Revolution if using leaders in TOC*/
div.toc a::after,
div.toc p.toc-part-line a::after,
div.toc p.toc-section-line a::after {
content: leader('.') target-counter(attr(href), page);
/*float: right;*/ /*If no leaders*/
font-size: 9.5pt;
font-family: AGaramondPro;
}
div.toc p.toc-preface-line a::after {
content: leader('.') target-counter(attr(href), page, lower-roman);
/*float: right;*/ /*If no leaders*/
font-size: 9.5pt;
font-family: AGaramondPro;
font-variant: normal;
}
Thank you in advance for any help. I have been wracking my brain on this.
In the attached PDF you can see that the page numbers in the chapter lines do not align the same as front and backmatter entries. I need the chapter labels to align-right though and have used the inline-block attribute to do that and to left align the chapter titles. I am using Prince 12.4 and used the following HTML/CSS for the chapter lines
<p class="toc-chapter-line"><span class="toc-chapter-label">Step One</span><span class="toc-chapter-title"><a href="#ch01-5007_IgnatianGuideForgiveness">Find Your Desire</a></span></p>
span.toc-chapter-label {
font-size: 10pt;
font-family: TradeGothicLTStd-Bold;
font-weight: normal;
text-align: right;
display: inline-block;
float: none;
vertical-align: top;
}
span.toc-chapter-title {
margin-left: 10pt;
text-indent: 0;
width: 100%;
display: inline-block;
float: none;
}
Here is all the code for the page if it helps:
<div class="toc"> <h3 class="title">Contents</h3> <h1 class="float-title-FM">Contents</h1> <p class="toc-preface-line"><span class="toc-preface-label"></span><span class="toc-preface-title"><a href="#p01-5007_IgnatianGuideForgiveness">Prologue</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step One</span><span class="toc-chapter-title"><a href="#ch01-5007_IgnatianGuideForgiveness">Find Your Desire</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Two</span><span class="toc-chapter-title"><a href="#ch02-5007_IgnatianGuideForgiveness">Embrace Being a Creature and Name Your Inner Pharisee</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Three</span><span class="toc-chapter-title"><a href="#ch03-5007_IgnatianGuideForgiveness">Honor Anger but Deepen Compassion</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Four</span><span class="toc-chapter-title"><a href="#ch04-5007_IgnatianGuideForgiveness">Trust in Abundant Grace</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Five</span><span class="toc-chapter-title"><a href="#ch05-5007_IgnatianGuideForgiveness">Leave Behind the Locked Room (Forgive Yourself)</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Six</span><span class="toc-chapter-title"><a href="#ch06-5007_IgnatianGuideForgiveness">Let Go and Make Friends with Time</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Seven</span><span class="toc-chapter-title"><a href="#ch07-5007_IgnatianGuideForgiveness">Create New Narratives</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Eight</span><span class="toc-chapter-title"><a href="#ch08-5007_IgnatianGuideForgiveness">Embrace the Child but Become the Parent</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label"> </span><span class="toc-chapter-title"><a href="#ch09-5007_IgnatianGuideForgiveness">Resting Point: Consider a Ritual of Closure</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Nine</span><span class="toc-chapter-title"><a href="#ch10-5007_IgnatianGuideForgiveness">Cultivate Habits of Mercy</a></span></p> <p class="toc-chapter-line"><span class="toc-chapter-label">Step Ten</span><span class="toc-chapter-title"><a href="#ch11-5007_IgnatianGuideForgiveness">Celebrate</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#a01-5007_IgnatianGuideForgiveness">Bibliography</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#id-1.17">Endnotes</a></span></p> <p class="toc-appendix-line"><span class="toc-appendix-label"></span><span class="toc-appendix-title"><a href="#id-1.18">About the Author</a></span></p> </div>
* Table of Contents */
div.toc {
page-break-before: right;
page: frontmatter;
prince-page-group: start;
margin-left: 0;
margin-right: 0;
padding: 0;
}
.toc p {
/* tweak this to get the hanging indent aligned */
margin-left: 40pt;
text-indent: -51pt;
text-align: left;
font-style: normal;
font-weight: normal;
hyphens: none;
}
p.toc-preface-line,
p.toc-bibliography-line,
p.toc-appendix-line,
p.toc-glossary-line {
margin-top: 6pt;
margin-bottom: 4pt;
/*font-variant: small-caps;*/
}
p.toc-part-line {
page-break-after: avoid;
margin-top: 16pt;
margin-bottom: 2pt;
}
span.toc-chapter-label {
font-size: 10pt;
font-family: TradeGothicLTStd-Bold;
font-weight: normal;
text-align: right;
display: inline-block;
float: none;
vertical-align: top;
}
span.toc-chapter-title {
margin-left: 10pt;
text-indent: 0;
width: 100%;
display: inline-block;
float: none;
}
/* remember to keep the "a" in this selector for styling */
span.toc-part-title a {
font-family: TradeGothicLTStd;
font-weight: normal;
}
p.toc-chapter-line {
page-break-inside: avoid;
margin-top: 6pt;
margin-bottom: 3pt;
margin-left: 78pt; /*make 28pt if Part*/
line-height: 14pt;
}
p.toc-section-line {
margin-bottom: 2pt;
margin-left: 30pt;
text-indent: -12pt;
line-height: 11.5pt;
font-size: 10pt;
font-family: TradeGothicLTStd;
}
/* remember to keep the "a" in this selector for styling */
span.toc-chapter-title a {
}
/* to Generate Page Numbers for TOC, including roman for preface
see Walking With Jesus/Life & Revolution if using leaders in TOC*/
div.toc a::after,
div.toc p.toc-part-line a::after,
div.toc p.toc-section-line a::after {
content: leader('.') target-counter(attr(href), page);
/*float: right;*/ /*If no leaders*/
font-size: 9.5pt;
font-family: AGaramondPro;
}
div.toc p.toc-preface-line a::after {
content: leader('.') target-counter(attr(href), page, lower-roman);
/*float: right;*/ /*If no leaders*/
font-size: 9.5pt;
font-family: AGaramondPro;
font-variant: normal;
}