1

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
1

As far as I understand:

\documentclass{article} 

\begin{document}

\newlength{\myskip}
\setlength{\myskip}{0.5cm}
\addtolength{\myskip}{-\baselineskip}
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}

enter image description here

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.

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.