# how to give horizontal offset to the section heading and align multiple tabs

I am a beginner in latex and trying to prepare my CV.

the output of the following code

\documentclass[11pt]{article}
\usepackage{sectsty}
\usepackage{amsmath}
\sectionfont{\fontsize{11}{15}\selectfont}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage[usestackEOL]{stackengine}
\usepackage[top=1cm, bottom=1cm, left=1cm, right=1.5cm]{geometry}

\begin{document}

\section*{EDUCATION}

{\begin{tabbing} % Enables tabbing
\= \hspace{4cm} \= \hspace{4.5cm} \=  \hspace{4cm} \=  \kill

\> \makebox{\textit{\Longstack[r]{Ph.D. in\\Chemical Physics}}}
\> \makebox{\textit{July 2008 - Feb 2014}}
\>  blah blah blah blah blah, Mumbai\\\
\> \> \makebox{\Longstack[l]{Dissertation: Blah  blah  blah  blah  blah  blah O$-$H$\cdots$S and O$-$H$\cdots\pi$ \\ Interactions and Application  blah  blah  blah  blah  blah  blah  blah  Measurement}} \\
\> \> Advisor: Prof.  blah   blah blah  \\\\

\>     \makebox{\textit {\Longstack[r]{Masters \\ in Science\\ (M.Sc.)}}}
\> July 2006 - July 2008
\> blah  blah  blah , blah,  blah \\
\> \> CPI: $8.35/10$ ( blah) \\
\> \> Advisor: Prof.  blah blah blah \\

\end{tabbing}

\end{document}


is given in the image file.

I want to format this output as I specified in the image file.

• Welcome to TeX SX! Maybe you should use one of the cv-dedicated packages? – Bernard Jan 31 '16 at 16:47
• Are you sure you want to shift Education by exactly 1cm? I shifted it by 1.4cm with \hspace{1.4cm} in the title and it aligns (almost) perfectly with "July", whereas with 1cm it aligns in the middle between the two "columns". Speaking of which, perhaps a two column setting could do the trick? Flushing the left column right and the right column left? – MickG Jan 31 '16 at 16:51

The following code does everything except aligning the "left column" correctly.

\documentclass[11pt]{article}
\usepackage{sectsty}
\usepackage{amsmath}
\sectionfont{\fontsize{11}{15}\selectfont}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage[usestackEOL]{stackengine}
\usepackage[top=1cm, bottom=1cm, left=1cm, right=1.5cm]{geometry}

\begin{document}
\setbox2\hbox{Interactions and Application blah blah blah blah blah blah blah Measurement}
\newlength{\lwidth}
\settowidth{\lwidth}{\box2}

\section*{\hspace{1.4cm}EDUCATION}

{\begin{tabbing} % Enables tabbing
\= \hspace{4cm} \= \hspace{4.5cm} \=  \hspace{4cm} \=  \kill

\> \makebox{\textit{\Longstack[r]{Ph.D. in\\Chemical Physics}}}
\> \makebox{\Longstack[l]{\textit{July 2008 - Feb 2014} \hspace{1cm}  blah blah blah blah blah, Mumbai \\}}\\
\> \> \hbox to \lwidth{Dissertation: Blah  blah  blah  blah  blah  blah O$-$H$\cdots$S and O$-$H$\cdots\pi$} \\
\> \> \hbox to \lwidth{Interactions and Application  blah  blah  blah  blah  blah  blah  blah  Measurement}\\
\> \> Advisor: Prof.  blah   blah blah  \\\\

\>     \makebox{\textit {\Longstack[r]{Masters \\ in Science\\ (M.Sc.)}}}
\> \makebox{\Longstack[l]{July 2006 - July 2008 \hspace{1cm} blah  blah  blah , blah,  blah \\
CPI: $8.35/10$ ( blah) \\
Advisor: Prof.  blah blah blah}} \\

\end{tabbing}

\end{document}


Note:

I assumed you wanted to align the right of Education with the left of Dissertation. Just fiddle with the space to align differently.

Also, I assumed you wanted Master to be vertically aligned with July 2006.

\lwidth is supposed to carry the line width. As such, I had it set to the width of a box containing the longest line of those you wanted justified. That is what the first lines after \begin{document} are meant for: they set the second box register to a horizontal box containing that line, create the length \lwidth, and set it to the width of the second box register. I used the second one since I don't really want to keep it global, and as this stats, odd registers are for global assignments and even registers for local ones. I had in fact originally used the first one, because I always get odd and even mixed up in this case :). Maybe you can just feed \hbox{…} into the second argument of \settowidth.

Update

OK, to get the alignment you only need a \hspace between \> and the \makebox for Masters. I found the appropriate value to be 1.1cm. With that, the output is:

There probably is a less "code-y" solution which gives more readable code and doesn't use so many \hspace, but at least this works. I'll leave the other solution (assuming it exists) to another answerer.

• Thanks a lot for the quick reply. Finally it works. However, I have two more question. – surjendu Feb 1 '16 at 17:50
• Thanks a lot for the quick reply. Finally it works. However, I have two more questions. First: The line "Disstertation: Blah ...." is looking bit more downward. Can we make it little bit upward like making the spacing with the previous line to half compared to existing one? The present alignment condition is bit strict such as if I want to add the dissertation for Masters, the alignment changes. Is there any wayout to add dissertation topin for masters? – surjendu Feb 1 '16 at 18:05
• 1) At the end of the "Dissertation blah" \makebox, try adding a [-.5\baselineskip] after the \\ , or a \vspace{-.5\baselineskip} before it. – MickG Feb 1 '16 at 18:18
• 2) You want another "Dissertation blah blah" in place of "CPI"? Put it there and move all lines down. That is, keep only CPI in the \makebox and the rest out of it. – MickG Feb 1 '16 at 18:20
• Admitting that Dissertation is just one line. Basically, the \makebox aligned with Masters must have the same number of lines as the one for Masters. Any extra line must go out of it. – MickG Feb 1 '16 at 18:21