Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

`ragged2e' screws up `microtype'

62 views
Skip to first unread message

Leo

unread,
Sep 2, 2010, 12:04:38 PM9/2/10
to
Hello,

I wonder if this is a known problem.

Save http://paste.pocoo.org/raw/257662/ to file xyz.cls

and compile this small example:

http://paste.pocoo.org/show/257661

Under texlive 2009 I see ugly spaces around ROADM as in this screenshot:

http://imagebin.org/112403

You can see it with latin modern font too.

The problem doesn't occur if I remove `newcommands' option to ragged2e.

--
Leo

Jose Geraldo

unread,
Sep 3, 2010, 7:19:48 AM9/3/10
to
On 2 set, 13:04, Leo <sdl....@gmail.com> wrote:
> Hello,
>
> I wonder if this is a known problem.
>
> Savehttp://paste.pocoo.org/raw/257662/to file xyz.cls

>
> and compile this small example:
>
> http://paste.pocoo.org/show/257661
>
> Under texlive 2009 I see ugly spaces around ROADM as in this screenshot:
>
> http://imagebin.org/112403
>
> You can see it with latin modern font too.
>
> The problem doesn't occur if I remove `newcommands' option to ragged2e.
>
> --
> Leo

Considering that ragged2e is all about having a pleasant raggedright
document and microtype is all about micro-adjusting a fully justified
document, I can hardly understand why anyone would want to use them
together. Perhaps the developers of both packages think the same.

Joris

unread,
Sep 3, 2010, 7:30:00 AM9/3/10
to
On Sep 3, 7:19 am, Jose Geraldo <jggou...@gmail.com> wrote:
> On 2 set, 13:04, Leo <sdl....@gmail.com> wrote:
>
>
>
>
>
> > Hello,
>
> > I wonder if this is a known problem.
>
> > Savehttp://paste.pocoo.org/raw/257662/tofile xyz.cls

>
> > and compile this small example:
>
> >http://paste.pocoo.org/show/257661
>
> > Under texlive 2009 I see ugly spaces around ROADM as in this screenshot:
>
> >http://imagebin.org/112403
>
> > You can see it with latin modern font too.
>
> > The problem doesn't occur if I remove `newcommands' option to ragged2e.
>
> > --
> > Leo
>
> Considering that ragged2e is all about having a pleasant raggedright
> document and microtype is all about micro-adjusting a fully justified
> document, I can hardly understand why anyone would want to use them
> together. Perhaps the developers of both packages think the same.


That sounds generally right. I happen to use the tufte class in which
I justify the main text but not the margins since it leads to all
sorts of ugly problems with formulas across line breaks. I'm sure
there are plenty of people who would disagree with this choice, but it
looks good to me. I haven't noticed Leo's phenomenon in my document
(which uses mathpazo), but I presume it's possible to turn off
microtype in the margins.

Best,

J.

Leo

unread,
Sep 4, 2010, 12:49:19 AM9/4/10
to
Jose Geraldo <jggo...@gmail.com> writes:

> Considering that ragged2e is all about having a pleasant raggedright
> document and microtype is all about micro-adjusting a fully justified
> document, I can hardly understand why anyone would want to use them
> together. Perhaps the developers of both packages think the same.

But I think ragged2e does raggedright/left only if you tell it to. So
there seems no reason for it to interfere with microtype when
typesetting fully-justified pieces.

--
Leo

Robert

unread,
Sep 4, 2010, 10:55:57 PM9/4/10
to
On 04.09.10 06:49, Leo wrote:
> But I think ragged2e does raggedright/left only if you tell it to. So
> there seems no reason for it to interfere with microtype when
> typesetting fully-justified pieces.

ragged2e also redefines \centering, which you use in the figure
environment. Even though justification is restored in the caption, part
of the definition of \centering is still active, namely that the
\spaceskip will be set to a non-zero value (which is wrong in itself for
justified text, as it prevents TeX from stretching interword spaces).
Since microtype adjusts the spacing around letterspaced text, these
spaces are the only ones with stretch components, and are stretched to
the maximum in the last line.

The solution is to add the following line to the preamble (employing
etoolbox):

\csgappto{@arrayparboxrestore}{\justifying}

(which has the positive side effect that \\ works as expected in
captions, too.)

Regards,
--
Robert

Leo

unread,
Sep 5, 2010, 7:40:51 AM9/5/10
to
Robert <w....@gmx.net> writes:
> ragged2e also redefines \centering, which you use in the figure
> environment. Even though justification is restored in the caption,
> part of the definition of \centering is still active, namely that the
> \spaceskip will be set to a non-zero value (which is wrong in itself
> for justified text, as it prevents TeX from stretching interword
> spaces). Since microtype adjusts the spacing around letterspaced text,
> these spaces are the only ones with stretch components, and are
> stretched to the maximum in the last line.
>
> The solution is to add the following line to the preamble (employing
> etoolbox):
>
> \csgappto{@arrayparboxrestore}{\justifying}
>
> (which has the positive side effect that \\ works as expected in
> captions, too.)

Many thanks for the fix and explanation.

Since ragged2e has limited use in my class so I leave it out anyway.

Leo

Simon Spiegel

unread,
Sep 6, 2010, 2:57:52 AM9/6/10
to

Just to make sure: Is this patch recommended for every document which
uses microtype and ragged2e? Out of curiosity, I added to this to a
book I'm working on and it did strange things to my captions.

Simon

Robert

unread,
Sep 7, 2010, 12:30:49 AM9/7/10
to
On 06.09.10 08:57, Simon Spiegel wrote:
> Just to make sure: Is this patch recommended for every document which
> uses microtype and ragged2e? Out of curiosity, I added to this to a book
> I'm working on and it did strange things to my captions.

Actually, it doesn't have so much to do with microtype. I would
recommend it for every document that uses ragged2e.

To add \justifying was just a quickie, so I would, on closer
examination, rather recommend the following, which hopefully does not do
strange things to your captions:

\makeatletter
\g@addto@macro\@arrayparboxrestore{%
\let\\\@raggedtwoe@savedcr
\let\@gnewline\@raggedtwoe@saved@gnewline
\@raggedtwoe@spaceskipfalse
\@raggedtwoe@everyselectfont
}
\makeatother

Without this patch, all text in "par boxes" (minipages, marginpars,
captions, footnotes etc.) that are within the scope of one of ragged2e's
commands (eg. \raggedright, \centering, the center environment) will be
typeset ragged right, since the interword glue is fixed.
That the definitions of \\ and \@gnewline are different from what they
would normally be is less obviously problematic, but for example in the
test case Leo provided it also lead to strange line breaks.

I would consider this a bug in ragged2e. At least it irritatingly
differs from LaTeX's normal behaviour, which sets these boxes justified
by default.

Regards,
--
Robert

0 new messages