I am new to LaTeX and trying to write my first resume. I want to list my contact info and right now I am doing this by using \hfill. The problem is that \hfill equalizes the spacing but I want the bottom center (#3, 4 and 5) to not be spaced equally, but give up that equal spacing for that middle element to be centered horizontally. Any tips on this?


\RequirePackage{geometry} % changes margins across the page
\center{  {\Gentsroom} #1 \hfill {\large} \hfill {\ComputerMouse} #2 }
\center{ {\Letter} #3 \hfill {\Telefon} #4  \hfill Github: #5}

What I have right now

  • Is \center a command? Does it work like \center{..}? \begin{center} .. \end{center} is the correct syntax. – Manuel Jan 15 '15 at 23:10
  • @Manuel it will cause the rest of the document to be centred. Conversely {\large} does nothing. – David Carlisle Jan 15 '15 at 23:11
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Martin Schröder Jan 15 '15 at 23:26
  • Welcome to TeX.SX! A tip: You can use backticks ` to mark your inline code as I did in my edit. – jub0bs Jan 16 '15 at 0:37

In order for the centering to be effective, you have to ignore the widths:



\newcommand{\longcontact}[5]{% <--- don't forget
  \par % be sure to start a new line
  \Gentsroom\ #1 \hfill \ComputerMouse\ #2%
  \makebox[0pt][l]{\Letter\ #3}% zero width
  \hfill % fill
  \makebox[0pt][c]{\Telefon\ #4}% zero width
  \hfill % fill
  \makebox[0pt][r]{Github: #5}%


\longcontact{Something}{Hey!}{Whatever}{555 55 55}{Hub}


enter image description here

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.