2

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:

latex formatting issue

Any help is highly appreciated. Thanks!

7

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}

enter image description here

The \enspace defines the horizontal spacing on either side of the bullet (thanks to Bernard for this suggestion).

| improve this answer | |
  • 1
    You might simplify the syntax, using only two columns with \begin{tabular}{r@{\enspace\textbullet\enspace}l}. – Bernard Jun 1 '15 at 1:43
  • @Bernard - Very nice. I have updated my solution. – onewhaleid Jun 1 '15 at 1:56
4

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}

enter image description here

| improve this answer | |
1

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:

Boxes to make the "table"

| 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.