Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Whenever I have \section{something} a number appears before it, like

1.Something

How can I exclude this number?

And for table of content, I have something like

\setcounter{tocdepth}
\tableofcontents

This works perfectly fine, but I would like to add roman number in some-places in table of content and would like to include, some titles, before \tableofcontents command is called into table of content. For example:

\section{example}

\setcounter{tocdepth}
\tableofcontents

How to include example in the table of content, with roman number in the page column?

My MWE is as follow:

\documentclass[12pt,oneside, paper=a4,pagesize=pdftex, liststotoc, bibtotoc]{scrartcl}
%Einstellungen der Seitenrnder
\usepackage[left=3.0cm,right=3.0cm,top=3cm,bottom=3cm,includeheadfoot]{geometry}
\usepackage{graphicx}
%Umlaute ermglichen
\usepackage[latin1]{inputenc}
\usepackage{color}
%\usepackage[printonlyused]{acronym}
\usepackage{cite}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{amssymb}
\usepackage{wrapfig}
\usepackage[tight,TABTOPCAP]{subfigure}
\usepackage{float}
\usepackage{epstopdf}
\definecolor{orange}{rgb}{1,0.5,0}
\usepackage[T1]{fontenc}
\usepackage{algorithmic}
\usepackage{amsmath}
%------------------------------------------------------------------------- 
% macros - newly defined by htrsek
\newcommand{\todo}[1]{\textcolor{red}{\textbf{TODO: #1}}}
\newcommand{\comment}[2]{\textcolor{orange}{\textbf{\textit{\textless Comment (#1): #2\textgreater}}}}
\newcommand{\inprogress}[3]{\textcolor{blue}{\textbf{InProgress: #1}}}
\newcommand{\translate}[4]{\textcolor{green}{\textbf{(#1)}}}
\newcommand{\flexWARE}{\textsuperscript{flex}WARE }
\newcommand{\thedate}{\today}
%[BC] Using the listing package for source code embedding.
\usepackage{listings} \lstset{numbers=left, numberstyle=\tiny, numbersep=5pt} \lstset{language=Perl} 

 %PDF Kram
\usepackage[%
    pdftitle={something},% Titel des PDF Dokuments.
    pdfauthor={someone},%Autor des PDF Dokuments.
    pdfsubject={something},%Thema des PDF Dokuments.
    pdfcreator={MiKTeX, LaTeX, hyperref, KOMA-Script},%Erzeuger des PDF Dokuments.
    pdfkeywords={project title},% auch fr PDF 
    pdfpagemode=UseOutlines,% Inhaltsverzeichnis anzeigen beim 
    %pdfdisplaydoctitle=true,%Dokumenttitel statt Dateiname 
    pdflang=en%Sprache des Dokuments.
]{hyperref}

\definecolor{LinkColor}{rgb}{0,0,0.5}
\definecolor{hellgelb}{rgb}{1,1,0.8}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0.4,0.4,0.4}
\definecolor{colComments}{rgb}{0,0.5,0}
\definecolor{colString}{rgb}{1,0,0}
\definecolor{blue}{rgb}{0,0,1}

\hypersetup
{
    colorlinks=true,%        Aktivieren von farbigen Links im Dokument (keine Rahmen)
    linkcolor=LinkColor,%    Farbe festlegen.
    citecolor=LinkColor,%    Farbe festlegen.
    filecolor=LinkColor,%    Farbe festlegen.
    menucolor=LinkColor,%    Farbe festlegen.
    urlcolor=LinkColor,%     Farbe von URL's im Dokument.
    bookmarksnumbered=true%  Überschriftsnummerierung im PDF Inhalt anzeigen.
}
%Zeilenabstand 1.2
\linespread{1.2}
%Kopf- und Fusszeile
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%Kopfzeile links bzw. innen
\fancyhead[L]{\textsf{someone}}
%Kopfzeile rechts bzw. aussen
\fancyhead[R]{\textsf{\nouppercase{\leftmark}}}
%Linie oben
\renewcommand{\headrulewidth}{0.5pt}
%Fusszeile links bzw. innen
\fancyfoot[L]{\textsf{Something}}
%Fusszeile rechts bzw. aussen
\fancyfoot[R]{{\textsf{\pagemark}}}
%Linie unten
\renewcommand{\footrulewidth}{0.5pt}
\setlength{\parindent}{0pt}

%Setup for listings.
\lstset{basicstyle=\small}
\lstset{language=C}

\newtheorem{Def}{Definition}
\begin{document}
\thispagestyle{empty}

\newpage
\pagenumbering{arabic}

\thispagestyle{empty}
\mbox{}

\newpage
\renewcommand{\thepage}{\roman{page}}
\section*{Affirmation}
\newpage
\section*{Abstract}

\newpage

\section*{Acknowledgements}

\newpage



\setcounter{tocdepth}{3}
\tableofcontents


\newpage




\end{document}         

As it can be seen affirmation, abstract come before the table of content.

And I would want my table of content to look something like this:

Table of content Edit: My document class is scrartcl and I don't use frontmatter.

share|improve this question
    
Are you using book class? Are you trying to put the section in frontmatter? Please give a MWE so that those who try to answer will be spared of guess work and your chances of getting a specific answer improve. –  Harish Kumar Jan 14 '13 at 10:30
    
@HarishKumar Thanks for reminding, I have edited the question. –  Kishore pandey Jan 14 '13 at 10:40
    
@HarishKumar My MWE is more than 180 lines, I think if I add it, the description would look elongated. –  Kishore pandey Jan 14 '13 at 10:52
add comment

2 Answers

up vote 4 down vote accepted

I think you are trying to write a report/book. In that case you should better consider using book or scrreprt or scrbook. Hence you can put frontmatter mainmatter and backmatter easily. However, the following works:

\documentclass[12pt,oneside, paper=a4,pagesize=pdftex, liststotoc, bibtotoc]{scrartcl}
%Einstellungen der Seitenrnder
\usepackage[left=3.0cm,right=3.0cm,top=3cm,bottom=3cm,includeheadfoot]{geometry}
\usepackage{graphicx}
%Umlaute ermglichen
\usepackage[latin1]{inputenc}
\usepackage{color}
%\usepackage[printonlyused]{acronym}
\usepackage{cite}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{amssymb}
\usepackage{wrapfig}
\usepackage[tight,TABTOPCAP]{subfigure}
\usepackage{float}
\usepackage{epstopdf}
\definecolor{orange}{rgb}{1,0.5,0}
\usepackage[T1]{fontenc}
\usepackage{algorithmic}
\usepackage{amsmath}
%------------------------------------------------------------------------- 
% macros - newly defined by htrsek
\newcommand{\todo}[1]{\textcolor{red}{\textbf{TODO: #1}}}
\newcommand{\comment}[2]{\textcolor{orange}{\textbf{\textit{\textless Comment (#1): #2\textgreater}}}}
\newcommand{\inprogress}[3]{\textcolor{blue}{\textbf{InProgress: #1}}}
\newcommand{\translate}[4]{\textcolor{green}{\textbf{(#1)}}}
\newcommand{\flexWARE}{\textsuperscript{flex}WARE }
\newcommand{\thedate}{\today}
%[BC] Using the listing package for source code embedding.
\usepackage{listings} \lstset{numbers=left, numberstyle=\tiny, numbersep=5pt} \lstset{language=Perl} 

 %PDF Kram
\usepackage[%
    pdftitle={something},% Titel des PDF Dokuments.
    pdfauthor={someone},%Autor des PDF Dokuments.
    pdfsubject={something},%Thema des PDF Dokuments.
    pdfcreator={MiKTeX, LaTeX, hyperref, KOMA-Script},%Erzeuger des PDF Dokuments.
    pdfkeywords={project title},% auch fr PDF 
    pdfpagemode=UseOutlines,% Inhaltsverzeichnis anzeigen beim 
    %pdfdisplaydoctitle=true,%Dokumenttitel statt Dateiname 
    pdflang=en%Sprache des Dokuments.
]{hyperref}

\definecolor{LinkColor}{rgb}{0,0,0.5}
\definecolor{hellgelb}{rgb}{1,1,0.8}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0.4,0.4,0.4}
\definecolor{colComments}{rgb}{0,0.5,0}
\definecolor{colString}{rgb}{1,0,0}
\definecolor{blue}{rgb}{0,0,1}

\hypersetup
{
    colorlinks=true,%        Aktivieren von farbigen Links im Dokument (keine Rahmen)
    linkcolor=LinkColor,%    Farbe festlegen.
    citecolor=LinkColor,%    Farbe festlegen.
    filecolor=LinkColor,%    Farbe festlegen.
    menucolor=LinkColor,%    Farbe festlegen.
    urlcolor=LinkColor,%     Farbe von URL's im Dokument.
    bookmarksnumbered=true%  Überschriftsnummerierung im PDF Inhalt anzeigen.
}
%Zeilenabstand 1.2
\linespread{1.2}
%Kopf- und Fusszeile
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%Kopfzeile links bzw. innen
\fancyhead[L]{\textsf{someone}}
%Kopfzeile rechts bzw. aussen
\fancyhead[R]{\textsf{\nouppercase{\leftmark}}}
%Linie oben
\renewcommand{\headrulewidth}{0.5pt}
%Fusszeile links bzw. innen
\fancyfoot[L]{\textsf{Something}}
%Fusszeile rechts bzw. aussen
\fancyfoot[R]{{\textsf{\pagemark}}}
%Linie unten
\renewcommand{\footrulewidth}{0.5pt}
\setlength{\parindent}{0pt}

%Setup for listings.
\lstset{basicstyle=\small}
\lstset{language=C}

\newtheorem{Def}{Definition}
\begin{document}
\thispagestyle{empty}

\newpage
\pagenumbering{arabic}

\thispagestyle{empty}
\mbox{}

\clearpage
%\renewcommand{\thepage}{\roman{page}}
\pagenumbering{roman}
\setcounter{tocdepth}{3}
\tableofcontents
\clearpage
\section*{Affirmation}
\addcontentsline{toc}{section}{Affirmation}
\clearpage
\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}

\clearpage

\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}

\clearpage
\pagenumbering{arabic}

\section{some section}
\subsection{some sub section}
\newpage

\end{document}

enter image description here

share|improve this answer
    
thanks a lot. That was useful. –  Kishore pandey Jan 14 '13 at 12:03
add comment

You can exclude the numbering of sections by using \section*{something}.

share|improve this answer
    
Thank you that was helpful. –  Kishore pandey Jan 14 '13 at 10:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.