Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a CV in LaTeX, and got started with the sample called Writing a CV in LaTeX.

I'm trying to modify it so that a newline in the left column does not force a newline in the right column. Here's what I've got so far:

preamble:

\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}
\newcolumntype{R}{p{0.8\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}

columns:

\section*{Professional Experience}
\begin{tabular}{L!{\VRule}R}
June 2012 -- present&{\bf Pixel Pusher at Vandalay Industries}\\
&\lipsum[66]\vspace{5pt}\\
Sept. 2011 -- Apr. 2012&{\bf Intern Pixel Pusher at Vandalay Industries}\\
&\lipsum[66]\\
\end{tabular}

Here's the output: output

I added arrows to indicate the right-column linebreaks that I'd like to eliminate. Any pointers for this would be great.

share|improve this question
    
The two answers provided so far are excellent and it's ridiculous that I can choose only one as correct. –  user94154 Nov 23 '12 at 5:18
1  
Yeah, you won't use both solutions, so you shall tick the one you'll use. And just one suggestion: I believe that saying June~2012 to~present and Sep.~2011 to~Apr.~2012 would look better (the dates would be all nicely aligned to each other). At least you should do Sep.\@ 2011 to prevent inter-sentence space to be included. –  tohecz Nov 23 '12 at 13:14
    
Sounds good. Great community! –  user94154 Nov 24 '12 at 0:41

3 Answers 3

up vote 5 down vote accepted

How about some nestedness (that must be a neologism in this context) of tabulars:

enter image description here

\documentclass{article}
\usepackage{lipsum,xcolor,array}% http://ctan.org/pkg/{lipsum,xcolor,array}
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{\dimexpr0.2\textwidth-2\tabcolsep-0.25pt}}
\newcolumntype{R}{p{\dimexpr0.8\textwidth-2\tabcolsep-0.25pt}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\begin{document}
\section*{Professional Experience}
\noindent
\begin{tabular}{L!{\VRule}R}
  June 2012 -- present & \begin{tabular}[t]{@{}R@{}}
    \textbf{Pixel Pusher at Vandalay Industries} \\
    \lipsum[66]
  \end{tabular} \\[\bigskipamount]
  Sept. 2011 -- Apr. 2012 & \begin{tabular}[t]{@{}R@{}}
    \textbf{Intern Pixel Pusher at Vandalay Industries} \\
    \lipsum[66]
  \end{tabular}
\end{tabular}
\end{document}

Some modifications to your code include:

share|improve this answer

The multirow package can help you here.

If you rather want to set manual line-breaks, you can just explicitly divide the text across the first column, i.e.

\begin{tabular}{L!{\VRule}R}
    June 2012 --  & {\bf Pixel Pusher at Vandalay Industries}        \\
    present       & \lipsum[66]\vspace{5pt}                          \\
    Sept. 2011 -- & {\bf Intern Pixel Pusher at Vandalay Industries} \\
    Apr. 2012     & \lipsum*[66]                                     \\
\end{tabular}

Code

\documentclass[10pt]{article}
\usepackage[margin=3cm]{geometry}
\usepackage{xcolor,array,lipsum,multirow}
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}
\newcolumntype{R}{p{0.8\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\begin{document}
\section*{Professional Experience (Orig)}
\begin{tabular}{L!{\VRule}R}
    June 2012 -- present    & {\bf Pixel Pusher at Vandalay Industries}        \\
                            & \lipsum[66]\vspace{5pt}                          \\
    Sept. 2011 -- Apr. 2012 & {\bf Intern Pixel Pusher at Vandalay Industries} \\
                            & \lipsum[66]                                      \\
\end{tabular}
\section*{Professional Experience (multirow)}
\begin{tabular}{L!{\VRule}R}
    \multirow{2}{\linewidth}{\raggedleft June~2012 -- present}    & {\bfseries Pixel Pusher at Vandalay Industries}        \\
                                                                  & \lipsum[66]\vspace{5pt}                                \\
    \multirow{2}{\linewidth}{\raggedleft Sept.~2011 -- Apr.~2012} & {\bfseries Intern Pixel Pusher at Vandalay Industries} \\
                                                                  & \lipsum*[66]
\end{tabular}
\end{document}

Output

enter image description here

share|improve this answer

No \multirow nor nested tabular environments:

\documentclass[10pt]{article}
\usepackage[margin=3cm]{geometry}

\usepackage{xcolor,array,lipsum,collcell}

\definecolor{lightgray}{gray}{0.8}

\newcolumntype{L}{>{\collectcell\MyDates}l<{\endcollectcell}}
\newcommand{\MyDates}[1]{\parbox[t][0pt]{.14\textwidth}{\raggedleft#1}}

\newcolumntype{R}{p{0.8\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\begin{document}
\section*{Professional Experience}
\begin{tabular}{L!{\VRule}R}
June~2012 -- present     & \bfseries Pixel Pusher at Vandalay Industries        \\
                         & \lipsum[66]                                          \\[5pt]
Sept.~2011 -- Apr.~2012  & \bfseries Intern Pixel Pusher at Vandalay Industries \\
                         & \lipsum*[66]
\end{tabular}
\end{document}

Just ensure that the right column cell has at least two lines, which should be fairly simple to do.

The trick is to convince TeX that the left column cells have no depth under the baseline: the contents is absorbed by means of Martin Scharrer's collcell and put into a \parbox that we give vertical size zero.

enter image description here

Of course there's an easier solution:

\begin{tabular}{>{\raggedleft}p{0.14\textwidth}!{\VRule}p{0.8\textwidth}}
June~2012 -- present     &
 \textbf{Pixel Pusher at Vandalay Industries}\newline
 \lipsum[66]
\\[5pt]
Sept.~2011 -- Apr.~2012  &
 \textbf{Intern Pixel Pusher at Vandalay Industries}\newline
 \lipsum*[66]
\end{tabular}

(Use Werner's method for getting the full line width.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.