# [OS X TeX] arabic numbering with hebrew in babel

Art Werschulz agw at comcast.net
Mon Jun 8 23:51:42 CEST 2015

Hi.

I’m in the process of (co-)writing a textbook.  Said book will have a solutions manual, and so I’m using the answers package.  Chapters having exercises in the book begin with \chapterwithexercises, rather than \chapter.  This new control sequence is defined via

\newcounter{chapterans}
\newcommand\chapterwithexercises{
\chapter{#1}
\setcounter{chapterans}{\value{chapter}}
}

\setcounter{chapter}{0}
\chapter{Sets}
\begin{solution}{1.6.1}
(a), (b), (d), (f) and~(h) are true.

Note that (c) is false because the set $T$ is not contained in
itself; (e) is false because there is no element in $T$ that is
the set containing the elements $3,5, \text{and}~44$; (g) is
false for a similar reason to (e) and (i) is false because $T = T$ and therefore cannot be a proper subset of itself.

\end{solution}

and suchlike.

This works fine, until I bring babel into the picture.  We’re going to have a few lines of Irish Gaelic and Hebrew in the book’s dedication.

The file answers.tex now has material such as

\setcounter{chapter}{\@@number{1}}
\chapter{Sets}
\begin{solution}{\protect \beginL \protect \beginL 2\endL .\protect \beginL 6\endL \endL .\protect \beginL 1\endL }
(a), (b), (d), (f) and~(h) are true.

Note that (c) is false because the set $T$ is not contained in
itself; (e) is false because there is no element in $T$ that is
the set containing the elements $3,5, \text{and}~44$; (g) is
false for a similar reason to (e) and (i) is false because $T = T$ and therefore cannot be a proper subset of itself.

\end{solution}

When I run this through pdflatex, I get the following

! Improper \spacefactor.

l.37 \setcounter{chapter}{\@@number{1}}

?

! Package calc Error: \@m ' invalid at this point.

See the calc package documentation for explanation.
Type  H <return>  for immediate help.
...

l.37 \setcounter{chapter}{\@@number{1}}

?

Chapter 1.
! Improper \beginL.
<argument> Exercise \protect \beginL
\protect \beginL 2\endL .\protect \begi...
l.39 ...nL 6\endL \endL .\protect \beginL 1\endL }

?

after which I give up.

Suggestions on how to fix this?  Thanks!

Art Werschulz
agw at comcast.net

`