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've got a problem with the soul package while adding a letter-spacing to a result of a command that is defined just like this:

\newcommand{\myCommand}{some text}

In the document I'd like to have the result of that command displayed with letter-spacing:

\par{\centering{\Huge
 \textbf{\myAnotherCommand{} \textsc{\so{\myCommand{}}}}
}\bigskip\par}

but I get "Package soul error: Reconstruction failed" and a black square after the text "some text". If I understand soul package documentation properly, it's a problem with "grouping hyphenatable material" or font switching commands, isn't it? Unfortunately, I've no idea how to fix it. Am I supposed to register some command with \soulregister?

I'd be grateful for any advice.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

With pdflatex the most easy way to get letterspacing is via microtype

\usepackage{microtype}

...

\par
{\centering\Huge
 \textbf{\myAnotherCommand{} \textsc{\lsstyle \myCommand}}
 \par\bigskip}

This avoids the need to do all the involved tricks of soul. Letterspacing can be obtained via the package letterspace (included with microtype), but it doesn't hurt to load the bigger one (it's very advantageous, actually).

With XeLaTeX a similar effect can be obtained with

\addfontfeature{LetterSpace=2.0}

(the number can be chosen to suit one's needs):

\par
{\centering\Huge
 \textbf{\myAnotherCommand{} \textsc{\addfontfeature{LetterSpace=2.0} \myCommand}}
 \par\bigskip}

This particular combination might fail, because not all fonts family have a boldface small caps font.

share|improve this answer
    
Thanks for showing me another way to do that. It's really much simpler and works fine for me :) –  Paulina R Jul 14 '11 at 12:07
add comment

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.