tags:

views:

206

answers:

2

I supposed the include-command copy-pastes code in the compilation, it is wrong because the code stopped working. Please, see the middle part in the code. I only copy-pasted the code to the file and added the include-command.

$ cat results/frames.tex
10.31 & 8.50 &  7.40 \\
10.34 & 8.53 &  7.81 \\
8.22 & 8.62 &  7.78 \\
10.16 & 8.53 &  7.44 \\
10.41 & 8.38 &  7.63 \\
10.38 & 8.57 &  8.03 \\
10.13 & 8.66 &  7.41 \\
8.50 & 8.60 &  7.15 \\
10.41 & 8.63 &  7.21 \\
8.53 & 8.53 &  7.12 \\

Latex code, see the middle part

\begin{table}
        \begin{tabular}{ | l | m | r |}
        \hline
        $t$ / s & $d_{1}$ / s & $d_{2}$ / s \\
        $\Delta h = 0,01 s$ & $\Delta d = 0,01 s$ & $\Delta d = 0,01 s$ \\
        \hline
        % I JUST COPIED THE CODE from here to the file, included.
        % It stopped working, why?
        \include{results/frames.tex}
        \hline
        $\pi (\frac{d_{1}}{2} - \frac{d_{2}}{2})$ & $2 \pi R h$ & $2 \pi r h$ \\
        \hline
        \end{tabular}
\end{table}
+8  A: 

Use \input instead of \include, that will work.

\include additionally performs a \clearpage command which will not work in the context of a table.

Konrad Rudolph
You mean Include-command is an input command boxed with the clearpage-command?
HH
The definition of `\input` looks (effectively) like: `\clearpage\input{#1}\clearpage`. (The actual definition is more complex, but this shows the basic idea.)
godbyk
There are other differences: For example, `\include` opens an auxiliary file for every file included, so that you can build parts of the document using `\includeonly` and still get the references correct. `\include`s can't be nested, but `\input`s can. In general, use `\include` for chapters in large documents, and `\input` otherwise.
Philipp
A: 

Try with \input, \include is old and very limited..

Jack
`\include` is not older or worse than `\input`, it just serves a different purpose.
Philipp
`\input` is a Tex primitive. `\include` is a Latex macro defined in terms of `\input`, and so is not as old.
Charles Stewart