6

I am using LaTeX for years now but I am considering to migrate to XeLaTeX.

The main reason for this change is the babel package which change a lot the layout of my documents according to my language (French). For example, the itemize environment in LaTeX/Babel (in French) is completely different from the original (LaTeX/Babel/English). I prefer the original layout and I don't like the changes made by babel authors of the French option1. XeLaTeX (with Polyglossia and French language selected) does not change the layout (AFAIK).

For example, here are two screenshots. At the left, there is the LaTeX/Babel/French way of itemize. At the right, there is the same text with XeLaTeX/polyglossia/French. For me, there are no doubts the second (right side) is better.

LaTeX/babel/FrenchXeLaTeX

However, I have several questions about XeLaTeX. I don't know it at all, so please excuse the naivety.

  1. Is the default font in XeLaTeX the same than the one in LaTeX? In my screenshot the XeLaTeX font seems a little bit thicker. -> Related question : is it still usefull to call lmodern package with XeLaTeX?
  2. Is the csquotes package still working with XeLaTeX?
  3. For writing with XeLaTeX, I add these three packages calls after the document class : fontspec, xunicode, polyglossia (with the command \setmainlanguage{french}). Is it sufficient? Do I miss something?
  4. With the three package mentioned in question 3, do I have correct ligature and hyphenation for French?

I am also interested by documentations explaining how to migrate from LaTeX to XeLaTeX.


1. I believe it is not the job of the language package to decide the layout of the document.

  • 1
    The french option to babel actually does change the document layout, as you observe; but these changes can be undone. – egreg Dec 28 '13 at 17:10
  • @egreg Of course you could undo what babel does but I believe it is not always simple. It seems to me it is easier to migrate to XeLaTeX (which is, anyway, more closely interconnected with polyglossia, the future of babel)... – ppr Dec 28 '13 at 17:14
  • 2
    Is \frenchbsetup{StandardLayout=true} that difficult? ;-) – egreg Dec 28 '13 at 17:27
  • As a data point, I use csquotes a ton and have been using XeTeX for nearly six months now—I've never had an issue. – Sean Allred Dec 28 '13 at 17:37
  • I just checked the French module for babel and it is now actively developped (see the website. So I will probably still use babel instead of polyglossia (thanks @egreg). – ppr Dec 29 '13 at 15:39
12

The default font for fontspec is Latin Modern; by itself, XeLaTeX doesn't change the standard font layout of LaTeX.

Now to your questions.

  1. Don't trust screenshots too much. This is what I get with pdflatex

    pdflatex

    and this is what I get with xelatex

    xelatex

    The source file is

    \documentclass{article}
    \usepackage{ifxetex}
    \ifxetex
      \usepackage{fontspec}
      \usepackage{polyglossia}
      \setmainlanguage{french}
    \else
      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[french]{babel}
      \usepackage{lmodern}
    \fi
    
    \usepackage{lipsum}
    
    \begin{document}
    \noindent
    Typeset with \ifxetex\verb|xelatex|\else\verb|pdflatex|\fi\\
    \lipsum[2]
    \end{document}
    

    The difference you see probably depends on the PDF viewer and its treatment of OpenType fonts.

  2. Yes, csquotes works also with XeLaTeX. It could have some glitches, though. Without any clear example it's difficult to say.

  3. Don't load xunicode. It's already loaded by fontspec.

  4. Yes. You lose of course some features of the French module for babel. Check the documentation.

Just for information, calling

\usepackage[french]{babel}
\frenchbsetup{StandardLayout=true}

restores the standard layout. If you only want the standard itemize environment, call

\usepackage[french]{babel}
\frenchbsetup{
  ReduceListSpacing=false,
  StandardItemizeEnv=true,
  StandardItemLabels=true
}
  • 6
    you say (of babel) “it’s not the business of a language package to change layout”. but babel wasn’t originally designed as a language package — it was supposed to provide typesetting to match national styles. of course this will often change the language used, but layout changes aren't there because of the language — in your case, you are seeing a french typesetting style (for example, with thin spaces between text and following punctuation). i have no idea whether this is current style, but the code was written (and is now managed) by french people, so it stands a good chance. – wasteofspace Dec 28 '13 at 19:39
  • 1
    It is the style elaborated by generations of french typographers and it corresponds to the recommendations of the ‘Imprimerie Nationale’. It can be slightly modified in case of special needs, of course – Bernard Dec 28 '13 at 20:52
  • @Bernard Perhaps babel French style is what is recommended by some institution. However, when you see the itemize environment (for example) with no space between items or between item and the previous/next paragraph, it just appears for me as bad typography. – ppr Dec 29 '13 at 14:44
  • According to the documentation of frenchb, StandardLayout=true restores not only the itemize environment but also first paragraph indent and footnotes. – ppr Dec 29 '13 at 16:43
  • If one would only to have the LaTeX default behavior for itemize environment, he should use the options : ReduceListSpacing=false, StandardItemizeEnv=true and StandardItemLabels=true. – ppr Dec 29 '13 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.