I would like to center two centered lines between them. Namely, I would like to center two bullet points and write to their right and to their left. Hope following image helps:
Any help is highly appreciated. Thanks!
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI would like to center two centered lines between them. Namely, I would like to center two bullet points and write to their right and to their left. Hope following image helps:
Any help is highly appreciated. Thanks!
You could use the tabular
environment:
\documentclass{article}
\begin{document}
\begin{tabular}{r@{\enspace\textbullet\enspace}l}
Address & City, State \\
Phone number & Email address
\end{tabular}
\end{document}
The \enspace
defines the horizontal spacing on either side of the bullet (thanks to Bernard for this suggestion).
\begin{tabular}{r@{\enspace\textbullet\enspace}l}
.
this approach defines a one-line command that treats everything but the bullet as without width. it ignores accidental spaces in the input.
\documentclass{article}
\newcommand{\cbline}[2]{%
\centering
\leavevmode \llap{#1\unskip}%
\ $\bullet$\ \rlap{\ignorespaces#2}\par
}
\begin{document}
\cbline{Address}{ City, State}
\cbline{Phone number }{Email address}
\end{document}
Or you can try it the plain TeX way:
\documentclass{article}
\def\doubleline#1#2{%
\hbox to0.5\linewidth{%
\hbox to 0.22\linewidth{%
\hfil%
#1%
}\hbox to0.06\linewidth{\hfil\textbullet\hfil}%
\hbox to0.22\linewidth{%
#2%
\hfil%
}%
}%
}%
\begin{document}
\doubleline{Address}{City, State}
\doubleline{Phone number}{Email address}
\end{document}
The tabular
method is much clearer, and you could wrap it in a macro pretty easily, too. This way is chiefly useful as (a) a short study in TeX box-twiddling, which is something I love to do, and (b) potentially more easily customizable, as you can govern total width and the like without having to resort to external packages like tabularx
. (It's not, since the widths of the boxes hard-coded; but it could be.)
This yields: