Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to align the telephone numbers and email in this example, and how should one go about it? I've not used LaTeX in a really really long time.

enter image description here

\documentclass{article}
\usepackage[a4paper, left=2.5cm, top=2cm, bottom=2cm]{geometry}

% need this for Croatian letters
\usepackage[cp1250]{inputenc}
\usepackage[T1]{fontenc}

\pagestyle{empty}       % neither header nor footer is shown

\usepackage{sectsty}
\sectionfont{\rmfamily\bfseries\scshape}
\subsectionfont{\rmfamily\mdseries\itshape\large}

\usepackage[bitstream-charter]{mathdesign}
\usepackage[scaled=0.85]{beramono}

% customizing lists
\renewenvironment{itemize}{
    \begin{list}{}{
        \setlength{\leftmargin}{1.5em}
        \setlength{\itemsep}{0.25em}
        \setlength{\parskip}{0pt}
        \setlength{\parsep}{0.25em}
                  }
                          }
                     {
    \end{list}
                         }
% stops paragraphs (section titles) being indented
\setlength\parindent{0em}

\begin{document}
{\huge JOHN DOE}

\vspace{0.5cm}
\begin{minipage}[t]{0.5\textwidth}
Long street 50\\12345 Town\\Country\\
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
Mobile: +123 45 678 9012\\Phone: +123 4 5678 901\\Email: \texttt{some@one.com}
\end{minipage}

\end{document}
share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Another option is to use the tabbing environment:

\documentclass{article}
\usepackage[a4paper, left=2.5cm, top=2cm, bottom=2cm]{geometry}

% need this for Croatian letters
\usepackage[cp1250]{inputenc}
\usepackage[T1]{fontenc}

\pagestyle{empty}       % neither header nor footer is shown

\usepackage{sectsty}
\sectionfont{\rmfamily\bfseries\scshape}
\subsectionfont{\rmfamily\mdseries\itshape\large}

\usepackage[bitstream-charter]{mathdesign}
\usepackage[scaled=0.85]{beramono}

% customizing lists
\renewenvironment{itemize}{
    \begin{list}{}{
        \setlength{\leftmargin}{1.5em}
        \setlength{\itemsep}{0.25em}
        \setlength{\parskip}{0pt}
        \setlength{\parsep}{0.25em}
                  }
                          }
                     {
    \end{list}
                         }
% stops paragraphs (section titles) being indented
\setlength\parindent{0em}

\begin{document}
{\huge JOHN DOE}

\vspace{0.5cm}
\begin{minipage}[t]{0.5\textwidth}
Long street 50\\12345 Town\\Country\\
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\begin{tabbing}
Mobile:\ \= +123 45 678 9012 \\
Phone:\> +123 4 5678 901 \\
Email:\> \texttt{some@one.com}
\end{tabbing}
\end{minipage}

\end{document}

enter image description here

Notice that I removed the spurious blank space after the first \end{minipage} to prevent an overfull \hbox.

share|improve this answer
    
better do this, yes! ;-) –  Sašo Živanović Aug 26 '12 at 23:19
    
This is excellent. Just what I wished for. Thank you. –  ldigas Aug 26 '12 at 23:45
add comment

Use the tabular environment:

\begin{tabular}[t]{l@{ }l}
  Mobile:&+123 45 678 9012\\
  Phone:&+123 4 5678 901\\
  Email:&\texttt{some@one.com}
\end{tabular}

[t] for top alignment of the environment, @{ } for just a bit of space (the default column separation seems too much to me).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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