[Tex/LaTex] How to right-align any line or word in a paragraph in any documentclass

horizontal alignment

I have done some search for margin alignment in Latex but cannot find how can I right-align any single line?

For example, in a letter sometimes we put a Sincerely on the right. But without using specific documentclass, how can I align any single line in a paragraph to the right in any documentclass?

Many thanks for the help!

Best Answer

Like this?

\documentclass{article}
\usepackage{kantlipsum}
\begin{document}
\kant[1]

\hspace*{\fill} Yours sincerely

This is some more text

\null\hfill Yours sincerely

Again some dummy text

\hspace*{0pt}\hfill Yours sincerely

And again Phew

\mbox{}\hfill Yours sincerely
\end{document}

enter image description here

Related Question