0

I am writing a report and i am using a specific .cls file for the layout and fonts etc. The abstract is defined as follows:

\newenvironment{abstract}
{
\btypeout{Abstract Page}
\thispagestyle{empty}
\null\vfil
\begin{center}
\setlength{\parskip}{0pt}
{\normalsize \UNIVNAME \par}
\bigskip
{\underline{ABSTRACT} \par}
\bigskip
{\normalsize \FACNAME \par}
{\normalsize \DEPTNAME \par}
\bigskip
{\normalsize \underline{This is a report}\par}
\bigskip
{\normalsize\bf \@title \par}
\medskip
{\normalsize by \authornames \par}
\bigskip
 \end{center}
 }

However, in the document when i use

\begin{abstract}
 Many words that require 2 pages
\end{abstract}

the word "Abstract" along with the rest of the defined terms appear on the bottom of a page and the abstract actually starts on the next page. What I want, is the word "Abstract" to be on top of the page and then the actual abstract pages should follow from there, which i think it is the normal thing to do. A hack around so far was to use minipage to enclose the whole abstract in it and thus force the "Abstract" to start on top of the page. However, i am having a hard time to manually break the page within minipage as the whole text wont fit. Just for reference, just before the abstract I have the followings:

\begin{document} 
\frontmatter
\title{My title} % TODO Fill in your title
\authors{\texorpdfstring
{\href{mailto:myemail@myuni}{My name}} % TODO Fill in your email address and name
{My name} % TODO Fill in your name (again)
}
\addresses{\groupname\\\deptname\\\univname} 
\date{\today}
\subject{}
\keywords{}
\supervisor{Some names} % TODO Fill in your supervisor's name(s)
\examiner{Some names} % TODO Fill in your examiner's name

\maketitle
2

Actually, you are getting exactly what you asked for: an infinitely stretchable vertical space, followed by the titles, followed by the page break that you yourself indicated as the most desirable one -- namely, the end of the center environment. None of the other potential page breaks that follow have such a high “bonus” associated with it (breaking between the lines of a paragraph is charged a “penalty”, breaking between two paragraphs usually isn’t charged, but it is neither rewarded), while, on the other hand, you have dictated that the vertical space above the titles can be stretched arbitrarily far at no cost at all.

I have elaborated on the code presented in cfr’s answer in order to prohibit all possible page breaks before the beginning of the text contained in the abstract environment:

\documentclass{article}
\usepackage{lipsum}

\makeatletter
\renewenvironment{abstract}
{%
  \typeout{Abstract Page}%
  \cleardoublepage % or simply \clearpage
  \thispagestyle{empty}%
  \begingroup
    \centering
    \setlength{\parskip}{0pt}%
    {\normalsize UNIVNAME \par}%
    \nobreak\bigskip
    {\underline{ABSTRACT} \par}%
    \nobreak\bigskip
    {\normalsize FACNAME \par}%
    {\normalsize DEPTNAME \par}%
    \nobreak\bigskip
    {\normalsize \underline{This is a report}\par}%
    \nobreak\bigskip
    {\normalsize\bfseries \@title \par}%
    \nobreak\medskip
    {\normalsize by \@author \par}%
  \endgroup
  \nobreak\addvspace{\glueexpr\topsep+\partopsep}%
}{}

\makeatother
\title{Title}
\author{Author}

\begin{document}
  \begin{abstract}
    \lipsum[1-5]
  \end{abstract}
\end{document}

The output that this code produces is essentially the same as cfr’s.

One final remark: the reason for saying \null\vfil at the beginning of the definition of the abstract environment is probably that you want a short abstract to be (more or less) vertically centered on a single page; that couple of commands is probably paired with a \vfil\null that is issued in the code that terminates the environment, which is not shown in your question. Yet you say that your abstract is two pages long. I agree with cfr that you have not made clear enough what you actually want to achieve. Until you do, it is almost impossible to efficaciously help you.

0

Because your code is incomplete and cannot be compiled when pasted into the preamble of a standard document, it is difficult to know for sure what is going on. However, if your abstract needs to run to a second page or more, including \null\vfil is almost certainly not what you want.

I've replaced undefined commands with either placeholders or standard commands and used \renewcommand rather than \newcommand just in an effort to reproduce the problem.

The code below avoids the unwanted pushing to the bottom of the page for my attempted reconstruction. Whether it works for you is another question.

The code which you posted essentially assumes that the abstract will not need to continue onto a second page. Otherwise, weird things happen as you discovered.

I've also replaced the long obsolete font switch \bf by the LaTeX-2e equivalent \bfseries. The obsolete commands are long deprecated and ought not be used.

\documentclass{article}
\usepackage{kantlipsum}
\makeatletter
\renewenvironment{abstract}
{%
  \typeout{Abstract Page}
  \thispagestyle{empty}
  \begin{center}
    \setlength{\parskip}{0pt}
    {\normalsize UNIVNAME \par}
    \bigskip
    {\underline{ABSTRACT} \par}
    \bigskip
    {\normalsize FACNAME \par}
    {\normalsize DEPTNAME \par}
    \bigskip
    {\normalsize \underline{This is a report}\par}
    \bigskip
    {\normalsize\bfseries \@title \par}
    \medskip
    {\normalsize by \@author \par}
    \bigskip
  \end{center}
}{}
\makeatother
\title{Title}
\author{Author}

\begin{document}
  \begin{abstract}
    \kant[1-5]
  \end{abstract}

\end{document}

long abstract

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.