Page numbers in ToC not right aligned
up vote
1
down vote
favorite
I have a problem with my ToC. If a Chapter title is as long as the width of the TOC, then the page number is forced into the next line. However, the page number is not aligned on the right hand side but on the left. I would like the page number to be in all cases on the right. May be there is a way to set this. I am using the titletoc package.
That is my code
documentclass[twoside,openany,10pt]{book}
usepackage[paperwidth=5in, paperheight=8in, bindingoffset=0.375in, top=0.7in, bottom=0.7in, left=0.5in, right=0.5in]{geometry}
renewcommand{baselinestretch}{1.3}
usepackage{titlesec}
usepackage {setspace}
usepackage{librebaskerville}
usepackage[T1]{fontenc}
usepackage{anyfontsize}
usepackage{letterspace}
usepackage{fancyhdr}
usepackage{titletoc}%
usepackage{graphicx}
usepackage{float}
usepackage[overload]{textcase}
usepackage{microtype}
usepackage[symbol]{footmisc}
usepackage{enumerate}
renewcommand{thefootnote}{fnsymbol{footnote}}
titlecontents{chapter}% <section-type>
[2.3em]% <left>
{small}% <above-code>
{hspace*{-2.3em}makebox[2.3em][l]{thecontentslabel. }}% <numbered-entry-format>
{}% <numberless-entry-format>
{hfillcontentspage}% <filler-page-format>
%Begin Document
begin{document}
pagestyle{empty}
tableofcontents % Print table of contents
thispagestyle{empty}
%newcommand{chaptertolists}{}
%HERE BEGINS TEXT EDITING
mainmatter % only in book class (arabic page #s)
pagestyle{fancy}
renewcommand{chaptermark}[1]{
markboth{Thought Vibration} {#1}}
fancyhead[CO]{small itshape rightmark}
fancyhead[CE]{small itshape leftmark}
fancyhead[RE,LO]{}
fancyhead[LE,RO]{}
fancyfoot[CO, CE]{small thepage}
titleformat{chapter}[display]
{normalfonthugebfseriescentering}{lsstyleMakeUppercase{chaptertitlename} thechapter}{20pt}{normalfontLARGEitshape}
titlespacing*{chapter}{0pt}{30pt}{20pt}
pagenumbering{arabic}
%ONLY FOR COLLECTIONS
%addtocontents{toc}{protectthispagestyle{empty}}
%addcontentsline{toc}{part}{The Science of Getting Rich}
%part*{The Science of Getting Rich}
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Preface}
markboth{Thought Vibration} {Preface}
chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Foreword}
markboth{Thought Vibration} {Foreword}
chapter*{Foreword}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{My Working Creed}
markboth{Thought Vibration} {My Working Creed}
chapter*{My Working Creed}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{The Law Of Attraction In The Thought World}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{Thought‐Waves And Their Process Of Reproduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
end{document}
Thanks in advance. :)
table-of-contents page-numbering titletoc
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
1
down vote
favorite
I have a problem with my ToC. If a Chapter title is as long as the width of the TOC, then the page number is forced into the next line. However, the page number is not aligned on the right hand side but on the left. I would like the page number to be in all cases on the right. May be there is a way to set this. I am using the titletoc package.
That is my code
documentclass[twoside,openany,10pt]{book}
usepackage[paperwidth=5in, paperheight=8in, bindingoffset=0.375in, top=0.7in, bottom=0.7in, left=0.5in, right=0.5in]{geometry}
renewcommand{baselinestretch}{1.3}
usepackage{titlesec}
usepackage {setspace}
usepackage{librebaskerville}
usepackage[T1]{fontenc}
usepackage{anyfontsize}
usepackage{letterspace}
usepackage{fancyhdr}
usepackage{titletoc}%
usepackage{graphicx}
usepackage{float}
usepackage[overload]{textcase}
usepackage{microtype}
usepackage[symbol]{footmisc}
usepackage{enumerate}
renewcommand{thefootnote}{fnsymbol{footnote}}
titlecontents{chapter}% <section-type>
[2.3em]% <left>
{small}% <above-code>
{hspace*{-2.3em}makebox[2.3em][l]{thecontentslabel. }}% <numbered-entry-format>
{}% <numberless-entry-format>
{hfillcontentspage}% <filler-page-format>
%Begin Document
begin{document}
pagestyle{empty}
tableofcontents % Print table of contents
thispagestyle{empty}
%newcommand{chaptertolists}{}
%HERE BEGINS TEXT EDITING
mainmatter % only in book class (arabic page #s)
pagestyle{fancy}
renewcommand{chaptermark}[1]{
markboth{Thought Vibration} {#1}}
fancyhead[CO]{small itshape rightmark}
fancyhead[CE]{small itshape leftmark}
fancyhead[RE,LO]{}
fancyhead[LE,RO]{}
fancyfoot[CO, CE]{small thepage}
titleformat{chapter}[display]
{normalfonthugebfseriescentering}{lsstyleMakeUppercase{chaptertitlename} thechapter}{20pt}{normalfontLARGEitshape}
titlespacing*{chapter}{0pt}{30pt}{20pt}
pagenumbering{arabic}
%ONLY FOR COLLECTIONS
%addtocontents{toc}{protectthispagestyle{empty}}
%addcontentsline{toc}{part}{The Science of Getting Rich}
%part*{The Science of Getting Rich}
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Preface}
markboth{Thought Vibration} {Preface}
chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Foreword}
markboth{Thought Vibration} {Foreword}
chapter*{Foreword}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{My Working Creed}
markboth{Thought Vibration} {My Working Creed}
chapter*{My Working Creed}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{The Law Of Attraction In The Thought World}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{Thought‐Waves And Their Process Of Reproduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
end{document}
Thanks in advance. :)
table-of-contents page-numbering titletoc
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a problem with my ToC. If a Chapter title is as long as the width of the TOC, then the page number is forced into the next line. However, the page number is not aligned on the right hand side but on the left. I would like the page number to be in all cases on the right. May be there is a way to set this. I am using the titletoc package.
That is my code
documentclass[twoside,openany,10pt]{book}
usepackage[paperwidth=5in, paperheight=8in, bindingoffset=0.375in, top=0.7in, bottom=0.7in, left=0.5in, right=0.5in]{geometry}
renewcommand{baselinestretch}{1.3}
usepackage{titlesec}
usepackage {setspace}
usepackage{librebaskerville}
usepackage[T1]{fontenc}
usepackage{anyfontsize}
usepackage{letterspace}
usepackage{fancyhdr}
usepackage{titletoc}%
usepackage{graphicx}
usepackage{float}
usepackage[overload]{textcase}
usepackage{microtype}
usepackage[symbol]{footmisc}
usepackage{enumerate}
renewcommand{thefootnote}{fnsymbol{footnote}}
titlecontents{chapter}% <section-type>
[2.3em]% <left>
{small}% <above-code>
{hspace*{-2.3em}makebox[2.3em][l]{thecontentslabel. }}% <numbered-entry-format>
{}% <numberless-entry-format>
{hfillcontentspage}% <filler-page-format>
%Begin Document
begin{document}
pagestyle{empty}
tableofcontents % Print table of contents
thispagestyle{empty}
%newcommand{chaptertolists}{}
%HERE BEGINS TEXT EDITING
mainmatter % only in book class (arabic page #s)
pagestyle{fancy}
renewcommand{chaptermark}[1]{
markboth{Thought Vibration} {#1}}
fancyhead[CO]{small itshape rightmark}
fancyhead[CE]{small itshape leftmark}
fancyhead[RE,LO]{}
fancyhead[LE,RO]{}
fancyfoot[CO, CE]{small thepage}
titleformat{chapter}[display]
{normalfonthugebfseriescentering}{lsstyleMakeUppercase{chaptertitlename} thechapter}{20pt}{normalfontLARGEitshape}
titlespacing*{chapter}{0pt}{30pt}{20pt}
pagenumbering{arabic}
%ONLY FOR COLLECTIONS
%addtocontents{toc}{protectthispagestyle{empty}}
%addcontentsline{toc}{part}{The Science of Getting Rich}
%part*{The Science of Getting Rich}
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Preface}
markboth{Thought Vibration} {Preface}
chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Foreword}
markboth{Thought Vibration} {Foreword}
chapter*{Foreword}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{My Working Creed}
markboth{Thought Vibration} {My Working Creed}
chapter*{My Working Creed}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{The Law Of Attraction In The Thought World}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{Thought‐Waves And Their Process Of Reproduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
end{document}
Thanks in advance. :)
table-of-contents page-numbering titletoc
I have a problem with my ToC. If a Chapter title is as long as the width of the TOC, then the page number is forced into the next line. However, the page number is not aligned on the right hand side but on the left. I would like the page number to be in all cases on the right. May be there is a way to set this. I am using the titletoc package.
That is my code
documentclass[twoside,openany,10pt]{book}
usepackage[paperwidth=5in, paperheight=8in, bindingoffset=0.375in, top=0.7in, bottom=0.7in, left=0.5in, right=0.5in]{geometry}
renewcommand{baselinestretch}{1.3}
usepackage{titlesec}
usepackage {setspace}
usepackage{librebaskerville}
usepackage[T1]{fontenc}
usepackage{anyfontsize}
usepackage{letterspace}
usepackage{fancyhdr}
usepackage{titletoc}%
usepackage{graphicx}
usepackage{float}
usepackage[overload]{textcase}
usepackage{microtype}
usepackage[symbol]{footmisc}
usepackage{enumerate}
renewcommand{thefootnote}{fnsymbol{footnote}}
titlecontents{chapter}% <section-type>
[2.3em]% <left>
{small}% <above-code>
{hspace*{-2.3em}makebox[2.3em][l]{thecontentslabel. }}% <numbered-entry-format>
{}% <numberless-entry-format>
{hfillcontentspage}% <filler-page-format>
%Begin Document
begin{document}
pagestyle{empty}
tableofcontents % Print table of contents
thispagestyle{empty}
%newcommand{chaptertolists}{}
%HERE BEGINS TEXT EDITING
mainmatter % only in book class (arabic page #s)
pagestyle{fancy}
renewcommand{chaptermark}[1]{
markboth{Thought Vibration} {#1}}
fancyhead[CO]{small itshape rightmark}
fancyhead[CE]{small itshape leftmark}
fancyhead[RE,LO]{}
fancyhead[LE,RO]{}
fancyfoot[CO, CE]{small thepage}
titleformat{chapter}[display]
{normalfonthugebfseriescentering}{lsstyleMakeUppercase{chaptertitlename} thechapter}{20pt}{normalfontLARGEitshape}
titlespacing*{chapter}{0pt}{30pt}{20pt}
pagenumbering{arabic}
%ONLY FOR COLLECTIONS
%addtocontents{toc}{protectthispagestyle{empty}}
%addcontentsline{toc}{part}{The Science of Getting Rich}
%part*{The Science of Getting Rich}
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Preface}
markboth{Thought Vibration} {Preface}
chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{Foreword}
markboth{Thought Vibration} {Foreword}
chapter*{Foreword}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
addtocontents{toc}{protectthispagestyle{empty}}
addcontentsline{toc}{chapter}{My Working Creed}
markboth{Thought Vibration} {My Working Creed}
chapter*{My Working Creed}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{The Law Of Attraction In The Thought World}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
chapter{Thought‐Waves And Their Process Of Reproduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
end{document}
Thanks in advance. :)
table-of-contents page-numbering titletoc
table-of-contents page-numbering titletoc
asked Nov 12 at 1:17
Lisa
213
213
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You should use hangindent
in the above code. I've made the change to your titlecontents
(remember to delete old toc and double run it):
titlecontents{chapter}
[3.3em]
{smallhangindent2.3em}% <- Change made here
{makebox[2.3em][l]{thecontentslabel.}}
{}%
{hfillcontentspage}
This compiles to the following:
If possible, you can also use the chapter
command to shorten the text displayed in the toc using the following syntax:
chapter{short version}{long version}
so that chapter{The Laws Of Attraction}{The Law Of Attraction In The Thought World}
which compiles to the following:
Hope this helps.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You should use hangindent
in the above code. I've made the change to your titlecontents
(remember to delete old toc and double run it):
titlecontents{chapter}
[3.3em]
{smallhangindent2.3em}% <- Change made here
{makebox[2.3em][l]{thecontentslabel.}}
{}%
{hfillcontentspage}
This compiles to the following:
If possible, you can also use the chapter
command to shorten the text displayed in the toc using the following syntax:
chapter{short version}{long version}
so that chapter{The Laws Of Attraction}{The Law Of Attraction In The Thought World}
which compiles to the following:
Hope this helps.
add a comment |
up vote
0
down vote
You should use hangindent
in the above code. I've made the change to your titlecontents
(remember to delete old toc and double run it):
titlecontents{chapter}
[3.3em]
{smallhangindent2.3em}% <- Change made here
{makebox[2.3em][l]{thecontentslabel.}}
{}%
{hfillcontentspage}
This compiles to the following:
If possible, you can also use the chapter
command to shorten the text displayed in the toc using the following syntax:
chapter{short version}{long version}
so that chapter{The Laws Of Attraction}{The Law Of Attraction In The Thought World}
which compiles to the following:
Hope this helps.
add a comment |
up vote
0
down vote
up vote
0
down vote
You should use hangindent
in the above code. I've made the change to your titlecontents
(remember to delete old toc and double run it):
titlecontents{chapter}
[3.3em]
{smallhangindent2.3em}% <- Change made here
{makebox[2.3em][l]{thecontentslabel.}}
{}%
{hfillcontentspage}
This compiles to the following:
If possible, you can also use the chapter
command to shorten the text displayed in the toc using the following syntax:
chapter{short version}{long version}
so that chapter{The Laws Of Attraction}{The Law Of Attraction In The Thought World}
which compiles to the following:
Hope this helps.
You should use hangindent
in the above code. I've made the change to your titlecontents
(remember to delete old toc and double run it):
titlecontents{chapter}
[3.3em]
{smallhangindent2.3em}% <- Change made here
{makebox[2.3em][l]{thecontentslabel.}}
{}%
{hfillcontentspage}
This compiles to the following:
If possible, you can also use the chapter
command to shorten the text displayed in the toc using the following syntax:
chapter{short version}{long version}
so that chapter{The Laws Of Attraction}{The Law Of Attraction In The Thought World}
which compiles to the following:
Hope this helps.
edited Nov 12 at 2:40
answered Nov 12 at 2:25
Ole Anders
341112
341112
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459540%2fpage-numbers-in-toc-not-right-aligned%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown