2

In the following example, my rule does not extend to cover my entire text. Is there a quick post-package addition to ensure that the section rule extends to the end of the margin on the right hand size.

% ============================================
% document setup
% ============================================
\documentclass[11pt,letterpaper,sans]{moderncv}
\usepackage{enumitem}

% --------------------------------------------
% header style
% --------------------------------------------
\moderncvstyle{classic}
% style options: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}

% --------------------------------------------
% header details
% --------------------------------------------
\usepackage{import}
\name{John}{Smith}
\address{1234 Main Street}{Chicago, IL}{12345}
\phone[fixed]{+1 (123) 456-7899}
\homepage{https://github.com/john-smith}

% ============================================
% CV content
% ============================================

% --------------------------------------------
% body style
% --------------------------------------------
\moderncvstyle{banking}
% style options: 'casual' (default), 'classic', 'oldstyle' and 'banking'

% ++++++++++++++++++++++++++++++++++++++++++++
% begin
% ++++++++++++++++++++++++++++++++++++++++++++
\begin{document}
\makecvtitle

% --------------------------------------------
\section{Experience}
% --------------------------------------------
\begin{itemize}
\item[]{
\cventry{June 2017 -- September 2017} % date
{Employee} % role
{Company} % company
{City, State} % city
{important} % role title
{\begin{itemize}% main text
\item abcdefg
\item abcdefg
\item abcdefg
\end{itemize}}}

\item[]{
\cventry{June 2017 -- September 2017} % date
{Employee} % role
{Company} % company
{City, State} % city
{important} % role title
{\begin{itemize}% main text
\item abcdefg
\item abcdefg
\item abcdefg
\end{itemize}}}
\end{itemize}

% ++++++++++++++++++++++++++++++++++++++++++++
% end
% ++++++++++++++++++++++++++++++++++++++++++++
\end{document}

Alternatively, how might I cleanly edit a single line in the moderncvbodyi.sty source to adjust the \hrule?

2

The style banking of class moderncv has a special layout, that is based on the usage of command \cventry without beeing inserted in an itemize environment.

Therefore it is defined in this way:

\renewcommand*{\cventry}[7][.25em]{
  \begin{tabular*}{\maincolumnwidth}{l@{\extracolsep{\fill}}r}% <============
    {\bfseries #4} & {\bfseries #5}\\%
    {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%
  \end{tabular*}%
  \ifx&#7&%
  \else{\\%
    \begin{minipage}{\maincolumnwidth}% <====================================
      \small#7%
    \end{minipage}}\fi%
  \par\addvspace{#1}}

Inserted in an environment itemize the length \maincolumnwidth calculated earlier is too long.

You can omit using environment itemize or have to define an own command \mycventry (I changed \maincolumnwidth to \linewidth):

\newcommand*{\mycventry}[7][.25em]{
  \begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}% <=============
    {\bfseries #4} & {\bfseries #5}\\%
    {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%
  \end{tabular*}%
  \ifx&#7&%
  \else{\\%
    \begin{minipage}{\linewidth}% <=====================================
      \small#7%
    \end{minipage}}\fi%
  \par\addvspace{#1}}

With the following MWE (first I used your way, second I used the usual way to use \cventry and then \mycventry):

% ============================================
% document setup
% ============================================
\documentclass[11pt,letterpaper,sans]{moderncv}
\usepackage{enumitem}


\moderncvstyle{banking}
% style options: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}

\usepackage{showframe}

\newcommand*{\mycventry}[7][.25em]{
  \begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}% <=============
    {\bfseries #4} & {\bfseries #5}\\%
    {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%
  \end{tabular*}%
  \ifx&#7&%
  \else{\\%
    \begin{minipage}{\linewidth}% <===========================
      \small#7%
    \end{minipage}}\fi%
  \par\addvspace{#1}}

% --------------------------------------------
% header details
% --------------------------------------------
\usepackage{import}
\name{John}{Smith}
\address{1234 Main Street}{Chicago, IL}{12345}
\phone[fixed]{+1 (123) 456-7899}
\homepage{https://github.com/john-smith}

% ============================================
% CV content
% ============================================


% ++++++++++++++++++++++++++++++++++++++++++++
% begin
% ++++++++++++++++++++++++++++++++++++++++++++
\begin{document}
\makecvtitle

% --------------------------------------------
\section{Experience}
% --------------------------------------------
\begin{itemize}
\item[]
  \cventry{June 2017 -- September 2017} % date
  {Employee} % role
  {Company} % company
  {City, State} % city
  {important} % role title
  {\begin{itemize}% main text
     \item abcdefg
     \item abcdefg
     \item abcdefg
   \end{itemize}}

\item[]
\mycventry{June 2017 -- September 2017} % date
{Employee} % role
{Company} % company
{City, State} % city
{important} % role title
{\begin{itemize}% main text
\item abcdefg
\item abcdefg
\item abcdefg
\end{itemize}}
\end{itemize}

\section{Experience}
\cventry{June 2017 -- September 2017} % date
{Employee} % role
{Company} % company
{City, State} % city
{important} % role title
{\begin{itemize}% main text
\item abcdefg
\item abcdefg
\item abcdefg
\end{itemize}}

\mycventry{June 2017 -- September 2017} % date
{Employee} % role
{Company} % company
{City, State} % city
{important} % role title
{\begin{itemize}% main text
\item abcdefg
\item abcdefg
\item abcdefg
\end{itemize}}

% ++++++++++++++++++++++++++++++++++++++++++++
% end
% ++++++++++++++++++++++++++++++++++++++++++++
\end{document}

you get the result:

resulting pdf

  • THANK YOU! very helpful to see the bigger picture of what's going on w.r.t. the environment – rrrrr Sep 24 '17 at 4:27
1

As a follow up to the accepted great answer, I also used the following to ensure that line spill-over for items within \mycvenrty would end appropriately:

\newcommand*{\mycventry}[7][.25em]{
  \begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}% <============= (original edit)
    {\bfseries #4} & {\bfseries #5}\\%
    {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%
  \end{tabular*}%
  \ifx&#7&%
  \else{\\%
    \begin{minipage}{\linewidth}% <============= (new edit)
      \small#7%
    \end{minipage}}\fi%
  \par\addvspace{#1}}

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.