Hi all,
I am new using LaTex and i am having an issue with numbering sections as they are coming out as 0.1, 0.2, 0.3. Is there a way to make my section numbered 1, 2, 3... (then subsection 1.1,1.2,2.1)?
I am not using chapters as with fancyhdr it removes all my headers and footers+adds in Chapter x in gigantic letters.
I've tried changing from report to article which solves the issue but then i lose my title page and abstract!
Anyone have any suggestions on how to fix this?
Thanks in advance
Page Layout ⇒ Section Numbering 0.1
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Section Numbering 0.1
Hi dizzam,
welcome to the board!
I recommend to use a class without chapters, like article what you've mentioned. The article class is supporting abstract and titlepage too. Try the titlepage option:
You could use the titlepage environment instead of \maketitle.
Stefan
welcome to the board!
I recommend to use a class without chapters, like article what you've mentioned. The article class is supporting abstract and titlepage too. Try the titlepage option:
Code: Select all
\documentclass[a4paper,10pt,titlepage]{article}
Stefan
LaTeX.org admin
Re: Section Numbering 0.1
Hi Stefan,
Thanks for the help that one line sorted out the issues i had with the title page and abstract!
I've just hit 1 issue changing across to article. My header changed because of the move to the article class so i added this code:
\fancyhead[LE,RO]{\slshape \rightmark}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[CO,CE]{\thepage}
which is working fine but i am now getting the numbering from the section and subsection in the heading. Is there a way of removing the numbering from the header?
Thanks again for the support! its a slow learning curve using LaTex but the outcome is sooooo much better than word!!!
Thanks for the help that one line sorted out the issues i had with the title page and abstract!
I've just hit 1 issue changing across to article. My header changed because of the move to the article class so i added this code:
\fancyhead[LE,RO]{\slshape \rightmark}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[CO,CE]{\thepage}
which is working fine but i am now getting the numbering from the section and subsection in the heading. Is there a way of removing the numbering from the header?
Thanks again for the support! its a slow learning curve using LaTex but the outcome is sooooo much better than word!!!
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Section Numbering 0.1
Yes, there is, try these redefinitions:dizzam wrote:but i am now getting the numbering from the section and subsection in the heading. Is there a way of removing the numbering from the header?
Code: Select all
\renewcommand*\sectionmark[1]{\markboth{#1}{}}
\renewcommand*\subsectionmark[1]{\markright{#1}}
LaTeX.org admin
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Section Numbering 0.1
In my opinion there is a much more comfortable and also more flexible way of setting up page styles for the standard classes given with the titlesec package. Regarding its capabilities this package is often underestimated. Consider the following example.
The page style main contains still the numbering of the sections and subsections in the header. The other page styles front and back don't. I originally did this setup for a standard report document class (front matter with ToC and back matter with appendix) and adapted it to article. Feel free to try out. Read more about the package in its manual.
Best regards
Thorsten¹
Code: Select all
\documentclass[11pt,a4paper,english,titlepage,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage[pagestyles,raggedright,bf,sf]{titlesec}
\usepackage{lmodern}
\usepackage{blindtext}
\parindent0em
% Setup for pagestyles (titlesec)
\newpagestyle{front}{%
\headrule
\footrule
\sethead[\thepage][][\bfseries\sffamily\sectiontitle]{\bfseries\sffamily\sectiontitle}{}{\thepage}
\setfoot[][][\scshape Institution]{Title}{}{}
% \renewcommand{\makefootrule}{\rule[0.8\baselineskip]{\linewidth}{0.4pt}}
}
\newpagestyle{main}{%
\headrule
\footrule
\sethead[\thepage][][\bfseries\sffamily\thesubsection\quad\subsectiontitle]{\bfseries\sffamily\thesection\quad\sectiontitle}{}{\thepage}
\setfoot[][][\scshape Institution]{Title}{}{}
% \renewcommand{\makefootrule}{\rule[0.8\baselineskip]{\linewidth}{0.4pt}}
}
\newpagestyle{back}{%
\headrule
\footrule
\sethead[\thepage][][\bfseries\sffamily\sectiontitle]{\bfseries\sffamily\sectiontitle}{}{\thepage}
\setfoot[][][\scshape Institution]{Title}{}{}
% \renewcommand{\makefootrule}{\rule[0.8\baselineskip]{\linewidth}{0.4pt}}
}
\begin{document}
\pagestyle{main}
\Blinddocument
\end{document}
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10