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.

SOS .. Hope, that you guys can help me. :)))

I want to write my cv with moderncv-Classic style.. Can you tell me, how i can remove the horizontal line in the left of each section?

Thanks for your Comments!!

share|improve this question

2 Answers 2

Here you go:

\RenewDocumentCommand{\section}{sm}{%
  \strut\sectionstyle{#2\hfill}%
  \par\nobreak\addvspace{1ex}\@afterheading
  }

The above code is the core of what is required. Now time for an MWE:
The MWE

\documentclass[12pt,letterpaper]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{kantlipsum}

\makeatletter
\RenewDocumentCommand{\section}{sm}{%
  \strut\sectionstyle{#2\hfill}%
  \par\nobreak\addvspace{1ex}\@afterheading
  }

\RenewDocumentCommand{\subsection}{sm}{
  \strut\subsectionstyle{#2}{\color{color1}{\subsectionfill}}%
  \par\nobreak\addvspace{0.5ex}\@afterheading}
%
\makeatother

\name{SUBHAM}{SONI}
\address{ABC}{XYZ}{PQR}
\phone[mobile]{1234567}

\begin{document}
\makecvtitle
\section{CAREER OBJECTIVE}
\kant[1]
\end{document} 

enter image description here

share|improve this answer
    
Thank you! Can you pls me, where I have to put in the first Codex? The ModernCV file or the style file? –  Aline May 24 at 12:59
    
The first code must be put after your \usepackages commands , it has to begin with \makeatletter , then the code , followed by \makeatother. Then, your commands for the title like \name etc, then \begin{document} and end{document}. See the MWE for reference.@Aline –  subham soni May 24 at 13:04

It largely depends on the style you are using (and on the version of moderncv) which is the reason why a MWE would be good.

Assuming you are using the latest version of moderncv and the classic or casual theme you can put

\makeatletter
\RenewDocumentCommand{\section}{sm}{%
  \par\addvspace{2.5ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{section}{#2}%
  \parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\rule{\hintscolumnwidth}{0ex}}}%
  \hspace{\separatorcolumnwidth}%
  \parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#2}}%
  \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
\makeatother

in your preamble (before \begin{document}) to get sections with an invisible bar or

\makeatletter
\RenewDocumentCommand{\section}{sm}{%
  \par\addvspace{2.5ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{section}{#2}%
  {\strut\sectionstyle{#2}}%
  \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
\makeatother

for removing the bar completely.

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.