
そこで、私はこれを実行するため、 を使用して (言語学の) 論文を書いています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 章は次のようになります。
ご覧のとおり、(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}