## LaTeX forum ⇒ Text Formatting ⇒ Problem compiling a table environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
asafw
Posts: 37
Joined: Sun Jun 10, 2012 12:33 pm

### Problem compiling a table environment

Hi,

I'm using a document class "statsoc" (available from https://rss.onlinelibrary.wiley.com/hub ... guidelines) and having trouble compiling with a simple table example. I couldn't figure out if this is a conflict between packages I'm using or something else.. Any idea?

Thanks so much,
Asaf


Ijon Tichy
Posts: 165
Joined: Mon Dec 24, 2018 10:12 am
statsoc is a publisher class with many restrictions. For example it does not support optional arguments for the table environment and expects \caption at the beginning of the table environment (see the example in the style guide). So respecting the style guide, your table should be something like
\begin{table}\caption{\label{table:1}Table to test captions and labels}\centering\fbox{%\begin{tabular}{c c c c}  \hline Col1 & Col2 & Col2 & Col3 \\ [0.5ex]  \hline\hline 1 & 6 & 87837 & 787 \\  2 & 7 & 78 & 5415 \\ 3 & 545 & 778 & 7507 \\ 4 & 545 & 18744 & 7560 \\ 5 & 88 & 788 & 6344 \\ [1ex]  \hline\end{tabular}}\end{table}
and indeed this compiles without error.

Usage of packages like float and geometry doe not make much sense if you want to publish your article at wiley. Usually publishers use their own layout, i.e., margins settings. BTW: You should use option mathptm or mathtimes instead of loading package times.

Additional problems could occur if you use packages like subcaption or caption (or even if you actively try to usage float package), because the internals of the class are not made for the usage of such packages and the packages usually do not know such proprietary classes.

Note also, the publisher does provide outdated versions of amssym and natbib with the template. I do not know, whether or not these outdated files interfere with up-to-date versions of AMS packages like amsmath, The publisher should not do so.

If you do not want to use the publisher, I would not use such a special publisher class but a more flexible or general class.

BTW: In case of statsoc the publisher even writes: "it is not compulsory to use it". So maybe it would be a good idea not to use it.