1

I have a table:

\begin{table}
\begin{align}
\nonumber
b_{1}  & = 0,200                   & \beta_{1}  & = z                           \\
\nonumber
b_{2}  & = 0,022                   & \beta_{2}  & = q                           \\
\nonumber
b_{3}  & = z                       & \beta_{3}  & = 0                           \\
\nonumber
b_{4}  & = 0,024                   & \beta_{4}  & = (3/2)\cdot\pi               \\
\nonumber
b_{5}  & = 0,052                   & \beta_{5}  & = z                           \\
\nonumber
b_{6}  & = 0,067                   & \beta_{6}  & = z                           \\
\nonumber
b_{7}  & = 0,008                   & \beta_{7}  & = z                           \\
\nonumber
b_{8}  & = z                       & \beta_{8}  & = \pi                         \\
\nonumber
b_{9}  & = b_{7}                   & \beta_{9}  & = (3/2)\cdot\pi               \\
\nonumber
b_{10} & = b_{6}-b_{4}             & \beta_{10} & = (3/2)\cdot\pi               
\end{align}
\caption{table 1}
\label{tab 1}
\end{table}

The table continues with more lines. The reason why I formatted it in "align" is because I wanted aligned equal signs and I would have to add $ everywhere because of math. Than I wrapped it in "table" cause I needed table caption.

Problem comes with lenght of the table. I tried to use \allowpagebreaks but it won't break since it is inside of the table. Then I tried to use longtable but it didn't work with align inside. I also tried to put blank table with caption under "align", but tex sometimes puts the table elsewhere and also in list of tables there should be the number of the page where the table begins I suppose.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149

1 Answers1

3

If you need a caption, you don't actually have to put it in a float- you can use the caption package which provides the command

\captionof{table}{Your caption goes here}

The captionof stands for 'caption outside float', but handily you can also read it as 'caption of'.

In the example below I have used the geometry package simply to change the page size so that you can see that the allowdisplaybreaks works as intended.

To fix the problem with paragraph indentation being set to zero after the caption, place the \captionof command within a pair of braces ({\captionof{figure}{...}}).

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage[textheight=12cm]{geometry}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{lipsum}
\allowdisplaybreaks

\begin{document}

\listoftables

\section{Section}
\lipsum[1]
\lipsum[1]

{\captionof{table}{My caption goes here}\label{tab:anythingyouwant}}
\begin{align*}
    b_{1}  & = 0,200       & \beta_{1}  & = z             \\
    b_{2}  & = 0,022       & \beta_{2}  & = q             \\
    b_{3}  & = z           & \beta_{3}  & = 0             \\
    b_{4}  & = 0,024       & \beta_{4}  & = (3/2)\cdot\pi \\
    b_{5}  & = 0,052       & \beta_{5}  & = z             \\
    b_{6}  & = 0,067       & \beta_{6}  & = z             \\
    b_{7}  & = 0,008       & \beta_{7}  & = z             \\
    b_{8}  & = z           & \beta_{8}  & = \pi           \\
    b_{9}  & = b_{7}       & \beta_{9}  & = (3/2)\cdot\pi \\
    b_{10} & = b_{6}-b_{4} & \beta_{10} & = (3/2)\cdot\pi 
\end{align*}

Here's a reference: \ref{tab:anythingyouwant}.
\lipsum[1]
\end{document}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
cmhughes
  • 100,947
  • ok, that could help, but is there a possibility of \label? And I think that does not solve the problem with number of the page where the table ends in list of tables if I put the caption under the table. – Pavel Snabl Jun 01 '13 at 17:52
  • @PavelSnabl have updated with listoftables and ref, both are as expected :) Note that table captions should be above tables, as discussed in Why should a table caption be placed above the table? – cmhughes Jun 01 '13 at 18:09
  • I find it logical to place the caption above the table now. But I think that using caption package does not support referencing. Am I right that putting a blank table with caption and label would be better in this case? – Pavel Snabl Jun 01 '13 at 18:26
  • @PavelSnabl I'm not sure what you mean- my MWE contains a reference which works as expected- don't forget to compile twice :) No need for a blank/empty table :) – cmhughes Jun 01 '13 at 18:27
  • sorry, it works fine now. But one think that does not suit me is the small vertical space between text and caption and big space between caption and table. But that´s probably how it should be... – Pavel Snabl Jun 01 '13 at 18:38
  • it is not possible to put the caption and label inside the align to prevent the uneven spacing right? – Pavel Snabl Jun 01 '13 at 18:58
  • @PavelSnabl the vertical space is partly from the caption, partly from the align environment- I think you might be better off using a table and using the aligned environment within it- page breaks are going to be a problem though – cmhughes Jun 01 '13 at 20:37
  • Unfortunately the page breaks are necessary for me. And today I found another problem about your solution - all paragraphs under the caption are without indent, which is quite a big problem. – Pavel Snabl Jun 02 '13 at 12:18
  • 1
    @PavelSnabl I edited cmhughes' answer with a fix to the paragraph indentation issue. – Torbjørn T. Nov 02 '13 at 23:04