latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
123 stars 34 forks source link

KOMA script's \Ifthispageodd gives and error when babel's layout = counters is used #272

Closed vogelso closed 6 months ago

vogelso commented 6 months ago

I am trying to use Ifthispageodd in LuaLateX in a scrbook with an arabic section. But setting the right direction of arabic numerals throws an error if Ifthispageodd is used somewhere in the document:

\documentclass[twoside]{scrbook}

\usepackage[
        bidi=basic,
        layout=contents counters, 
        english
        ]{babel}        

\begin{document}    
\pagenumbering{arabic}
\Ifthispageodd{odd}{even}
Test
\end{document}

Throws the error:

! Missing number, treated as zero.
<to be read again> 
\protect 
l.14 \Ifthispageodd

                 {odd}{even}
? 
! Emergency stop.

If counters is removed from the babel layout options the document compiles without issues. I am not sure whether this is rather a babel or a KOMA issue though... MWE.log

u-fischer commented 6 months ago

imho this is something KOMA should change. It writes out \arabic{page} instead of \the\value{page} to the aux, and that is dangerous as \arabic doesn't always gives a number (as here, but there are other packages which redefine \arabic too.

vogelso commented 6 months ago

Alright, thanks, I see. So I will post this as an issue on the KOMA github page ;-)

vogelso commented 6 months ago

This issue has now been fixed on the KOMA side:

https://sourceforge.net/p/koma-script/code/4093/

@u-fischer Many thanks for the hint :-)

vogelso commented 6 months ago

Closed