1

I am using scrbook via kaobook and I would like to make a document that contains a single chapter, unnumbered and unnamed. This probably means I shouldn't be using scrbook to begin with, but I'd like to make a document that is in the same style as another that will have multiple chapters, numbered and named.

\documentclass{scrbook}
\usepackage{mwe}

\begin{document}
\mainmatter

\section{Introduction}
We will be brief.

\section{Details}

\begin{figure}
    \centering
    \includegraphics[width=0.5\columnwidth]{example-image}
    \caption{
        A figure caption
    }
    \label{fig-1}
\end{figure}

There is no information in Figure~\ref{fig-1}.

\end{document}

produces

enter image description here

and I would basically like to remove the 0. from all references and headings. So the MWE would produce a figure numbered 1, not 0.1.

I'm hoping there's a straightforward way to get this done. This document will never have more than one chapter in it, so I would not mind a solution that would e.g. produce two figures called 1 if they are the first figure in two different chapters. If I can literally supress the 0. prefix of the labels, that would be enough.

I noticed \chapappifchapterprefix mentioned in kaobook.cls, but I believe that refers to e.g. "Chapter" (related to Custom chapter prefix text in KOMA-Script)

Related but different question: How to use unnumbered chapters with KOMA-script?

1

2 Answers 2

2

Use the \counterwithout directive:

\documentclass{scrbook}
\usepackage{mwe}
\counterwithout{section}{chapter}
\counterwithout{figure}{chapter}
\begin{document}
\mainmatter

\section{Introduction}
We will be brief.

\section{Details}

\begin{figure}
    \centering
    \includegraphics[width=0.5\columnwidth]{example-image}
    \caption{
        A figure caption
    }
    \label{fig-1}
\end{figure}

There is no information in Figure~\ref{fig-1}.

\end{document} 

enter image description here

2
  • Thank you! If I have tables, algorithms, and other kinds of floats generally, I suppose I need to use the \counterwithout directive (which if I understand correctly, is defined by LaTeX) for each float environment?
    – Gus
    May 30, 2021 at 17:52
  • 1
    For tables, certainly. For other environments with a counter, it depends on whether they're numbered per chapter or not. For instance, some document classes number theorems continuously for the whole document.
    – Bernard
    May 30, 2021 at 17:56
0

I have added an unnamed and unnumbered \chapter to your MWE and changed the numbering schemes.

% anonchapprob.tex  SE 599268

\documentclass{scrbook}
\usepackage{mwe}
\usepackage{lipsum}

\begin{document}
\mainmatter
\chapter*{}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thefigure}{\arabic{figure}}

\section{Introduction}
We will be brief.

\section{Details}

\begin{figure}
    \centering
    \includegraphics[width=0.5\columnwidth]{example-image}
    \caption{
        A figure caption
    }
    \label{fig-1}
\end{figure}

There is no information in Figure~\ref{fig-1}.

\lipsum[1-8]

\end{document}

I hope I have interpreted your desire correctly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .