Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using xelatex and while formatting by \caps (packages soul, soulutf8, polyglossia), the ending utf8 signs get stripped ("gītā" gets "gīt", see image below). Did anybody notice this issue and could give some help please?

The document can be simplified as follows:

% xelatex, texlive 2013
\documentclass[]{scrbook}
\usepackage{polyglossia}
\usepackage{xltxtra}
\usepackage{soul,soulutf8}
\begin{document}

\caps{gītā}

\end{document}

enter image description here

Update:

Thanks to the kind help, I could redefine the document as follows and understand the matter better:

% xelatex, texlive 2013
\documentclass[]{scrbook}
\usepackage{polyglossia}  % calls fontspec
\setmainfont
[Ligatures=TeX,
SmallCapsFeatures={LetterSpace=3.0},  % \textsc{} rather than \caps{} from "soul"
Numbers=OldStyle,
]
{TeX Gyre Pagella}  % could be any unicode font which supports small capitals
\begin{document}

\textsc{gītā}

\end{document}

I would also appreciate if somebody could explain shortly the main difference between \textsc{} from "fontspec" with letter spacing, \caps{} from "soul" and a feature if provided by "microtype".

share|improve this question
    
Why not use a font which supports this in conjunction with fontspec rather than trying to use something like soul? That is, you are using xelatex in any case, so why not use the features that enables you to access? –  cfr Feb 4 at 2:52
    
Avoid xltxtra, unless you really need its features (I bet you don't). Load just fontspec. –  egreg Feb 4 at 9:26

2 Answers 2

Package soul checks the character tokens with the font \SOUL@tt. This is defined in LaTeX as:

\newfont\SOUL@tt{ectt1000}

However, you are using a Unicode enabled TeX engine. There many characters are not available in font ectt1000. The .log file contains the messages:

Missing character: There is no ī in font ectt1000!
Missing character: There is no ā in font ectt1000!

The workaround is to redefine \SOUL@tt to use a better font:

\documentclass[]{scrbook}
\usepackage{polyglossia}
\usepackage{xltxtra}
\usepackage{soul}

\makeatletter
\sbox0{\ttfamily\global\let\SOUL@tt\ttfamily} 
\makeatother

\begin{document}
  \caps{gītā}
\end{document}

Result

Remark:

  • Package soulutf8 is intended to support UTF-8 for 8-bit TeX engines, where a Unicode character consists of several TeX chars/tokens with character codes < 256, encoded as UTF-8. This requires changes of the soul parser.

    However, XeTeX and LuaTeX support Unicode characters as single tokens/big chars. Thus the parser of soul does not need to be changed and soulutf8 is not needed and should not be used.

share|improve this answer
    
What is the difference between what soul does here and what is offered by fontspec's use of the different capitalisation/small-capitalisation/etc. features (for fonts which support those features)? (And maybe with microtype.) –  cfr Feb 4 at 3:59

You don't need soul for this, as letter spacing can be defined directly through fontspec.

\documentclass{scrbook}
\usepackage{fontspec}

\setmainfont[
  Ligatures=TeX,
  SmallCapsFont=Latin Modern Roman Caps,
  SmallCapsFeatures={LetterSpace=2.5},
]{Latin Modern Roman}

\begin{document}
\textsc{gītā}

\scriptsize\MakeUppercase{gītā} % for checking

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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