
Então, estou escrevendo minha tese (em linguística) usando o book
documentclass
para fazer isso. Para meus exemplos numerados estou usando o linguex
pacote.
\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}
O contador dos exemplos numerados agora é zerado no início de cada capítulo. Portanto, o primeiro exemplo de cada capítulo agora está numerado (1). Não é isso que eu gostaria, já que às vezes preciso me referir a um exemplo de outro capítulo e então não fica claro a qual exemplo me refiro exatamente. A saída do capítulo 3 agora se parece com isto. Como você pode ver, a referência fica confusa.
Alguém sabe como consertar/alterar isso? Idealmente, o capítulo três seria algo como:
Como você pode ver (4) e (5) são muito diferentes de (3).
(4) Este é um exemplo.
(5) Este é outro exemplo.
Li o linguex
manual, mas não consegui encontrar nenhuma dica de solução e não consegui encontrar uma resposta na Internet.
Responder1
Você deve incluir o remreset
pacote, que permite remover contadores da lista de redefinição (com o comando \@removefromreset
)
O contador responsável é chamado 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}
Espero que a numeração dos subexemplos deva ser redefinida em cada capítulo, de qualquer maneira.
Responder2
Você também pode usar \counterwithout{<counter>)(<block>}
do chngcntr
pacote:
\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}