1

I have a document with below Section command, if the size of items inside the section increase to more than a page it moves the whole section to next page, but I want to break the section between two pages, any hint?

\renewcommand*{\section}[1]{%
  \par\addvspace{2.5ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{section}{#1}%
  \parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}%
  \hspace{\separatorcolumnwidth}%
  \parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#1}}%
  \par\nobreak\addvspace{1ex}\@afterheading}
  • 2
    Many of the packages you need in order to make this redefinition are missing; can you post a MWE that illustrates the problem instead of just this fragment? – cslstr May 25 '14 at 19:01
  • What are you trying to accomplish with this redefinition? It seems like you are renewing to almost the exact definition of \section with moderncv's classical style... – cslstr May 25 '14 at 19:16
  • yes this is part of moderncv classic,I just want to modify the cv template to do page breaks if the section is bigger than the size of a page, – user52412 May 25 '14 at 19:24
  • 2
    OK - so back to my first comment: Can you post a MWE that shows the issue you are having? I cannot recreate the problem with moderncv/classic, with or without your renewcommand. – cslstr May 25 '14 at 19:26
  • 1
    @user52412: You're clearly using \section incorrectly, as you're setting the argument into a fixed-width box (a \parbox that doesn't break across the page boundary). Typically only the title (or heading) should form part of the section macro, with the remaining elements set outside the macro so there's no restriction in terms of page breaking. – Werner May 25 '14 at 19:33
1

I used below workaround: I need to find on which item the page need a break so on that item I ended the \cventry and started a new \cventry with blank parameters like: \cventry{}{}{}{}{}{ \begin{itemize}

0

\newpage will break a section between \cventrys, but as @user52412 points out if you want to page break across a \cventry you need to split the entry into two (the second with empty opening fields).

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.