TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on Lyx with Preamble, I used to set the word space with everysel as below:

\fontdimen2\font=0.3em% interword space

However, the design I am working on has to perform well in a very small format, hence I opt to use ragged2e to set ragging right with hyphenation:


With a sense of despondency, this seems to disable the everysel, the manual said when ragged2e is called upon, the everysel is automatically loaded, however, I don't seem to be able to get it working.

So to sum up, my question is, how to set the text ragging right, with hyphenation and maintaining the control of word space?

share|improve this question
Move the call of \EverySectFont after \usepackage{ragged2e}. Otherwise add a minimal working example (MWE) that illustrates your problem. – Speravir Sep 3 '12 at 17:28
stupid me! it is working now. sorry about this. – Shi Yuan Sep 3 '12 at 17:43
As the author of ragged2e I'm curious if you think code for this should be added to the package. – Martin Schröder Sep 3 '12 at 19:56
up vote 6 down vote accepted

From what I can see, \RaggedRight performs \@raggedtwoe@everyselectfont before your \EverySelectfont can act; this macro sets the space skip to \fontdimen2\font, so your setting is ignored, because TeX uses \spaceskip if non zero, rather than \fontdimen2\font for the interword spacing.


% Let's add something before \spaceskip is set
\preto{\@raggedtwoe@everyselectfont}{\fontdimen2\font=.3em }

\RaggedRight abc def

\Large abc def 


Another way is to set \EverySelectfont before loading ragged2e:


\EverySelectfont{\fontdimen2\font=.3em }



\RaggedRight abc def

\Large abc def


Don't forget \selectfont after \begin{document}.

share|improve this answer
Brilliant, many thanks! – Shi Yuan Sep 11 '12 at 18:30

Your Answer


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.