9

I want to use typographic apostrophe (’) in my document. Using a simple ' don't give the same result.

I can type the ’ on my keyboard. But XeTeX take it as a normal character, ie. like a letter, and it can generate bad hyphenation like this (using the xmemoire class) :

\documentclass{xmemoire}
\usepackage{wrapfig} 
\lccode`\’=0
\begin{document}
\begin{wrapfigure}{R}[1cm]{0.33\linewidth}
         \begin{center}
          \caption{{\normalfont { Logo associé à l’\textit{ERC Starting Grants} d’Analyse de la maturation cérébrale.}}}
          \label{figbb}
        \end{center}
\end{wrapfigure}
\end{document}

How do I avoid hyphenation around ’, or more generally around a given character, in all the document (I know I can use mbox for local forcing).

  • 2
    Make a small, but complete example that demonstrates your problem. Also tell us the version of your xetex and the packages. – Ulrike Fischer May 10 '12 at 14:26
  • Are you using a package like Babel or Polyglossia with which you can get the language of the document? Those packages should prevent hyphenation at apostrophes as you are encountering. – Amphipolis May 10 '12 at 14:35
  • With \usepackage{polyglossia}\setmainlanguage{french} I get only l’apos-trophe. – egreg May 10 '12 at 16:13
  • Here is a simple example which reproduce my problem, I use xmemoire as document class (sorry but it seems I can't insert new lines in comments): \documentclass{xmemoire} \usepackage{wrapfig} \begin{document} \begin{wrapfigure}{R}[1cm]{0.33\linewidth} \begin{center} \caption{{\normalfont { Logo associé à l’\textit{ERC Starting Grants} d’Analyse de la maturation cérébrale.}}} \label{figbb} \end{center} \end{wrapfigure} \end{document} – psychoslave May 11 '12 at 7:02
  • My XeTeX version : This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) – psychoslave May 11 '12 at 7:07
4

Something like

\lccode`\’=0

should turn that character into a symbol not considered as a word constituent. Note that I don't really have experience with XeTeX: this is based on the assumption that XeTeX will treat characters beyond 8bit just like below.

  • @user9588 How to obtain the same result with a combining character, like acute combining character, unicode '0301' ? – Paolo Polesana Nov 15 '16 at 9:53

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.