LaTeX forum ⇒ Text FormattingAutomatic Insertion of unbreakable Space after Guillemets Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Re: Automatic Insertion of unbreakable Space after Guillemet

Postby Johannes_B » Thu Jun 06, 2013 3:41 pm

Ok, you made me curious and i have to admit: the documentation of polyglossia could be better for french. But in the introduction it says:
polyglossia wrote:Adjusting some typographical conventions according to the current language (such as afterindent, frenchindent, spaces before or after punctuation marks, etc.)


I updated my example, and Im pretty sure everything works as expected. Change the length-value and take look at the behaviour of the punctuation symbols.

  1. \documentclass{book}
  2.  
  3. \usepackage{fontspec}
  4. \usepackage{polyglossia}
  5. \setmainlanguage{french}
  6. \usepackage{csquotes}
  7.  
  8. \begin{document}
  9. \fbox{\parbox{4.10cm}{
  10. This is a \enquote{Test sentence} : My french is a bit rusty.\\
  11. This is a Test sentence: My french is a bit rusty. \\
  12. This is a «Test sentence»: My french is a bit rusty.
  13. }}
  14. \end{document}


Just for completion, the (almost) same with babel for use with pdflatex:
  1. \documentclass{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[french]{babel}
  5. \usepackage{csquotes}
  6. \begin{document}
  7. \fbox{\parbox{4.00cm}{
  8. This is a \enquote{Test sentence} : My french is a bit rusty.\\
  9. This is a Test sentence: My french is a bit rusty. \\
  10. This is a «Test sentence»: My french is a bit rusty.
  11. }}
  12. \end{document}


Please note the difference in the third line, babel/pdflatex does not insert those white spaces inside the quotation marks like polyglossia/xelatex does.


Just for comparison:
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
polyglossia.sty 2012/04/29 v1.2.1 Babel replacement for XeLaTeX
csquotes.sty 2011/10/22 v5.1d context-sensitive quotations
Last edited by cgnieder on Sat Jun 08, 2013 3:05 pm, edited 1 time in total.
Reason: corrected broken quote formatting
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Tags:

AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Postby AleCes » Thu Jun 06, 2013 4:32 pm

You don't have to bother with babel because it has a wonderful implementation of French typography, which is very quirky and different than the others (the most relevant issues are the special format of footnotes and the insertion of unbreakable spaces before colon, semicolon, interrogation mark and exclamation mark).

As for polyglossia, again, are you sure those spaces are unbreakable? Is there a way to check it? Please, let me know. I tried with copy/paste from the pdf to LibreOffice Writer and I couldn't see the peculiar grey colour which is the hallmark of unbreakable spaces.

User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jun 06, 2013 5:07 pm

I just checked the language definition file gloss-french.ldf:

  1. \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"


Things like that ensure the right typesetting done by XeTeX. And as you can see, there clearly is a \nobreakspace.

But this really has nothing to do with copying from pdf to something else.
@all: Please correct me if I'm wrong.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Postby AleCes » Thu Jun 06, 2013 6:23 pm

Johannes_B wrote:I just checked the language definition file gloss-french.ldf:

  1. \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :"


Things like that ensure the right typesetting done by XeTeX. And as you can see, there clearly is a \nobreakspace.

But this really has nothing to do with copying from pdf to something else.
@all: Please correct me if I'm wrong.


OK Johannes, good to know, thanks for your help. But I thought by copying/pasting from a pdf, unbreakable spaces would be lost in the process.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 7 guests