1

In this answer @esdd helped me to declare a new list of equations with KOMA's own abilities. As required each equation gets numbered with eq (1.1) behind the equation itself. The only way to add this equation to the above mentioned list of equations is via the \caption-command, but this adds a caption under the equation. If I use \caption[this goes in the list of equations]{}it still displays "Gl.:" under the equation, so the caption is still present under the equation, but without text.

Is there an option to get rid of the complete caption under the equation but still add contents to the list of equations?

I tried it with \addcontentsline{loe}{eq}{Gl.: Testformel 2 (Verzeichnis)}but I couldn't get it to add the equation number, as using \addcontentsline{loe}{eq}{Gl.\ref{eq:eq2}: Testformel 2 (Verzeichnis)}didn't gave the proper spacing around the equation number in the list of equations as well as it only showed "2" instead of "2.1"

MWE:

\documentclass[
listof=totoc,
listof=entryprefix,
]{scrreprt}
\usepackage{lipsum}% only for dummy text
\usepackage[british,ngerman]{babel}
\usepackage{amsmath}

\DeclareNewTOC[ category=float, counterwithin=chapter, float,% declares floating environment eq floatpos=ht, nonfloat,% declares non-floating environment eq- listname={Formelverzeichnis}, name=Formel, tocentrystyle=tocline, tocentrylevel:=table, tocentryindent:=table, tocentrynumwidth:=table, type=eq, ]{loe}

\newcaptionname{ngerman}{\listofloeentryname}{Gl.}

\begin{document} \tableofcontents \listofeqs

\chapter{Test}

\begin{eq} \label{eq:eq1}
    \begin{subequations}
        \begin{align}
            a &= b \\
            b &= c.
        \end{align}
    \end{subequations}
    \caption[Testformel 1 (Verzeichnis)]{}
\end{eq}

\chapter{Foo}

\begin{eq} \label{eq:eq2}
    \begin{subequations}
        \begin{align}
            a &= b \\
            b &= c.
        \end{align}
    \end{subequations}
\addcontentsline{loe}{eq}{Gl.\ref{eq:eq2}: Testformel 2 (Verzeichnis)}
\end{eq}

\end{document}

Lukas
  • 659

1 Answers1

1

Two remarks:

  1. The counter of eq and the counter of numbered equations are separate counters. So their value could be different.
  2. Both labels eq:eq1 and eq:eq2 refer to the chapter counter. If they should refer to the eq counter put them right after the associated \caption command. If they should refer to the equation counter put them right after \begin{subequations}.

If you want to add an eq to the list of equations without a caption in the document, you can use:

\refstepcounter{eq}
\addxcontentsline{loe}{eq}[\theeq]{listentry}

Example:

\documentclass[
  listof=totoc,
  listof=entryprefix,
]{scrreprt}
\usepackage{lipsum}% only for dummy text
\usepackage[british,ngerman]{babel}
\usepackage{amsmath}

\DeclareNewTOC[ category=float, counterwithin=chapter, float,% declares floating environment eq floatpos=ht, nonfloat,% declares non-floating environment eq- listname={Formelverzeichnis}, name=Formel, tocentrystyle=tocline, tocentrylevel:=table, tocentryindent:=table, tocentrynumwidth:=table, type=eq, ]{loe}

\newcaptionname{ngerman}{\listofloeentryname}{Gl.}

\begin{document} \tableofcontents \listofeqs

\chapter{Test} \begin{eq} \begin{subequations} \begin{align} a &= b \ b &= c. \end{align} \end{subequations} \refstepcounter{eq} \addxcontentsline{loe}{eq}[\theequation]{Testformel 1 (Verzeichnis)} \end{eq}

\chapter{Foo} \begin{eq} \begin{subequations} \begin{align} a &= b \ b &= c. \end{align} \end{subequations} \refstepcounter{eq} \addxcontentsline{loe}{eq}[\theequation]{Testformel 2 (Verzeichnis)} \end{eq} \end{document}

But if you want to have the equation counter in the list of equations, you should use:

\addxcontentsline{loe}{eq}[\theequation]{listentry}

But then there is no need of environment eq.

Example:

\documentclass[
  listof=totoc,
  listof=entryprefix,
]{scrreprt}
\usepackage{lipsum}% only for dummy text
\usepackage[british,ngerman]{babel}
\usepackage{amsmath}

\DeclareNewTOC[ category=float, counterwithin=chapter, %float,% declares floating environment eq %floatpos=ht, %nonfloat,% declares non-floating environment eq- listname={Formelverzeichnis}, name=Formel, tocentrystyle=tocline, tocentrylevel:=table, tocentryindent:=table, tocentrynumwidth:=table, type=eq, ]{loe}

\newcaptionname{ngerman}{\listofloeentryname}{Gl.}

\begin{document} \tableofcontents \listofeqs

\chapter{Test} \begin{subequations} \addxcontentsline{loe}{eq}[\theequation]{Testformel 1 (Verzeichnis)} \begin{align} a &= b \ b &= c. \end{align} \end{subequations}

\chapter{Foo} \begin{subequations} \addxcontentsline{loe}{eq}[\theequation]{Testformel 2 (Verzeichnis)} \begin{align} a &= b \ b &= c. \end{align} \end{subequations} \end{document}

esdd
  • 85,675
  • Thanks, I'll try it out tomorrow! What exactly is the difference between my addcontentsline and your addxcontentsline? – Lukas Aug 29 '21 at 21:56
  • 1
    \addxcontentsline is a KOMA-Script macro. It provides an optional argument for the number. – esdd Aug 29 '21 at 22:59