I have observed some strange behavior and I would like to know if this is a bug, and if so, then whose bug it is.
When using polyglossia
with XeLaTeX, I sometimes get different pagebreaks than when using babel
with either PDFLaTeX or XeLaTeX; moreover, this seems to be related to the use of KOMA-Script and of mathtools
with fleqn
option. The PDF file produced with polyglossia
has more pages.
However, the linebreaks are the same, at least in the following example.
Here is an example which is made to be compiled with
xelatex -jobname='with-babel' text.tex
xelatex -jobname='with-polyglossia' text.tex
to produce with-polyglossia.pdf
and with-babel.pdf
using, respectively, polyglossia
and babel
:
% test.tex
\documentclass[12pt,a4paper]{scrartcl}
\usepackage{etoolbox}
%% **fontspec** (LuaLaTeX, XeLaTeX)
%% -- Advanced font selection in X∃LATEX and LuaLATEX
%%
%% This package is needed for **babel**.
%%
%% NOTE: the `no-math` option is needed to avoid a strange conflicts with
%% AMS packages.
\usepackage[no-math]{fontspec}
%% NOTE: i do not know how this works, but it works
\expandafter\ifstrequal\expandafter{\jobname}{with-polyglossia}{
\usepackage{polyglossia}
\setdefaultlanguage{french}
}{
\usepackage[french]{babel}
}
%% **mathtools** (is supposed to require internally **amsmath**)
%% -- Mathematical tools to use with amsmath
\usepackage[fleqn]{mathtools}
\begin{document}
\subsection*{Propriétés algébriques}
Les opérations algébriques dans $\mathbf{K}(X)$ satisfont les propriétés
suivantes :
\begin{enumerate}
\item
pour tous $F, G, H\in \mathbf{K}(X)$,
\[
(F + G) + H = F + (G + H),
\]
\item
pour tous $F, G\in \mathbf{K}(X)$,
\[
F + G = G + F,
\]
\item
pour tout $F\in \mathbf{K}(X)$,
\[
F + 0 = 0 + F = F,
\]
\item
pour tout $F\in \mathbf{K}(X)$,
\[
F + (-F) = (-F) + F = 0,
\]
\item
pour tous $F, G, H\in \mathbf{K}(X)$,
\[
(FG)H = F(GH),
\]
\item
pour tous $F, G\in \mathbf{K}(X)$,
\[
FG = GF,
\]
\item
pour tout $F\in \mathbf{K}(X)$,
\[
F\cdot 1 = 1\cdot F = F,
\]
\item
pour tout $F\in \mathbf{K}(X)$, si $F \ne 0$, alors
\[
FF^{-1} = F^{-1}F = 1,
\]
\item
pour tous $F, G, H\in \mathbf{K}(X)$,
\[
(F + G)H = FH + GH,\qquad
F(G + H) = FG + FH.
\]
\end{enumerate}
Autrement dit, $\mathbf{K}(X)$ est un « corps commutatif ».
\subsection*{Degré d'une fraction rationnelle}
Pour toute fraction rationnelle $F = \frac{A}{B} \in \mathbf{K}(X)$, on
définit le \emph{degré\/} de $F$ par la formule :
\[
\deg F \stackrel{\text{déf}}{=} \deg A - \deg B.
\]
Comme $B \ne 0$ (donc $\deg B \in \mathbf{N}$), cette soustraction a un sens
même si $A = 0$, dans quel cas l'on trouve $\deg 0 = - \infty$.
Cependant, pour être certain que la définition a bien un sens,
il faut vérifier qu'elle ne dépend pas de l'écriture particulière
choisie pour $F$.
Supposons donc que $F = \frac{A_{1}}{B_{1}} = \frac{A_{2}}{B_{2}}$.
On a :
\begin{align*}
A_{1} B_{2} = A_{2} B_{1}
&\Rightarrow
\deg A_{1} + \deg B_{2} = \deg A_{2} + \deg B_{1} \\
&\Rightarrow
\deg A_{1} - \deg B_{1} = \deg A_{2} - \deg B_{2},
\end{align*}
car on peut soustraire $\deg B_{1} + \deg B_{2} \ne -\infty$.
Pour calculer $\deg F$, on peut donc indifféremment utiliser l'écriture
$F = \frac{A_1}{B_1}$ ou l'écriture
$F = \frac{A_2}{B_2}$.
\end{document}
Here is a Makefile to get at once with-polyglossia.pdf
and with-babel.pdf
:
# Makefile
.DELETE_ON_ERROR:
.PHONY: all
all: babel polyglossia
.PHONY: babel
babel: with-babel.pdf
.PHONY: polyglossia
polyglossia: with-polyglossia.pdf
with-babel.pdf: test.tex
latexmk -xelatex -jobname='with-babel' '$<'
with-polyglossia.pdf: test.tex
latexmk -xelatex -jobname='with-polyglossia' '$<'
.PHONY: mostlyclean
mostlyclean:
rm -f *.log *.synctex.gz
.PHONY: clean
clean: mostlyclean
rm -f *.aux *.out *.toc *.fdb_latexmk *.fls
.PHONY: distclean
distclean: clean
rm -f with-babel.pdf with-polyglossia.pdf
~:
is wrong with eitherpolyglossia
orbabel
. Similarly for«~
and~»
babel
also with XeLaTeX.