Documentclass `book': 번호가 매겨진 예제가 각 장에서 시작되는 것을 방지하는 방법

Documentclass `book': 번호가 매겨진 예제가 각 장에서 시작되는 것을 방지하는 방법

그래서 저는 book documentclass이것을 하기 위해 (언어학에 대한) 논문을 쓰고 있습니다. 번호가 매겨진 예에서는 패키지를 사용하고 있습니다 linguex.

   \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}

번호가 매겨진 예시의 카운터는 이제 각 장을 시작할 때 재설정됩니다. 따라서 각 장의 첫 번째 예에는 이제 번호가 매겨져 있습니다(1). 가끔 다른 장의 예를 참조해야 할 경우가 있는데 정확히 어떤 예를 의미하는지 불분명하기 때문에 이는 제가 원하는 것이 아닙니다. 이제 3장의 출력은 다음과 같습니다. 보시다시피 참조가 혼란스러워집니다.

3장의 출력

이 문제를 해결/변경하는 방법을 아는 사람이 있나요? 이상적으로 3장은 다음과 같습니다.

보시다시피 (4)와 (5)는 (3)과 매우 다릅니다.

(4) 이것은 예입니다.

(5) 이것은 또 다른 예입니다.

설명서를 읽었 linguex지만 해결 방법에 대한 힌트를 찾을 수 없었고 인터넷에서도 답을 찾을 수 없었습니다.

답변1

재설정 목록에서 카운터를 제거할 수 있는 패키지를 포함해야 합니다 remreset(명령 사용 \@removefromreset).

담당 카운터를 이라고 합니다 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}

어쨌든 모든 장에서 하위 예제 번호 매기기를 재설정해야 한다고 생각합니까?

답변2

\counterwithout{<counter>)(<block>}패키지 에서 사용할 수도 있습니다 chngcntr.

\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}

여기에 이미지 설명을 입력하세요

관련 정보