# Justified paragraph followed by right-aligned paragraph with custom spacing

I'd like to have a paragraph of ordinary text with a single right-aligned line underneath, with a custom vertical spacing (0.5 cm) between them, but can't figure out how it is done. My best guess is:

A paragraph of ordinarily justified text blah blah blah followed
by a line which has a different alignment. \\[0.5cm] {\raggedleft
the right aligned text}


This doesn't work. The vertical spacing is fine, but "the right aligned text" is aligned to the left.

If I change it to

A paragraph of ordinarily justified text blah blah blah followed
by a line which has a different alignment. \\[0.5cm]

{\raggedleft the right aligned text}


then the alignment works fine, but the vertical spacing is much greater than 0.5 cm. Help?

• you should be able to get the right-alignment by just adding \par before the final brace. – barbara beeton Nov 23 '13 at 17:33

As far as I understand:

\documentclass{article}

\begin{document}

\newlength{\myskip}
\setlength{\myskip}{0.5cm}
A paragraph of ordinarily justified text blah blah blah followed
by a line which has a different alignment.  And some more and more text.
\vskip\myskip

\rightline{the right aligned text}

\end{document}


I am assuming, that 5 mm is the distance between baselines, hence the correction. If no, you can put the vertical skip without such manipulations.

Presumably one should worry about page breaking between the paragraph and the right-aligned text. Here's a non-breaking version:

\documentclass{article}
\begin{document}

A paragraph of ordinarily justified text blah blah blah followed
by a line which has a different alignment.\rule[-.5cm]{0cm}{.5cm}\\*
\null\hfill the right aligned text.

\end{document}


The \rule[-.5cm]{0cm}{.5cm} creates a strut: a zero width rule that extends .5cm below the baseline.