[Tex/LaTex] How to align text to right without adding additional vertical spacing

horizontal alignmentragged2e

I am trying to simply align one paragraph to the right. However, when I try to use flushright environment, additional vertical space is added above that environment:

\documentclass[final]{book}
\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus ut voluptatem at voluptatibus omnis ratione tenetur. A, voluptates. Enim beatae suscipit nesciunt sunt voluptatem, sit blanditiis nobis accusamus vitae nisi tempora odit eius molestias laborum obcaecati maiores optio placeat aut temporibus alias omnis porro minus ex! Illum dolores, explicabo assumenda?

\begin{flushright}
This text should be aligned to right side with no vertical space above it.
\end{flushright}

Some regular text which should not be affected by above commands.

\end{document}

On the other hand, when I try to use \raggedleft, no vertical space is added before this paragraph, but all following paragraphs are also aligned right (which is not what I intended):

\documentclass[final]{book}
\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus ut voluptatem at voluptatibus omnis ratione tenetur. A, voluptates. Enim beatae suscipit nesciunt sunt voluptatem, sit blanditiis nobis accusamus vitae nisi tempora odit eius molestias laborum obcaecati maiores optio placeat aut temporibus alias omnis porro minus ex! Illum dolores, explicabo assumenda?

\raggedleft This text should be aligned to right side with no vertical space above it.

Some regular text which should not be affected by above commands.

\end{document}

I am not sure how I can un-align text to default (justify) after using \raggedleft.

Is there any way to align text to right, without adding additional vertical space or affecting all text that follows after that alignment?

Best Answer

Try

{\raggedleft text\dots \par}

if you want the paragraph aligned to the right.

\documentclass{article}

\begin{document}
  Right-aligned wants \verb|\raggedleft|:\par
  {\raggedleft text \par}
  Left-aligned wants \verb|\raggedright|:\par
  {\raggedright text \par}
\end{document}

left-right right-left