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?

  • 3
    Move the call of \EverySectFont after \usepackage{ragged2e}. Otherwise add a minimal working example (MWE) that illustrates your problem.
    – Speravir
    Commented Sep 3, 2012 at 17:28
  • stupid me! it is working now. sorry about this.
    – Shi Yuan
    Commented Sep 3, 2012 at 17:43
  • As the author of ragged2e I'm curious if you think code for this should be added to the package. Commented Sep 3, 2012 at 19:56

1 Answer 1


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}.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .