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.

This is a response, because it seems I was banned for poor explanations. Sorry, that there is was no concision in the explanations.
I found what can be done. it is explained in the second part of the question. If I can ever post again I'll try to explain better how it worked.

So first code: the question; second code: the answer- => no more silly pagebreaks.
Q:
I didn't seem to escape the annoying page breaks, no matter what I try: \nopagebreak or samepage or \fillbreak or \nobreak or \needspace{48pt}, etc. I'm using the moderncv template and I'm starting to think it can't be done, a simple control of like paging...

In moderncv it seems as if I want to use on the first page more than 4 sections I will get a page break.

Here's part of the code where I'm stuck with these annoying page breaks:

Ok.
I'll just put the complete code, because I don't know to take out safely :)) what's extra. The rest of included files are at this website http://www.ctan.org/tex-archive/macros/latex/contrib/moderncv If I must put everything together for a full run tell me :))

So, the main code:

\documentclass[11pt,a4paper,sans]{moderncv}   % possible options include font size 

% ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

% moderncv themes
\moderncvstyle{classic}                        % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{green}                          % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
%\renewcommand{\familydefault}{\sfdefault}    % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{}                             % uncomment to suppress automatic page numbering for CVs longer than one page

% character encoding
%\usepackage[utf8]{inputenc}                  % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8}                         % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

%\usepackage{ulem}
\usepackage{needspace}
% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}           % if you want to change the width of the column with the dates
%\setlength{\makecvtitlenamewidth}{10cm}      % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

% personal data
\firstname{Ion}
\familyname{Ciobanu}
\title{Curriculum Vitae}                          % optional, remove / comment the line if not wanted
\address{Str}{7}    % optional, remove / comment the line if not wanted
\mobile{1}                     % optional, remove / comment the line if not wanted
%\phone{}                      % optional, remove / comment the line if not wanted
%\fax{+3~(456)~789~012}                        % optional, remove / comment the line if not wanted
\email{lu@hotmail.com}                          % optional, remove / comment the line if not wanted
\homepage{www.dt.blogspot.com}                    % optional, remove / comment the line if not wanted
%\extrainfo{additional information}            % optional, remove / comment the line if not wanted
\photo[80pt][0.4pt]{picture}                  % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file
\quote{Just a thought of a dream being: \\*Reality is wrong. Dreams are for real.}                            % optional, remove / comment the line if not wanted
%No papers, no person
% to show numerical labels in the bibliography (default is to show no labels); only useful if you make citations in your resume
%\makeatletter
%\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
%\makeatother
\makeatletter
\renewcommand*{\nopagenumbers}{\@displaypagenumbersfalse}
\AtEndPreamble{%
  \AtBeginDocument{%
    \if@displaypagenumbers%
      \@ifundefined{r@lastpage}{}{%
        \ifthenelse{\pageref{lastpage}>1}{%
          \settowidth{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}%
          \fancypagestyle{plain}{%
            \fancyfoot[r]{\parbox[t]{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\color{blue}{Ion}\,\color{yellow}{Ciobanu}\,\color{red}\thepage/\color{red}\pageref{lastpage}}}}% the parbox is required to ensure alignment with a possible center footer (e.g., as in the casual style)
%            \fancyfoot[r]{\parbox[t]{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\color{blue}{Ion}\,{Ciobanu}\,\color{color2}\thepage/\color{red}\pageref{lastpage}}}}% the other option
          \pagestyle{plain}}{}}%
%\thispagestyle{empty}
      \AtEndDocument{\label{lastpage}}\else\fi}}
%\makeatother

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn}                     % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------
\makecvtitle

\section{Objective}
%\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % arguments 3 to 6 can be left empty
\cventry{}{\textit{\textmd{To design}}}{}{}{}{}

\section{Education}
\cventry{2010 -- 2012}{many}{Univ}{Tanzania}{}{Computer Science }
\cventry{2006 -- 2010}{many}{Univ}{Tanzania}{}{Computer Science }

\section{tales}
\cvitem{title}{\emph{Optima\,}{(Grade, 11.00)}}
\cvitem{supervisors}{Prof}
\cvitem{description}{prj}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here is the problem. This would be the 5 the section "Professional
%  Experience" so it puts it on the next page. 
%
% Tried several options which are commented  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Professional Experience}%\nopagebreak[4]%\needspace\baselineskip%{\needspace{48pt}}%{\,\nopagebreak}
\subsection{Vocational}

\cventry{April\,2001--December\,2012}{ Engineer}{Company}{City}{}{A lot.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{Language 2}{Skill level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}

\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}

\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}

\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3}

\renewcommand{\listitemsymbol}{-~}            % change the symbol for lists

\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5\cite{book1}}
\cvlistdoubleitem{Item 3}{}

% Publications from a BibTeX file without multibib
%  for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
%  to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles}
\nocite{*}
\bibliographystyle{plain}
\bibliography{publications}                   % 'publications' is the name of a BibTeX file

% Publications from a BibTeX file using the multibib package
%\section{Publications}
%\nocitebook{book1,book2}
%\bibliographystylebook{plain}
%\bibliographybook{publications}              % 'publications' is the name of a BibTeX file
%\nocitemisc{misc1,misc2,misc3}
%\bibliographystylemisc{plain}
%\bibliographymisc{publications}              % 'publications' is the name of a BibTeX file

\clearpage

%\clearpage\end{CJK*}                         % if you are typesetting your resume in Chinese using CJK; the \clearpage is required for fancyhdr to work correctly with CJK, though it kills the page numbering by making \lastpage undefined
\end{document}

A:
Apparently if I remove from the 5th section--the Professional Experience section--the following code allows me to avoid undesired page breaks:

\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

To have nicely itemized the texts I use directly \listitemsymbol and with this I can have both the left column with dates and the big right column, in which I needed these item symbols before a next job explained.

share|improve this question
3  
Please complement your code to a full compilable minimal working example (MWE), starting with \documentclass{...} and ending with \end{document}. Also make sure it has nothing in it that is not needed to reproduce the undesired behavior. –  doncherry Nov 5 '12 at 4:08
    
Welcome to TeX.SE. Also, as @doncherry suggested, it really would be helpful to have a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. –  Peter Grill Nov 5 '12 at 4:14
    
done in the question –  Jr. Nov 5 '12 at 5:28
    
Consider \enlargethispage{2cm} or \enlargethispage{2\baselineskip} and variations on this, to increase the space available on a given page. –  Andrew Swann Nov 5 '12 at 7:59
    
@Jr. Thanks! Unfortunately, there is a lot of stuff left in your code that is definitely not needed to reproduce the undesired behavior -- as I remarked earlier --, starting off with all the commented lines. –  doncherry Nov 5 '12 at 8:08
show 2 more comments

closed as too localized by Joseph Wright Nov 20 '12 at 8:26

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.