12

This question already has an answer here:

I am writing an introduction, and I need to put my name at the end of it at the right side of the page, but it should be aligned left:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
I psum has been the industry's standard dummy text ever since the 1500s, when an 
unknown printer took a galley of type and scrambled it to make a type specime n
book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s w
ith the release of Letraset.

                                                                  Andriy D.
                                                                  Toronto, 2009

What is the best way to achieve this? Any tips appreciated!

marked as duplicate by Red, Mensch, Claudio Fiandrino, jub0bs, Benedikt Bauer Oct 15 '13 at 10:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

12

One simple way to do this is with a tabular environment:

\documentclass{article}
\usepackage{lipsum}
\pagestyle{empty}
\begin{document}

\lipsum[1]

\hfill
\begin{tabular}{@{}l@{}}
Andriy D.\\
Toronto, 2009
\end{tabular}

\end{document}

output of code

  • What does the table spec @{}l@{} for the tabular environment mean? How does it differ from just l? – tparker May 18 '18 at 1:17
  • 1
    @tparker The @{} removes the intercolumn space before and after the column. In this particular case the first instance is superfluous, but the second is not. If you remove it, the table will no longer be flush with the right margin. – Alan Munn May 18 '18 at 3:06
3

One way to do it in Plain TeX:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
I psum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s
with the release of Letraset.

{
  \parindent=0em
  \setbox0=\hbox{Toronto, 2009}
  \hfill\vbox{\hsize=\wd0
  Andriy D.\par
  \box0\par}
}

\bye

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