I’m having a problem with ragged2e, especially \RaggedLeft, inside a
parbox. It sets all lines of a paragraph to have approximately equal
width, instead, as expected, use the full widths for all but the last
lines. This makes it hard distinguish the paragraphs.
Minimal example attached.
I’d be grateful to hear about any fixes, work-arounds or alternatives,
as ugly as they might be :-)
Thanks,
Joachim
I'm not sure attachment work, might be better to copy and paste it into
your message
/daleif
it seems I forgot to attach the files, and it seems that the Google
interface does not allow to attach files. So here is the code inline:
\documentclass{article}
\usepackage{ragged2e}
\begin{document}
\RaggedLeft
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
\vspace{2cm}
\parbox{\linewidth}{
\RaggedLeft
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
Zweiterabsatz auch lang und kurz
}
\end{document}
add \tolerance=0 here and it seems to give you the same.
> \RaggedLeft
> Einelangeswort ein kurzes wort
> Einelangeswort ein kurzes wort
> Einelangeswort ein kurzes wort
> Einelangeswort ein kurzes wort
>
> Zweiterabsatz auch lang und kurz
> Zweiterabsatz auch lang und kurz
> Zweiterabsatz auch lang und kurz
> Zweiterabsatz auch lang und kurz}
>
> \end{document}
Regards,
Marc van Dongen
thanks for the advice. Setting tolerance to zero indeed helps in this
case. But in the real file, it has a another negative effect: If the
line is just slightly longer than the parbox width, latex writes over
the border. This is somewhat expected with tolerance=0, but it writes
over the right border, destroying the right-aligned look of
\FlushLeft. Setting \emergencystretch to 0pt does not seem to help.
Is there a way to make LaTeX either bolder in putting single words in
the next line or right-align even too-long lines?
Thanks,
Joachim
here is a file that shows this problem, at least on a4. In the last
paragraph, the line is divided at the last "Wort-wort". The "Wort-" is
pushed over the edge.
Thanks,
Joachim
\documentclass{article}
\usepackage{ragged2e}
\begin{document}
\parindent0pt
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelanges Wortwort
\vspace{2cm}
{
\RaggedLeft
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelanges Wortwort
}
\vspace{2cm}
\parbox{\linewidth}{
\RaggedLeft
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelanges Wortwort
}
\vspace{2cm}
\parbox{\linewidth}{
\RaggedLeft
\tolerance=0
Einelangeswort ein kurzes wort
Einelangeswort ein kurzes wort
Einelanges Wortwort
}
\end{document}
> Dear group,
>
> I’m having a problem with ragged2e, especially \RaggedLeft, inside a
> parbox. It sets all lines of a paragraph to have approximately equal
> width, instead, as expected, use the full widths for all but the last
> lines. This makes it hard distinguish the paragraphs.
Try setting the natural width of \parfillskip to a non-zero value.
--
Change “LookInSig” to “tcalveu” to answer by mail.
On 28 Okt., 21:34, Philipp Stephani <LookIn...@arcor.de> wrote:
> nomeata <m...@joachim-breitner.de> writes:
> > I’m having a problem with ragged2e, especially \RaggedLeft, inside a
> > parbox. It sets all lines of a paragraph to have approximately equal
> > width, instead, as expected, use the full widths for all but the last
> > lines. This makes it hard distinguish the paragraphs.
>
> Try setting the natural width of \parfillskip to a non-zero value.
no, I don’t think this helps: This will just add space on the right
side of the last row, but still the first row does not use the full
lenght.
When using tolerance=0, I can work-around the then-existing problem
abusing microtype’s shrink feature.
But I’d still prefer a solution that gives me properly right-aligned
paragraphs with the unaltered line-breaking algorithms... it’s realls
hard to explain others why its hard in LaTeX when other programs have
no problems treating right-alignment just as left-alignment.
Greetings,
Joachim
> [ Suggested solution isn't bullet-proof ]
> Is there a way to make LaTeX either bolder in putting single words in
> the next line or right-align even too-long lines?
Hi Joachim,
I'm sorry. I don't know. I've just started playing with paragraph
building and relevant parameters, but I still have to learn now to use
them.
Regards,
Marc van Dongen
\sloppy?
-- Scott