1

I'm trying to align a document heading (myName, myPhone, myMail) which I want to show on the right. For instance,

                                                        myName
                                                        myPhone
                                                        myMail

I've tried something like this, but it does not seem to work

\hspace{12cm} myName \newline
\hspace{12cm} myPhone \newline
\hspace{12cm} myMail

I would be grateful to receive some helpful advice. Thank you.

  • 1
    Welcome to TeX.SE. For future reference, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Sep 17 '18 at 16:29
1

If you want the block of 3 lines aligned on left but pushed to right, use

\begin{flushright}
  \begin{tabular}{l@{}}
    myName\\myPhone\\myMail
  \end{tabular}
\end{flushright}

or only flushright to push everything to right.

MWE

\documentclass[letterpaper,12pt]{article}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{flushright}
  \begin{tabular}{l@{}}
    myName\\myPhone\\myMail
\end{tabular}
\end{flushright}
\lipsum[2]
\begin{flushright}
%  \begin{tabular}{l}
    myName\\myPhone\\myMail
%\end{tabular}
\end{flushright}
\end{document}

enter image description here

| improve this answer | |

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.