Dokumentklasse „Buch“: So verhindern Sie, dass nummerierte Beispiele jedes Kapitel von vorne beginnen

Dokumentklasse „Buch“: So verhindern Sie, dass nummerierte Beispiele jedes Kapitel von vorne beginnen

Ich schreibe also meine Abschlussarbeit (in Linguistik) und verwende dazu das Paket book documentclass. Für meine nummerierten Beispiele verwende ich das linguexPaket.

   \documentclass[12pt, a4paper, oneside]{book}
      \usepackage{linguex}
   \begin{document}
      \chapter{This is chapter one}
       I have a nice sentence here:
       \ex. This is an example.
       And a nice additional example:
       \ex. This is another example.
       \chapter{This is chapter two}
       This is the most important example in the thesis and I will refer to it often!
      \ex.\label{important} This is a very important example.

      \chapter{This is chapter three}
      As you can see, \Next and \NNext are very different from \ref{important}.
     \ex. This is an example.
     \ex. This is another example.
   \end{document}

Der Zähler für die nummerierten Beispiele wird nun zu Beginn jedes Kapitels zurückgesetzt. Das erste Beispiel in jedem Kapitel ist nun also nummeriert (1). Das ist nicht das, was ich möchte, da ich manchmal auf ein Beispiel aus einem anderen Kapitel verweisen muss und dann nicht klar ist, welches Beispiel ich genau meine. Die Ausgabe von Kapitel 3 sieht nun so aus. Wie Sie sehen, wird die Referenzierung verwirrend.

Ausgabe für Kapitel 3

Weiß jemand, wie man das beheben/ändern kann? Idealerweise würde Kapitel drei ungefähr so ​​aussehen:

Wie man sehen kann, unterscheiden sich (4) und (5) stark von (3).

(4) Dies ist ein Beispiel.

(5) Dies ist ein weiteres Beispiel.

Ich habe das linguexHandbuch gelesen, konnte dort aber keine Lösungshinweise finden und auch im Internet konnte ich keine Antwort finden.

Antwort1

Sie müssen das remresetPaket einbinden, das das Entfernen von Zählern aus der Reset-Liste ermöglicht (mit dem Befehl \@removefromreset).

Der zuständige Zähler heißt ExNo.

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{linguex}
\usepackage{remreset}
\makeatletter
\@removefromreset{ExNo}{chapter}
\makeatother

\begin{document}

\chapter{This is chapter one} I have a nice sentence here:

\ex. This is an example.

And a nice additional example: \ex. This is another example.

\chapter{This is chapter two} This is the most important example in the thesis and I will refer to it often! \ex.\label{important} This is a very important example.

\chapter{This is chapter three} As you can see, \Next and \NNext are very different from \ref{important}. \ex. This is an example.

\ex. This is another example.

\end{document}
\begin{document}

\chapter{Chapter One}

\ex. Ex. One

\ex. Ex. Two

\chapter{Chapter Two}

\ex. Ex. Three

\end{document}

Ich gehe davon aus, dass die Nummerierung der Unterbeispiele sowieso in jedem Kapitel zurückgesetzt werden sollte?

Antwort2

Sie können auch \counterwithout{<counter>)(<block>}das folgende chngcntrPaket verwenden:

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{linguex}
\usepackage{chngcntr}

\counterwithout{ExNo}{chapter}

\begin{document}

\chapter{This is chapter one} I have a nice sentence here:

\ex. This is an example.

And a nice additional example: \ex. This is another example.

\chapter{This is chapter two} This is the most important example in the thesis and I will refer to it often! \ex.\label{important} This is a very important example.

\chapter{This is chapter three} As you can see, \Next and \NNext are very different from \ref{important}. \ex. This is an example.

\ex. This is another example.

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen