Cannot compile after putting table of contents The 2019 Stack Overflow Developer Survey...
What is the motivation for a law requiring 2 parties to consent for recording a conversation
Idiomatic way to prevent slicing?
Should I write numbers in words or as numerals when there are multiple next to each other?
What is the use of option -o in the useradd command?
What does "sndry explns" mean in one of the Hitchhiker's guide books?
Access elements in std::string where positon of string is greater than its size
"To split hairs" vs "To be pedantic"
Are there any other methods to apply to solving simultaneous equations?
aging parents with no investments
Does duplicating a spell with Wish count as casting that spell?
Where does the "burst of radiance" from Holy Weapon originate?
What is the meaning of Triage in Cybersec world?
How do you say "canon" as in "official for a story universe"?
Does light intensity oscillate really fast since it is a wave?
Realistic Alternatives to Dust: What Else Could Feed a Plankton Bloom?
Is bread bad for ducks?
Could a US political party gain complete control over the government by removing checks & balances?
What do the Banks children have against barley water?
Where to refill my bottle in India?
Is this food a bread or a loaf?
Is flight data recorder erased after every flight?
A poker game description that does not feel gimmicky
Can't find the latex code for the ⍎ (down tack jot) symbol
How to create dashed lines/arrows in Illustrator
Cannot compile after putting table of contents
The 2019 Stack Overflow Developer Survey Results Are InPutting table of contents in a page without other elementsResets page numbering after table of contentsPage number on the left with book classlist of figures and tables when there are no figures or tables?Cannot change fonts on Algorithms Table of Contents pageHow to show Mini table only sections in a chapter not other chapter?I cannot rename table of contentsTable of contents ignores chapters declared after a certain lineTable of contents after partsFncychap with Conny option cannot produce table of contents
This is my preamble:
documentclass[12pt]{report}
usepackage[left=1.5in, right=1in, top=1in,bottom=1.5in]{geometry}
usepackage{setspace}
usepackage{amsbsy}
usepackage{fancyhdr}
usepackage{lipsum}
usepackage{graphicx}
usepackage{enumitem}
usepackage{textcomp}
usepackage{lscape}
usepackage{amsmath}
usepackage{calc}
usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
usepackage{titlesec}
usepackage{sectsty}
sectionfont{underlinenormalfontnormalsizecentering}
newlength{depthofsumsign}
setlength{depthofsumsign}{depthof{$sum$}}
newlength{totalheightofsumsign}
newlength{heightanddepthofargument}
usepackage{pdflscape,booktabs}
usepackage[flushleft]{threeparttable}
renewcommandTPTtagStyle{textit}
usepackage[font=it,skip=0.5baselineskip]{caption} % italic text for captions
usepackage{titletoc}
usepackage{hyperref}
titlecontents{chapter}
[3pt] % left margin
{}%
{contentsmargin{0pt} % numbered entry format
thecontentslabelenspace%
}
{contentsmargin{0pt}large} % unnumbered entry format
{titlerule*[.99pc]{.}contentspage} % filler-page format (e.g dots)
[] % below code (e.g vertical space)
%to put page numbers as the header
fancyhf{}
fancyhead[C]{thepage}
pagestyle{fancy}
titleformat{chapter}{normalfontcentering}{}{0pt}{}
titlelabel{}
titlespacing*{chapter}{0pt}{-25pt}{4pt}
titleformat{section}{normalfontcentering}{}{0pt}{}
%koleygr: Redefining chapter to include thispagestyle{fancy}
letoldchapterchapter
makeatletter
defchapter{%
@ifstar{@Starred}{@nonStarred}%
}
def@Starred{%
@ifnextchar[%
{GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}@StarredWith}%
{@StarredWithout}%
}
def@StarredWith[#1]#2{%
oldchapter*{#2}%
thispagestyle{fancy}
}
def@StarredWithout#1{
oldchapter*{#1}%
thispagestyle{fancy}
}
def@nonStarred{%
@ifnextchar[%
{@nonStarredWith}%
{@nonStarredWithout}%
}
def@nonStarredWith[#1]#2{%
oldchapter[#1]{#2}%
thispagestyle{fancy}
}
def@nonStarredWithout#1{%
oldchapter{#1}%
thispagestyle{fancy}
}
makeatother
interfootnotelinepenalty=10000
renewcommand{contentsname}{TABLE OF CONTENTS}
begin{document}
I was using this same set of codes earlier, and it was working fine. Then I wanted to change the format of the titles, 'List of figures,' and 'List of tables' into all caps, i.e. "LIST OF FIGURES," and "LIST OF TABLES."
I then first used this code:
documentclass{article}
usepackage{tocbibind}
letoldaddcontentslineaddcontentsline
newcommand{ADDCONTENTSLINE}[3]{%
oldaddcontentsline{#1}{#2}{MakeUppercase{#3}}%
}
newcommand{CAPinToC}{letaddcontentslineADDCONTENTSLINE}
newcommand{noCAPinToC}{letaddcontentslineoldaddcontentsline}
begin{document}
tableofcontents
CAPinToC% All entries in ToC will be CAPITALIZED from here on
listoftables
listoffigures
noCAPinToC% Rever to original addcontentsline formatting
section{A section}
begin{figure}caption{A figure}end{figure}
begin{table}caption{A table}end{table}
end{document}
It showed some errors, and I could not compile. Then, I deleted the code, and used this:
renewcommand*listfigurename{List of figures}
%after begin{document} and before the listoffigures command.
renewcommand*listtablename{List of tables}
%after begin{document} and before the listoftables command.
It still did not work.
But when I tried to delete it and compile, it would not compile at all.
I tried undoing everything I did in the last five minutes, and it would still not compile.
Finally, I got rid of tableofcontents
code, and it compiled. But, now I cannot add the table of contents at all.
Is there some defect in my codes, somewhere?
Thanks a lot!!
table-of-contents
add a comment |
This is my preamble:
documentclass[12pt]{report}
usepackage[left=1.5in, right=1in, top=1in,bottom=1.5in]{geometry}
usepackage{setspace}
usepackage{amsbsy}
usepackage{fancyhdr}
usepackage{lipsum}
usepackage{graphicx}
usepackage{enumitem}
usepackage{textcomp}
usepackage{lscape}
usepackage{amsmath}
usepackage{calc}
usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
usepackage{titlesec}
usepackage{sectsty}
sectionfont{underlinenormalfontnormalsizecentering}
newlength{depthofsumsign}
setlength{depthofsumsign}{depthof{$sum$}}
newlength{totalheightofsumsign}
newlength{heightanddepthofargument}
usepackage{pdflscape,booktabs}
usepackage[flushleft]{threeparttable}
renewcommandTPTtagStyle{textit}
usepackage[font=it,skip=0.5baselineskip]{caption} % italic text for captions
usepackage{titletoc}
usepackage{hyperref}
titlecontents{chapter}
[3pt] % left margin
{}%
{contentsmargin{0pt} % numbered entry format
thecontentslabelenspace%
}
{contentsmargin{0pt}large} % unnumbered entry format
{titlerule*[.99pc]{.}contentspage} % filler-page format (e.g dots)
[] % below code (e.g vertical space)
%to put page numbers as the header
fancyhf{}
fancyhead[C]{thepage}
pagestyle{fancy}
titleformat{chapter}{normalfontcentering}{}{0pt}{}
titlelabel{}
titlespacing*{chapter}{0pt}{-25pt}{4pt}
titleformat{section}{normalfontcentering}{}{0pt}{}
%koleygr: Redefining chapter to include thispagestyle{fancy}
letoldchapterchapter
makeatletter
defchapter{%
@ifstar{@Starred}{@nonStarred}%
}
def@Starred{%
@ifnextchar[%
{GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}@StarredWith}%
{@StarredWithout}%
}
def@StarredWith[#1]#2{%
oldchapter*{#2}%
thispagestyle{fancy}
}
def@StarredWithout#1{
oldchapter*{#1}%
thispagestyle{fancy}
}
def@nonStarred{%
@ifnextchar[%
{@nonStarredWith}%
{@nonStarredWithout}%
}
def@nonStarredWith[#1]#2{%
oldchapter[#1]{#2}%
thispagestyle{fancy}
}
def@nonStarredWithout#1{%
oldchapter{#1}%
thispagestyle{fancy}
}
makeatother
interfootnotelinepenalty=10000
renewcommand{contentsname}{TABLE OF CONTENTS}
begin{document}
I was using this same set of codes earlier, and it was working fine. Then I wanted to change the format of the titles, 'List of figures,' and 'List of tables' into all caps, i.e. "LIST OF FIGURES," and "LIST OF TABLES."
I then first used this code:
documentclass{article}
usepackage{tocbibind}
letoldaddcontentslineaddcontentsline
newcommand{ADDCONTENTSLINE}[3]{%
oldaddcontentsline{#1}{#2}{MakeUppercase{#3}}%
}
newcommand{CAPinToC}{letaddcontentslineADDCONTENTSLINE}
newcommand{noCAPinToC}{letaddcontentslineoldaddcontentsline}
begin{document}
tableofcontents
CAPinToC% All entries in ToC will be CAPITALIZED from here on
listoftables
listoffigures
noCAPinToC% Rever to original addcontentsline formatting
section{A section}
begin{figure}caption{A figure}end{figure}
begin{table}caption{A table}end{table}
end{document}
It showed some errors, and I could not compile. Then, I deleted the code, and used this:
renewcommand*listfigurename{List of figures}
%after begin{document} and before the listoffigures command.
renewcommand*listtablename{List of tables}
%after begin{document} and before the listoftables command.
It still did not work.
But when I tried to delete it and compile, it would not compile at all.
I tried undoing everything I did in the last five minutes, and it would still not compile.
Finally, I got rid of tableofcontents
code, and it compiled. But, now I cannot add the table of contents at all.
Is there some defect in my codes, somewhere?
Thanks a lot!!
table-of-contents
1
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago
add a comment |
This is my preamble:
documentclass[12pt]{report}
usepackage[left=1.5in, right=1in, top=1in,bottom=1.5in]{geometry}
usepackage{setspace}
usepackage{amsbsy}
usepackage{fancyhdr}
usepackage{lipsum}
usepackage{graphicx}
usepackage{enumitem}
usepackage{textcomp}
usepackage{lscape}
usepackage{amsmath}
usepackage{calc}
usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
usepackage{titlesec}
usepackage{sectsty}
sectionfont{underlinenormalfontnormalsizecentering}
newlength{depthofsumsign}
setlength{depthofsumsign}{depthof{$sum$}}
newlength{totalheightofsumsign}
newlength{heightanddepthofargument}
usepackage{pdflscape,booktabs}
usepackage[flushleft]{threeparttable}
renewcommandTPTtagStyle{textit}
usepackage[font=it,skip=0.5baselineskip]{caption} % italic text for captions
usepackage{titletoc}
usepackage{hyperref}
titlecontents{chapter}
[3pt] % left margin
{}%
{contentsmargin{0pt} % numbered entry format
thecontentslabelenspace%
}
{contentsmargin{0pt}large} % unnumbered entry format
{titlerule*[.99pc]{.}contentspage} % filler-page format (e.g dots)
[] % below code (e.g vertical space)
%to put page numbers as the header
fancyhf{}
fancyhead[C]{thepage}
pagestyle{fancy}
titleformat{chapter}{normalfontcentering}{}{0pt}{}
titlelabel{}
titlespacing*{chapter}{0pt}{-25pt}{4pt}
titleformat{section}{normalfontcentering}{}{0pt}{}
%koleygr: Redefining chapter to include thispagestyle{fancy}
letoldchapterchapter
makeatletter
defchapter{%
@ifstar{@Starred}{@nonStarred}%
}
def@Starred{%
@ifnextchar[%
{GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}@StarredWith}%
{@StarredWithout}%
}
def@StarredWith[#1]#2{%
oldchapter*{#2}%
thispagestyle{fancy}
}
def@StarredWithout#1{
oldchapter*{#1}%
thispagestyle{fancy}
}
def@nonStarred{%
@ifnextchar[%
{@nonStarredWith}%
{@nonStarredWithout}%
}
def@nonStarredWith[#1]#2{%
oldchapter[#1]{#2}%
thispagestyle{fancy}
}
def@nonStarredWithout#1{%
oldchapter{#1}%
thispagestyle{fancy}
}
makeatother
interfootnotelinepenalty=10000
renewcommand{contentsname}{TABLE OF CONTENTS}
begin{document}
I was using this same set of codes earlier, and it was working fine. Then I wanted to change the format of the titles, 'List of figures,' and 'List of tables' into all caps, i.e. "LIST OF FIGURES," and "LIST OF TABLES."
I then first used this code:
documentclass{article}
usepackage{tocbibind}
letoldaddcontentslineaddcontentsline
newcommand{ADDCONTENTSLINE}[3]{%
oldaddcontentsline{#1}{#2}{MakeUppercase{#3}}%
}
newcommand{CAPinToC}{letaddcontentslineADDCONTENTSLINE}
newcommand{noCAPinToC}{letaddcontentslineoldaddcontentsline}
begin{document}
tableofcontents
CAPinToC% All entries in ToC will be CAPITALIZED from here on
listoftables
listoffigures
noCAPinToC% Rever to original addcontentsline formatting
section{A section}
begin{figure}caption{A figure}end{figure}
begin{table}caption{A table}end{table}
end{document}
It showed some errors, and I could not compile. Then, I deleted the code, and used this:
renewcommand*listfigurename{List of figures}
%after begin{document} and before the listoffigures command.
renewcommand*listtablename{List of tables}
%after begin{document} and before the listoftables command.
It still did not work.
But when I tried to delete it and compile, it would not compile at all.
I tried undoing everything I did in the last five minutes, and it would still not compile.
Finally, I got rid of tableofcontents
code, and it compiled. But, now I cannot add the table of contents at all.
Is there some defect in my codes, somewhere?
Thanks a lot!!
table-of-contents
This is my preamble:
documentclass[12pt]{report}
usepackage[left=1.5in, right=1in, top=1in,bottom=1.5in]{geometry}
usepackage{setspace}
usepackage{amsbsy}
usepackage{fancyhdr}
usepackage{lipsum}
usepackage{graphicx}
usepackage{enumitem}
usepackage{textcomp}
usepackage{lscape}
usepackage{amsmath}
usepackage{calc}
usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
usepackage{titlesec}
usepackage{sectsty}
sectionfont{underlinenormalfontnormalsizecentering}
newlength{depthofsumsign}
setlength{depthofsumsign}{depthof{$sum$}}
newlength{totalheightofsumsign}
newlength{heightanddepthofargument}
usepackage{pdflscape,booktabs}
usepackage[flushleft]{threeparttable}
renewcommandTPTtagStyle{textit}
usepackage[font=it,skip=0.5baselineskip]{caption} % italic text for captions
usepackage{titletoc}
usepackage{hyperref}
titlecontents{chapter}
[3pt] % left margin
{}%
{contentsmargin{0pt} % numbered entry format
thecontentslabelenspace%
}
{contentsmargin{0pt}large} % unnumbered entry format
{titlerule*[.99pc]{.}contentspage} % filler-page format (e.g dots)
[] % below code (e.g vertical space)
%to put page numbers as the header
fancyhf{}
fancyhead[C]{thepage}
pagestyle{fancy}
titleformat{chapter}{normalfontcentering}{}{0pt}{}
titlelabel{}
titlespacing*{chapter}{0pt}{-25pt}{4pt}
titleformat{section}{normalfontcentering}{}{0pt}{}
%koleygr: Redefining chapter to include thispagestyle{fancy}
letoldchapterchapter
makeatletter
defchapter{%
@ifstar{@Starred}{@nonStarred}%
}
def@Starred{%
@ifnextchar[%
{GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}@StarredWith}%
{@StarredWithout}%
}
def@StarredWith[#1]#2{%
oldchapter*{#2}%
thispagestyle{fancy}
}
def@StarredWithout#1{
oldchapter*{#1}%
thispagestyle{fancy}
}
def@nonStarred{%
@ifnextchar[%
{@nonStarredWith}%
{@nonStarredWithout}%
}
def@nonStarredWith[#1]#2{%
oldchapter[#1]{#2}%
thispagestyle{fancy}
}
def@nonStarredWithout#1{%
oldchapter{#1}%
thispagestyle{fancy}
}
makeatother
interfootnotelinepenalty=10000
renewcommand{contentsname}{TABLE OF CONTENTS}
begin{document}
I was using this same set of codes earlier, and it was working fine. Then I wanted to change the format of the titles, 'List of figures,' and 'List of tables' into all caps, i.e. "LIST OF FIGURES," and "LIST OF TABLES."
I then first used this code:
documentclass{article}
usepackage{tocbibind}
letoldaddcontentslineaddcontentsline
newcommand{ADDCONTENTSLINE}[3]{%
oldaddcontentsline{#1}{#2}{MakeUppercase{#3}}%
}
newcommand{CAPinToC}{letaddcontentslineADDCONTENTSLINE}
newcommand{noCAPinToC}{letaddcontentslineoldaddcontentsline}
begin{document}
tableofcontents
CAPinToC% All entries in ToC will be CAPITALIZED from here on
listoftables
listoffigures
noCAPinToC% Rever to original addcontentsline formatting
section{A section}
begin{figure}caption{A figure}end{figure}
begin{table}caption{A table}end{table}
end{document}
It showed some errors, and I could not compile. Then, I deleted the code, and used this:
renewcommand*listfigurename{List of figures}
%after begin{document} and before the listoffigures command.
renewcommand*listtablename{List of tables}
%after begin{document} and before the listoftables command.
It still did not work.
But when I tried to delete it and compile, it would not compile at all.
I tried undoing everything I did in the last five minutes, and it would still not compile.
Finally, I got rid of tableofcontents
code, and it compiled. But, now I cannot add the table of contents at all.
Is there some defect in my codes, somewhere?
Thanks a lot!!
table-of-contents
table-of-contents
asked 7 mins ago
Samyam ShresthaSamyam Shrestha
495
495
1
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago
add a comment |
1
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago
1
1
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f484046%2fcannot-compile-after-putting-table-of-contents%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
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%2f484046%2fcannot-compile-after-putting-table-of-contents%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
1
Don't make people confused with so many codes. Please post a minimal but compilable code (not only the preamble) that reproduces your problem. Btw, please add the error message.
– JouleV
5 mins ago