Environment for listing personal information or similar data
As mentioned in the comments the simplest would be to a tabular environment similar to the solutions from Align columns of text and use tabular to align the columns, or the tabbing
environment.
If there is a lot of data you should consider using more than just one column.
\documentclass[border=5pt]{standalone}
\begin{document}
\noindent
\begin{tabular}{l@{\thinspace}l}
Name: &Village\\
Telephone: &+12 111 111\\
E-mail: &[email protected]\\
Web site: &http://tex.stackexchange.com
\end{tabular}
\bigskip
If there is a lot of data consider two columns:
\medskip
\noindent
\begin{tabular}{l@{\thinspace}ll@{\thinspace}l}
Name: &Village &Email: &[email protected]\\
Mobile: &+12 111 111 111 &Website: &http://tex.stackexchange.com\\
Phone: &+12 111 111 &Birthdate:&04/01/1977
\end{tabular}
\end{document}
As per @Werner's comment, it would be useful to define as macro so that the formatting is consistent. This is especially important if you are typesetting this more than once in a document. I have also used \url
here as per @YiannisLazarides suggestion, along with the hyperref
package to provide click able link. You could also just use the url
package.
This version also uses the collcell
package to provide the flexibility of selecting if the colon's are to be aligned using the A
column type, or placed on the left using the L
column type. This might be overkill for the case where you only have 4 entries, and could manually include the :
in the \UserInfo
macro at the appropriate points). But if the list of entries grows longer this method allows you to easily switch between the two formats, should you later decide you like one version over the other.
\documentclass{article}
\usepackage{hyperref}
\usepackage{collcell}
\newcommand{\AddColon}[1]{#1:}%
\newcolumntype{L}{>{\collectcell\AddColon}{l}<{\endcollectcell}@{\thinspace}}% if want colons on left
\newcolumntype{A}{l@{:\thinspace}}% if want colons aligned
\newcommand{\UserInfo}[5][L]{% #1 can be A=aligned colon, L=left colon
\par\noindent%
\begin{tabular}{#1 l}%
Name \\%
Telephone \\%
E-mail \\%
Web site &\url{#5}%
\end{tabular}%
\ignorespaces\par%
}
\begin{document}
\UserInfo{Village}{+12 111 111}{[email protected]}{http://tex.stackexchange.com}
\bigskip
\UserInfo[A]{Village}{+12 111 111}{[email protected]}{http://tex.stackexchange.com}
\end{document}
Just to show some variations, here is a key-value approach:
\documentclass[a4paper]{article}
\usepackage{keyval,booktabs}
\makeatletter
\def\ui@key#1{\define@key{ui}{#1}{\@namedef{ui@#1}{##1}}}
\ui@key{name}\ui@key{place}\ui@key{phone}\ui@key{mobile}
\ui@key{email}\ui@key{website}\ui@key{style}
\def\ui@style@one{\noindent\begin{tabular}{@{}l@{ }l@{}}
\toprule
\multicolumn{2}{@{}l@{}}{Name: \ui@name} \\
\midrule
Place: & \ui@place \\
Mobile: & \ui@mobile \\
Phone: & \ui@phone \\
E-Mail: & \texttt{\ui@email} \\
Web site:& \texttt{\ui@website} \\
\bottomrule
\end{tabular}}
\def\ui@style@two{\noindent\begin{tabular}{@{}l@{ }l@{\qquad}l@{ }l@{}}
\toprule
\multicolumn{4}{@{}l@{}}{Name: \ui@name} \\
\midrule
Place: & \ui@place & E-Mail: & \texttt{\ui@email} \\
Mobile: & \ui@mobile & Web site: & \texttt{\ui@website} \\
Phone: & \ui@phone & & \\
\bottomrule
\end{tabular}}
\newcommand{\UserInfo}[1]{%
\setkeys{ui}{style=one,name=,place=,mobile=,phone=,email=,website=,#1}%
\@nameuse{ui@style@\ui@style}}
\makeatother
\begin{document}
\UserInfo{%style=one, % default
name=Brutus L. User,
place=Village,
mobile=+12 111 111 111,
phone=+12 111 111,
[email protected],
website=http://tex.stackexchange.com}
\bigskip
\UserInfo{style=two,
name=Brutus L. User,
place=Village,
mobile=+12 111 111 111,
phone=+12 111 111,
[email protected],
website=http://tex.stackexchange.com}
\end{document}
One can choose between one an two column tabular. The \ui@key
macro is just to avoid repeating over and over similar definitions such as
\define@key{ui}{name}{\def\ui@name{#1}}