22

Possible Duplicate:
Page break with \include

I have got my LaTeX documents split in to several files, but when I input them in to my main document it starts the content on a new page. How can I stop this from happening? Here is what's going on:
outputFromLatex

In my separate files I start each with:

\subsubsection{Sub-Sub-Section Title}

And in my main document i'm inputting the files by saying:

\include{resonantCircuits}

Is there anyway I can get it to continue on the same page instead of having this page break?

marked as duplicate by Joseph Wright Dec 1 '11 at 21:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    The title says \input, but the question body says \include? – Gonzalo Medina Nov 25 '11 at 19:21
  • Sorry I was originally using \input then tried \include and I had just copied and pasted from my document. I have changed it now. – Dean Nov 25 '11 at 19:24
  • 2
    And it typesets correctly. This question is redundant now. – Dean Nov 25 '11 at 19:28
  • 3
    On an un-related note, a lot of folks put Table captions above the table, and avoid vertical lines. Have a look at the booktabs documentation for more details – cmhughes Nov 25 '11 at 20:11
  • 1
    I have changed the question so that it states \include instead of \input. Otherwise it won't make any sense. I did this because future visitors to this question (with a similar problem) won't understand it otherwise. – topskip Nov 25 '11 at 21:22
59

Use \input instead of \include.

1

If you really want this, you can try with:

\makeatletter
\def\@include#1 {%
%  \clearpage % This was removed from latex.ltx definition
  \if@filesw
    \immediate\write\@mainaux{\string\@input{#1.aux}}%
  \fi
  \@tempswatrue
  \if@partsw
    \@tempswafalse
    \edef\reserved@b{#1}%
    \@for\reserved@a:=\@partlist\do
      {\ifx\reserved@a\reserved@b\@tempswatrue\fi}%
  \fi
  \if@tempswa
    \let\@auxout\@partaux
    \if@filesw
      \immediate\openout\@partaux #1.aux
      \immediate\write\@partaux{\relax}%
    \fi
    \@input@{#1.tex}%
    \clearpage
    \@writeckpt{#1}%
    \if@filesw
      \immediate\closeout\@partaux
    \fi
  \else
    \deadcycles\z@
    \@nameuse{cp@#1}%
  \fi
  \let\@auxout\@mainaux}
\makeatother

However, this will cause problems because the page numbers will probably be wrong when \includeonly-ing some parts of the document.

I wouldn't do that, and stick to \input.

Not the answer you're looking for? Browse other questions tagged or ask your own question.