如何禁止分页?

如何禁止分页?

这是回复,因为我似乎因为解释不充分而被禁言。抱歉,解释不够简洁。
我找到了可以做的事情。问题的第二部分对此进行了解释。如果我能再次发帖,我会尝试更好地解释它是如何工作的。

因此,第一个代码:问题;第二个代码:答案 - => 不再有愚蠢的分页符。
问:
无论我尝试什么,我似乎都无法摆脱烦人的分页符: \nopagebreaksamepage\fillbreak\nobreak\needspace{48pt}等。我正在使用 moderncv 模板,我开始认为它无法完成,像分页这样的简单控制......

看起来moderncv好像我想在第一页使用超过 4 个部分,我就会得到一个分页符。

下面是我被这些烦人的分页符困住的部分代码:

好的。
我只会放完整的代码,因为我不知道该从哪里删除安全地:)) 还有什么额外的。其余包含的文件都在这个网站上http://www.ctan.org/tex-archive/macros/latex/contrib/moderncv 如果我必须把所有东西都准备好才能完成整个跑步,请告诉我:))

因此,主要代码:

\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{[email protected]}                          % 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}

答:
显然,如果我从第 5 部分(专业经验部分)中删除以下代码,我就可以避免不必要的分页符:

\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}

为了很好地列出我直接使用的文本\listitemsymbol,这样我就可以在左列中显示日期,在右列中显示大列,在解释下一个工作之前,我需要这些项目符号。

相关内容