[XeTeX] polyglossia, Spanish and indentfirst
enrico.gregorio at univr.it
enrico.gregorio at univr.it
Sun Jun 6 14:42:50 CEST 2010
> On 06/06/2010 12:03 AM, enrico.gregorio at univr.it wrote:
> >> [...]
> >> I'm on TL2009 and the indentfirst package doesn't work at all.
> >> How can I get indentation on first paragraphs in Spanish?
> > [...]
> > Minimal example?
>
> Thanks for your reply, Enrico.
>
> Your sample works fine, but I'm afraid I can't provide a sample that
> shows the problem, since the issue appears in book that I typeset with
> XeLaTeX and babel and I switched now to polyglossia and I don't know why
> this happens.
Are you using different languages? If so, this may be the problem.
> After comparing the gloss-spanish.ldf with gloss-french.ldf and
> gloss-greek.ldf, a workaround for this would be:
>
> \makeatletter
> \def\blockextras at spanish{\frenchspacing\french at indent}
> \makeatother
>
> BTW, François, if you were so kind, I think this should be the default
> for Spanish as it is for French or Greek. Babel has also indentfirst as
> default for Spanish as main language.
AFAIK, Spanish babel has an option system that can enable also the
"noindentfirst" behavior, which is logically better, but typographic rules
often don't follow logic. :)
If you say in your document
\makeatletter
\gappto\blockextras at spanish{\french at indent}
\gappto\noextras at spanish{\nofrench at indent}
\makeatother
all should go as requested. If you need "globally" the "indentfirst" behavior,
which is reasonable, the indentfirst package should be loaded before polyglossia.
Indeed, indentfirst.sty says
\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue
while polyglossia says
\let\@@fterindentfalse\@afterindentfalse
\def\french at indent{\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue}
\def\nofrench at indent{\let\@afterindentfalse\@@fterindentfalse
\@afterindentfalse}
Switching back from a language that uses \nofrench at indent in its
\noextras@<language> macro, may use the "wrong" value of \@afterindentfalse
if indentfirst is loaded after polyglossia: it depends on what's your document's
main language. Do you see why?
\@@fterindentfalse has the "original" meaning as \@afterindentfalse. If indentfirst
is loaded before polyglossia, this is \@afterindenttrue and the \nofrench at indent
macro actually does nothing. If, instead, indentfirst is loaded after polyglossia,
\nofrench at indent replaces \@afterindentfalse (which probably is equivalent to
\@afterindentrue) with \@@fterindentfalse, giving it the LaTeX kernel meaning.
Ciao
Enrico
--
Enrico Gregorio + Dipartimento di Informatica + Tel: +39 045 8027937
Enrico.Gregorio at univr.it + Università degli Studi di Verona +
(gregorio at math.unipd.it) + Strada le Grazie 15 / I-37134 Verona + Fax: +39 045 8027928
More information about the XeTeX
mailing list