3

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?

\LoadClass{article}

\RequirePackage{titlesec}
\RequirePackage{marvosym}
\RequirePackage{hyperref}
\RequirePackage{geometry} % changes margins across the page
 \geometry{
 left=5mm,
 right=5mm,
 top=5mm,
 bottom=5mm,
}
\newcommand{\longcontact}[5]{
\center{  {\Gentsroom} #1 \hfill {\large} \hfill {\ComputerMouse} #2 }
\center{ {\Letter} #3 \hfill {\Telefon} #4  \hfill Github: #5}
} 

What I have right now

4
  • 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
2

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

\documentclass{article}

\usepackage{marvosym}

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

\begin{document}

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

\end{document}

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.