2

How can I get a subentry in moderncv?

I've implemented the solution in the above post, but I was wondering if there is some easy way to allow the indentation to also work for wrapped text? So that the entire block gets indented, not just the first line.

MEW:

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}

\newcommand*{\subcventry}[7][.25em]{%
    \cvitem[#1]{#2}{%
        {\hspace*{1em}#3}%
        \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
        \ifthenelse{\equal{#5}{}}{}{, #5}%
        \ifthenelse{\equal{#6}{}}{}{, #6}%
        .\strut%
        \ifx&#7&%
        \else{\newline{}\hspace*{1em}\begin{minipage}[t]{\dimexpr\linewidth-1em}\small#7\end{minipage}}\fi
    }
}

\firstname{Mr.}
\familyname{Awesome} 

\setlength{\hintscolumnwidth}{2.6cm}

\begin{document}
\section{Experience}

\cventry{November 2007 -- current}{Mr. Awesome}{Awesome Ltd.}{The Earth}{}{}
\subcventry{July 2015}{Intake of Awesomeness version 2}{}{}{}{}
\subcventry{May 2014 -- current}{SPOC for all awesomeness in all our awesome clients, which includes Awesome1, Awesome2, awesome3 and awesome4}{}{}{}{}
\end{document}

So I want to fully ident the SPOC line, both lines of it.

Anyone any ideas?

0

The definition of your used command \subcventry does only allow to have more than one line in argument #7, inserted in an own minipage.

You can test this with the example command

\subcventry{November 2007 -- current--2}{Mr. Awesome--3}{Awesome Ltd.--4}{The Earth--5}{test--6}{test--7}

The compilable MWE shows you a correct layout if you move your long text into the last argument:

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}

\newcommand*{\subcventry}[7][.25em]{%
    \cvitem[#1]{#2}{%
        {\hspace*{1em}#3}%
        \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
        \ifthenelse{\equal{#5}{}}{}{, #5}%
        \ifthenelse{\equal{#6}{}}{}{, #6}%
        .\strut%
        \ifx&#7&%
        \else{\newline{}\hspace*{1em}\begin{minipage}[t]{\dimexpr\linewidth-1em}\small#7\end{minipage}}\fi
    }
}

\firstname{Mr.}
\familyname{Awesome} 

\setlength{\hintscolumnwidth}{2.6cm}

\begin{document}
\section{Experience}

\cventry{November 2007 -- current}{Mr. Awesome}{Awesome Ltd.}{The Earth}{}{}
\subcventry{November 2007 -- current--2}{Mr. Awesome--3}{Awesome Ltd.--4}{The Earth--5}{test--6}{test--7}
\subcventry{July 2015}{Intake of Awesomeness version 2}{}{}{}{}
\subcventry{May 2014 -- current}{SPOC}{}{}{}{SPOC for all awesomeness in all our awesome clients, which includes Awesome1, Awesome2, awesome3 and awesome4}
\end{document}

with the result:

enter image description here

The last \subcventry shows the result with moved argument ...

Or you can define a new own command \mysubcventry like

\newcommand*{\mysubcventry}[3][.25em]{%
    \cvitem[#1]{#2}{%
        {\hspace*{1em}\begin{minipage}[t]{\dimexpr\linewidth-1em}\small#3\end{minipage}}
    }
}

with two parameters and one option (for the vertical space at the end of command \cvitem).

With the following MWE

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}

\newcommand*{\subcventry}[7][.25em]{%
    \cvitem[#1]{#2}{%
        {\hspace*{1em}#3}%
        \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
        \ifthenelse{\equal{#5}{}}{}{, #5}%
        \ifthenelse{\equal{#6}{}}{}{, #6}%
        .\strut%
        \ifx&#7&%
        \else{\newline{}\hspace*{1em}\begin{minipage}[t]{\dimexpr\linewidth-1em}\small#7\end{minipage}}\fi
    }
}

\newcommand*{\mysubcventry}[3][.25em]{%
    \cvitem[#1]{#2}{%
        {\hspace*{1em}\begin{minipage}[t]{\dimexpr\linewidth-1em}\small#3\end{minipage}}
    }
}

\firstname{Mr.}
\familyname{Awesome} 

\setlength{\hintscolumnwidth}{2.6cm}


\begin{document}
\section{Experience}

\cventry{November 2007 -- current}{Mr. Awesome}{Awesome Ltd.}{The Earth}{}{}
\subcventry{November 2007 -- current--2}{Mr. Awesome--3}{Awesome Ltd.--4}{The Earth--5}{test--6}{test--7.}
\subcventry{July 2015}{Intake of Awesomeness version 2}{}{}{}{}
\subcventry{May 2014 -- current}{SPOC}{}{}{}{SPOC for all awesomeness in all our awesome clients, which includes Awesome1, Awesome2, awesome3 and awesome4.}
\mysubcventry[5em]{May 2014 -- current}{SPOC for all awesomeness in all our awesome clients, which includes Awesome1, Awesome2, awesome3 and awesome4.}
\mysubcventry{May 2014 -- current}{SPOC for all awesomeness in all our awesome clients, which includes Awesome1, Awesome2, awesome3 and awesome4.}
\end{document}

you get the result

enter image description here

  • Ok, while this solution didn't really provide what I was looking for, it did helped me how to interprete the newcommand that was being defined. For my own uses, I've redefined it as: \newcommand*{\subcventry}[3][.25em]{ \cvitem[#1]{#2}{ \hspace*{1em} \begin{minipage}[t] { \dimexpr \linewidth-1em} \small#3 \end{minipage}} } – devilkin Nov 19 '17 at 20:40

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.