2

What I want to achieve is, that the first few sections and included page numbers of my document should be in roman and the rest of the document in arabic numbers.

Like this:

I ....

II ....

1 ....

2 ....

3 ....

Now this works fine, the page numbers and sections are numbered as I want them to. But I have the following problem: if I click the first section of my "arabic section" in the table of contents it jumps to the first "roman section". This happens for the amount of "roman sections". If I click on the third "arabic section" it's fine.

I just want a jump to the right section, if I click it in the table of contents.

This is what I have:

 \documentclass[12pt, a4paper, ngerman, oneside, bibtotoc, liststotoc, bibtotocnumbered, toctotoc]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\newcommand{\sectionnumbering}[1]{% 
  \setcounter{section}{0}% 
    \renewcommand{\thesection}{\csname #1\endcsname{section}}}

\begin{document}
    \section{Deckblatt}
    ...

    \pagenumbering{roman} 
    \sectionnumbering{Roman}
    \pagestyle{empty}

    \section{Erklaerung}

    \section{Sperrvermerk}  

    \tableofcontents
    \newpage
    \listoffigures
    \clearpage

    \pagenumbering{arabic} 
    \sectionnumbering{arabic}

    \pagestyle{fancy}
    \renewcommand{\sectionmark}[1]{\markright{\thesection{} #1}{}}

    \section{KapitelEinleitung}
    \section{...}
\end{document}

I tried some suggested solutions using \newcounter{} and \setcounter{}{}, but with no success.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Oct 10 '14 at 10:33
  • Where is \sectionnumbering from? All the files from \include... are unavailable to users here – user31729 Oct 10 '14 at 10:34
  • @ChristianHupfer I updated the question, with all necessary packages. – Steve Benett Oct 10 '14 at 12:47
  • I assume you forgot to include hyperref. Where does Abbildungsverzeichnis come from? It is listed in the toc as a section* (or phantomsection). – John Kormylo Oct 10 '14 at 14:41
  • Anyway, the problem is that hyperref is using the section number instead of the stc counter. – John Kormylo Oct 10 '14 at 14:57
1

The cause of this behaviour as described by the OP is the resetting of section counters, thus confusing hyperref. Using hypertexnames=false as an option to hyperref will generate unique page anchor link names.

 \documentclass[12pt, a4paper, ngerman, oneside, bibtotoc, liststotoc, bibtotocnumbered, toctotoc]{scrartcl}
\usepackage{fancyhdr}
\usepackage[utf8x]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[unicode,hypertexnames=false]{hyperref}
\usepackage{bookmark}
\PrerenderUnicode{ä}


\pagestyle{fancy}
\fancyhf{}
\newcommand{\sectionnumbering}[1]{% 
  \setcounter{section}{0}% 
  \renewcommand{\thesection}{\csname #1\endcsname{section}}%
}%

\begin{document}
\section{Deckblatt}

\pagenumbering{roman} 
\sectionnumbering{Roman}
\pagestyle{empty}
\section{Erklärung}
\section{Sperrvermerk}  
\clearpage
\tableofcontents
\newpage
\listoffigures
\clearpage

\pagenumbering{arabic} 
\sectionnumbering{arabic}

\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection{} #1}{}}
\section{KapitelEinleitung}
\section{...}
\end{document}
  • This works but the section numbering goes like this: I.., II..., 3... – Steve Benett Oct 10 '14 at 12:48
  • @SteveBenett: I will look later on – user31729 Oct 10 '14 at 13:01
  • @SteveBenett: I have updated my solution – user31729 Oct 11 '14 at 5:48
1

I had to fool hyperref into thinking you were using chapters.

\documentclass[12pt, a4paper, ngerman, oneside, bibtotoc, liststotoc, bibtotocnumbered, toctotoc]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{fancyhdr}
\newcounter{chapter}% causes hyperref to use chapter numbers
\usepackage{hyperref}
\pagestyle{fancy}
\fancyhf{}

\newcommand{\sectionnumbering}[1]{% 
  \stepcounter{chapter}% used by hyperref only
  \setcounter{section}{0}% not automatic
    \renewcommand{\thesection}{\csname #1\endcsname{section}}}

\begin{document}
    \section{Deckblatt}
    ...

    \pagenumbering{roman} 
    \sectionnumbering{Roman}
    \pagestyle{empty}

    \section{Erklaerung}

    \section{Sperrvermerk}  

    \tableofcontents
    \newpage
    \listoffigures
    \clearpage

    \pagenumbering{arabic} 
    \sectionnumbering{arabic}

    \pagestyle{fancy}
    \renewcommand{\sectionmark}[1]{\markright{\thesection{} #1}{}}

    \section{KapitelEinleitung}
    \section{...}
 \end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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