1

I'm learning LaTeX and writing an essay. I would like my essay to have the page "Sisällys" list every chapter as follows:

1 Johdanto                                         2
2 Päätäntö                                         2
Lähteet                                            2
Itsearviointi                                      2

Currently, it is missing those unnumbered chapters completely and unnumbered chapters should start on the same column as the number in the numbered chapters. How can I fix this issue?

\documentclass[12pt]{article}
    \title{\textbf{Gummi 0.8.0}}
    \author{Alexander van der Meij}
    \date{}
\addtolength{\topmargin}{-3cm}
\addtolength{\textheight}{3cm}

\usepackage{setspace} \usepackage{mathpazo} \usepackage{xurl} \usepackage[% left=3cm,% right=3cm,% top=2.5cm,%3 bottom=2.5cm,% headheight=33pt,% ]{geometry}% \usepackage[finnish]{babel} \usepackage[T1]{fontenc} \usepackage{hyperref}

\usepackage{scrlayer-scrpage} \clearpairofpagestyles \ohead{\pagemark} \begin{document} \setlength{\footheight}{17.99445pt} \topskip0pt \vspace{\fill} \thispagestyle{empty} \begin{center} title

$,$

name \end{center} \vspace*{\fill} \begin{center} \vspace{10em}

\end{center}

{\raggedleft number Autumn 2022

subject

university

13.10.2022

}

\newpage \setcounter{page}{1} \onehalfspacing \tableofcontents \newpage \noindent \section{Johdanto} lorem ipsum

\section{Päätäntö} lorem ipsum \section*{Lähteet} \begin{itemize} \item[] lorem1 \item[] lorem2

\item[] lorem3

\item[] lorem4

\end{itemize}

\section*{Itsearviointi} dsadsd \end{document}

JamesT
  • 3,169
  • 1
    Welcome to TeX SX! The titletoc package, which comes with titlesec, has a \titlecontents command, which takes into account numbered as well as unnumbered sections. See the titlesec documentation, §6 (A ten minute guide to titletoc). – Bernard Oct 13 '22 at 18:50
  • 1
    There is also https://tex.stackexchange.com/questions/292408/redefine-section-so-it-behaves-exactly-as-section-except-leaves-out-the which does something similar as one of the answers in the first link but more automated. – Marijn Oct 13 '22 at 18:52
  • I tried to use the titlesec package but I was unable to find a working solution. – latexlearner Oct 14 '22 at 06:52

0 Answers0