dnl-blkv / mcdowell-cv

A Nice-looking CV template made into LaTeX
https://www.careercup.com/resume
MIT License
2.21k stars 777 forks source link

Support for multi-column (1 and 2) cvsubsection #15

Open madhur4127 opened 4 years ago

madhur4127 commented 4 years ago

Currently the environment cvsubsection provides fixed numbers of columns — 3.

If the text in middle column is long with left and right columns being under unutilized still there is a need to break the text in middle column over several lines, which wastes space.

Illustration:

image


A single line could suffice for this long title provided there is a single column instead of 3.

Code:


\begin{cvsection}{Additional Experience and Awards}
    \begin{cvsubsection}[3]{}{Gayle's Sample CV Experiences and awards}{}
        \begin{itemize}
            \item \textbf{Instructor (2003 – 2005):} Taught two full-credit Computer Science courses; average ratings of 4.8
            \item \textbf{Third Prize, Senior Design Projects:} Awarded 3rd prize for Synchronized Calendar project, out of
        \end{itemize}
    \end{cvsubsection}
\end{cvsection}
madhur4127 commented 4 years ago

If somebody needs a quickfix, paste these lines before \makeatother at the very end:

\newenvironment{cvsubsectioncenter}[2][1]{
    \notblank{#2}{\toggletrue{centertitledefined}}{}
    \ifboolexpr{togl {centertitledefined}}{
        \begin{center}
            \textbf{#2} \linebreak
        \end{center}
        % Add space according to the specidied number of lines
        \ifnumcomp{#1}{=}{1}{\vspace*{\aftersinglelinesubsectionheaderspace}}{
            \ifnumcomp{#1}{=}{2}{\vspace*{\afterdoublelinesubsectionheaderspace}}{
                \vspace*{\aftermultilinesubsectionheaderspace}
            }
        }
    } {
        \vspace*{\afteremptysubsectionheaderspace}
    }
    \togglefalse{centertitledefined}
    \begin{adjustwidth}{\subsectionmargin}{\subsectionmargin}
}
{
    \end{adjustwidth}
    \vspace*{\aftersubsectionspace}
}

Now the required functionality is available by using

\begin{cvsubsectioncenter}[number of lines -- optional]{title}
........
\end{cvsubsectioncenter}

instead of vanilla 3 column cvsubsection.