1

I tried to use

\counterwithout{exe}{chapter}

for continuous numbering over chapters of langsci-gb4e examples. But the following error appears.

Latex Error: No counter 'exe' defined

Working example

\documentclass{book}

\usepackage{langsci-gb4e}

%\counterwithout{exe}{chapter}

\begin{document} 

    \chapter{First Chapter}

    \begin{exe}
    \ex  first example
    \end{exe}

    \chapter{Second Chapter}

    \begin{exe}
    \ex  second example
    \end{exe}

\end{document} 

Output (I would like the second example to be numbered "(2) second example"):

enter image description here

1
  • Welcome to TeX.se and thanks for adding a minimal example document! Are you forced to use langsci-gb4e as opposed to using just gb4e?
    – Alan Munn
    Commented Sep 14, 2022 at 13:55

1 Answer 1

1

For reasons that are completely unclear to me, langsci-gb4e uses the equation counter inside its definition of {exe} even though the counter used in printing the example itself is xnumi. On the face of it, this seems like a really bad idea, because, for example, it removes the possibility of having actual {equation} environments numbered independently of the {exe} environment, but it is what it is. So you can achieve what you want by using:

\counterwithout{equation}{chapter}

Here's a full example:

\documentclass{book}

\usepackage{langsci-gb4e}

\counterwithout{equation}{chapter}

\begin{document} 

    \chapter{First Chapter}

    \begin{exe}
    \ex  first example
    \end{exe}

    \chapter{Second Chapter}

    \begin{exe}
    \ex  second example
    \end{exe}

\end{document} 

partial output of code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .