Numbering sections doesn't work












0















I'm new to Latex and I'm making a big document with a lot of sections, subsections etc. Could anyone find out why the sections numbering doesn't appear in the PDF?
Here is my preamble:



PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
PassOptionsToPackage{hyphens}{url}
%
documentclass{article}
usepackage{blindtext}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
%makeatletter
%patchcmd{ttlh@hang}{parindentz@}{parindentz@leavevmode}{}{}
%patchcmd{ttlh@hang}{noindent}{}{}{}
%makeatother
usepackage{lmodern}
usepackage{amssymb,amsmath}
usepackage{ifxetex,ifluatex}
ifnum 0ifxetex 1fiifluatex 1fi=0 % if pdftex
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{textcomp} % provides euro and other symbols
else % if luatex or xelatex
usepackage{unicode-math}
defaultfontfeatures{Scale=MatchLowercase}
defaultfontfeatures[rmfamily]{Ligatures=TeX,Scale=1}
fi
% use upquote if available, for straight quotes in verbatim environments
IfFileExists{upquote.sty}{usepackage{upquote}}{}
IfFileExists{microtype.sty}{% use microtype if available
usepackage{microtype}
UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
makeatletter
@ifundefined{KOMAClassName}{% if non-KOMA class
IfFileExists{parskip.sty}{%
usepackage{parskip}
}{% else
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
KOMAoptions{parskip=half}}
makeatother
usepackage{xcolor}
IfFileExists{xurl.sty}{usepackage{xurl}}{} % add URL line breaks if available
IfFileExists{bookmark.sty}{usepackage{bookmark}}{usepackage{hyperref}}
hypersetup{
pdfborder={0 0 0},
breaklinks=true}
urlstyle{same} % don't use monospace font for urls
usepackage{graphicx,grffile}
%makeatletter
defmaxwidth{ifdimGin@nat@width>linewidthlinewidthelseGin@nat@widthfi}
defmaxheight{ifdimGin@nat@height>textheighttextheightelseGin@nat@heightfi}
makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in includegraphics[width, height, ...]{}
setkeys{Gin}{width=maxwidth,height=maxheight,keepaspectratio}
setlength{emergencystretch}{3em} % prevent overfull lines
providecommand{tightlist}{%
setlength{itemsep}{0pt}setlength{parskip}{0pt}}
setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
ifxparagraphundefinedelse
letoldparagraphparagraph
renewcommand{paragraph}[1]{oldparagraph{#1}mbox{}}
fi
ifxsubparagraphundefinedelse
letoldsubparagraphsubparagraph
renewcommand{subparagraph}[1]{oldsubparagraph{#1}mbox{}}
fi
% set default figure placement to htbp
makeatletter
deffps@figure{htbp}
makeatother

newcommandblankpage{%
null
thispagestyle{empty}%
addtocounter{page}{-1}%
newpage}
usepackage{times}
usepackage[margin=1.5in]{geometry}
date{}
begin{document}

input{part1ch1}


part1ch1.tex looks like:



section{text...}









share|improve this question









New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Off topic: Is it necessary to make a document with such a complicated preamble?

    – JouleV
    10 hours ago






  • 2





    You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

    – campa
    10 hours ago
















0















I'm new to Latex and I'm making a big document with a lot of sections, subsections etc. Could anyone find out why the sections numbering doesn't appear in the PDF?
Here is my preamble:



PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
PassOptionsToPackage{hyphens}{url}
%
documentclass{article}
usepackage{blindtext}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
%makeatletter
%patchcmd{ttlh@hang}{parindentz@}{parindentz@leavevmode}{}{}
%patchcmd{ttlh@hang}{noindent}{}{}{}
%makeatother
usepackage{lmodern}
usepackage{amssymb,amsmath}
usepackage{ifxetex,ifluatex}
ifnum 0ifxetex 1fiifluatex 1fi=0 % if pdftex
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{textcomp} % provides euro and other symbols
else % if luatex or xelatex
usepackage{unicode-math}
defaultfontfeatures{Scale=MatchLowercase}
defaultfontfeatures[rmfamily]{Ligatures=TeX,Scale=1}
fi
% use upquote if available, for straight quotes in verbatim environments
IfFileExists{upquote.sty}{usepackage{upquote}}{}
IfFileExists{microtype.sty}{% use microtype if available
usepackage{microtype}
UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
makeatletter
@ifundefined{KOMAClassName}{% if non-KOMA class
IfFileExists{parskip.sty}{%
usepackage{parskip}
}{% else
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
KOMAoptions{parskip=half}}
makeatother
usepackage{xcolor}
IfFileExists{xurl.sty}{usepackage{xurl}}{} % add URL line breaks if available
IfFileExists{bookmark.sty}{usepackage{bookmark}}{usepackage{hyperref}}
hypersetup{
pdfborder={0 0 0},
breaklinks=true}
urlstyle{same} % don't use monospace font for urls
usepackage{graphicx,grffile}
%makeatletter
defmaxwidth{ifdimGin@nat@width>linewidthlinewidthelseGin@nat@widthfi}
defmaxheight{ifdimGin@nat@height>textheighttextheightelseGin@nat@heightfi}
makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in includegraphics[width, height, ...]{}
setkeys{Gin}{width=maxwidth,height=maxheight,keepaspectratio}
setlength{emergencystretch}{3em} % prevent overfull lines
providecommand{tightlist}{%
setlength{itemsep}{0pt}setlength{parskip}{0pt}}
setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
ifxparagraphundefinedelse
letoldparagraphparagraph
renewcommand{paragraph}[1]{oldparagraph{#1}mbox{}}
fi
ifxsubparagraphundefinedelse
letoldsubparagraphsubparagraph
renewcommand{subparagraph}[1]{oldsubparagraph{#1}mbox{}}
fi
% set default figure placement to htbp
makeatletter
deffps@figure{htbp}
makeatother

newcommandblankpage{%
null
thispagestyle{empty}%
addtocounter{page}{-1}%
newpage}
usepackage{times}
usepackage[margin=1.5in]{geometry}
date{}
begin{document}

input{part1ch1}


part1ch1.tex looks like:



section{text...}









share|improve this question









New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Off topic: Is it necessary to make a document with such a complicated preamble?

    – JouleV
    10 hours ago






  • 2





    You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

    – campa
    10 hours ago














0












0








0








I'm new to Latex and I'm making a big document with a lot of sections, subsections etc. Could anyone find out why the sections numbering doesn't appear in the PDF?
Here is my preamble:



PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
PassOptionsToPackage{hyphens}{url}
%
documentclass{article}
usepackage{blindtext}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
%makeatletter
%patchcmd{ttlh@hang}{parindentz@}{parindentz@leavevmode}{}{}
%patchcmd{ttlh@hang}{noindent}{}{}{}
%makeatother
usepackage{lmodern}
usepackage{amssymb,amsmath}
usepackage{ifxetex,ifluatex}
ifnum 0ifxetex 1fiifluatex 1fi=0 % if pdftex
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{textcomp} % provides euro and other symbols
else % if luatex or xelatex
usepackage{unicode-math}
defaultfontfeatures{Scale=MatchLowercase}
defaultfontfeatures[rmfamily]{Ligatures=TeX,Scale=1}
fi
% use upquote if available, for straight quotes in verbatim environments
IfFileExists{upquote.sty}{usepackage{upquote}}{}
IfFileExists{microtype.sty}{% use microtype if available
usepackage{microtype}
UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
makeatletter
@ifundefined{KOMAClassName}{% if non-KOMA class
IfFileExists{parskip.sty}{%
usepackage{parskip}
}{% else
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
KOMAoptions{parskip=half}}
makeatother
usepackage{xcolor}
IfFileExists{xurl.sty}{usepackage{xurl}}{} % add URL line breaks if available
IfFileExists{bookmark.sty}{usepackage{bookmark}}{usepackage{hyperref}}
hypersetup{
pdfborder={0 0 0},
breaklinks=true}
urlstyle{same} % don't use monospace font for urls
usepackage{graphicx,grffile}
%makeatletter
defmaxwidth{ifdimGin@nat@width>linewidthlinewidthelseGin@nat@widthfi}
defmaxheight{ifdimGin@nat@height>textheighttextheightelseGin@nat@heightfi}
makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in includegraphics[width, height, ...]{}
setkeys{Gin}{width=maxwidth,height=maxheight,keepaspectratio}
setlength{emergencystretch}{3em} % prevent overfull lines
providecommand{tightlist}{%
setlength{itemsep}{0pt}setlength{parskip}{0pt}}
setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
ifxparagraphundefinedelse
letoldparagraphparagraph
renewcommand{paragraph}[1]{oldparagraph{#1}mbox{}}
fi
ifxsubparagraphundefinedelse
letoldsubparagraphsubparagraph
renewcommand{subparagraph}[1]{oldsubparagraph{#1}mbox{}}
fi
% set default figure placement to htbp
makeatletter
deffps@figure{htbp}
makeatother

newcommandblankpage{%
null
thispagestyle{empty}%
addtocounter{page}{-1}%
newpage}
usepackage{times}
usepackage[margin=1.5in]{geometry}
date{}
begin{document}

input{part1ch1}


part1ch1.tex looks like:



section{text...}









share|improve this question









New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm new to Latex and I'm making a big document with a lot of sections, subsections etc. Could anyone find out why the sections numbering doesn't appear in the PDF?
Here is my preamble:



PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
PassOptionsToPackage{hyphens}{url}
%
documentclass{article}
usepackage{blindtext}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
%makeatletter
%patchcmd{ttlh@hang}{parindentz@}{parindentz@leavevmode}{}{}
%patchcmd{ttlh@hang}{noindent}{}{}{}
%makeatother
usepackage{lmodern}
usepackage{amssymb,amsmath}
usepackage{ifxetex,ifluatex}
ifnum 0ifxetex 1fiifluatex 1fi=0 % if pdftex
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{textcomp} % provides euro and other symbols
else % if luatex or xelatex
usepackage{unicode-math}
defaultfontfeatures{Scale=MatchLowercase}
defaultfontfeatures[rmfamily]{Ligatures=TeX,Scale=1}
fi
% use upquote if available, for straight quotes in verbatim environments
IfFileExists{upquote.sty}{usepackage{upquote}}{}
IfFileExists{microtype.sty}{% use microtype if available
usepackage{microtype}
UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
makeatletter
@ifundefined{KOMAClassName}{% if non-KOMA class
IfFileExists{parskip.sty}{%
usepackage{parskip}
}{% else
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
KOMAoptions{parskip=half}}
makeatother
usepackage{xcolor}
IfFileExists{xurl.sty}{usepackage{xurl}}{} % add URL line breaks if available
IfFileExists{bookmark.sty}{usepackage{bookmark}}{usepackage{hyperref}}
hypersetup{
pdfborder={0 0 0},
breaklinks=true}
urlstyle{same} % don't use monospace font for urls
usepackage{graphicx,grffile}
%makeatletter
defmaxwidth{ifdimGin@nat@width>linewidthlinewidthelseGin@nat@widthfi}
defmaxheight{ifdimGin@nat@height>textheighttextheightelseGin@nat@heightfi}
makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in includegraphics[width, height, ...]{}
setkeys{Gin}{width=maxwidth,height=maxheight,keepaspectratio}
setlength{emergencystretch}{3em} % prevent overfull lines
providecommand{tightlist}{%
setlength{itemsep}{0pt}setlength{parskip}{0pt}}
setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
ifxparagraphundefinedelse
letoldparagraphparagraph
renewcommand{paragraph}[1]{oldparagraph{#1}mbox{}}
fi
ifxsubparagraphundefinedelse
letoldsubparagraphsubparagraph
renewcommand{subparagraph}[1]{oldsubparagraph{#1}mbox{}}
fi
% set default figure placement to htbp
makeatletter
deffps@figure{htbp}
makeatother

newcommandblankpage{%
null
thispagestyle{empty}%
addtocounter{page}{-1}%
newpage}
usepackage{times}
usepackage[margin=1.5in]{geometry}
date{}
begin{document}

input{part1ch1}


part1ch1.tex looks like:



section{text...}






numbering






share|improve this question









New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 10 hours ago









JouleV

10.8k22560




10.8k22560






New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 10 hours ago









JosefinJosefin

1




1




New contributor




Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Josefin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Off topic: Is it necessary to make a document with such a complicated preamble?

    – JouleV
    10 hours ago






  • 2





    You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

    – campa
    10 hours ago



















  • Off topic: Is it necessary to make a document with such a complicated preamble?

    – JouleV
    10 hours ago






  • 2





    You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

    – campa
    10 hours ago

















Off topic: Is it necessary to make a document with such a complicated preamble?

– JouleV
10 hours ago





Off topic: Is it necessary to make a document with such a complicated preamble?

– JouleV
10 hours ago




2




2





You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

– campa
10 hours ago





You have issued setcounter{secnumdepth}{-2}. Nothing will be numbered.

– campa
10 hours ago










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
});


}
});






Josefin is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483358%2fnumbering-sections-doesnt-work%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








Josefin is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Josefin is a new contributor. Be nice, and check out our Code of Conduct.













Josefin is a new contributor. Be nice, and check out our Code of Conduct.












Josefin is a new contributor. Be nice, and check out our Code of Conduct.
















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483358%2fnumbering-sections-doesnt-work%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Lallio

Futebolista

Jornalista