Page LayoutSection Numbering 0.1

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
dizzam
Posts: 3
Joined: Mon May 04, 2009 8:09 pm

Section Numbering 0.1

Post by dizzam »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Section Numbering 0.1

Post by Stefan Kottwitz »

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:

Code: Select all

\documentclass[a4paper,10pt,titlepage]{article}
You could use the titlepage environment instead of \maketitle.

Stefan
LaTeX.org admin
dizzam
Posts: 3
Joined: Mon May 04, 2009 8:09 pm

Re: Section Numbering 0.1

Post by dizzam »

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!!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Section Numbering 0.1

Post by Stefan Kottwitz »

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?
Yes, there is, try these redefinitions:

Code: Select all

\renewcommand*\sectionmark[1]{\markboth{#1}{}}
\renewcommand*\subsectionmark[1]{\markright{#1}}
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Section Numbering 0.1

Post by localghost »

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.

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}
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¹
Post Reply