LaTeX forum ⇒ Text FormattingProblem 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

Postby asafw » Mon Jun 03, 2019 8:23 pm

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

  1. \documentclass{statsoc}
  2.  
  3. \usepackage{geometry}
  4.  
  5. \geometry{
  6. textwidth=33pc,
  7. textheight=\dimexpr48\baselineskip+\topskip\relax,
  8. marginparsep=11pt,
  9. marginparwidth=107pt,
  10. footnotesep=6.65pt,
  11. headheight=9pt,
  12. headsep=9pt,
  13. footskip=30pt,
  14. }
  15.  
  16. \usepackage{amsmath,amssymb,amsfonts,graphicx,nicefrac,mathtools,bm}
  17. \usepackage{natbib}
  18. \usepackage[english]{babel}
  19. \usepackage{times}
  20. \usepackage[T1]{fontenc}
  21. \usepackage{bbm,mdframed}
  22. \usepackage[dvipsnames]{xcolor}
  23. \usepackage{xspace}
  24. \usepackage{rotating}
  25. \usepackage{graphics,tikz}
  26. \usepackage{grffile}
  27. % \usepackage{subcaption}
  28. \usepackage{epstopdf} % for postscript graphics files
  29. \usepackage{listings}
  30. \usepackage[boxruled,linesnumbered]{algorithm2e}
  31. %\usepackage{multirow}
  32. \usepackage{float}
  33.  
  34.  
  35. \newtheorem{theorem}{Theorem}
  36. \newtheorem{definition}{Definition}
  37. \newtheorem{lemma}{Lemma}
  38. \newtheorem{corollary}{Corollary}
  39. \newtheorem{remark}{Remark}
  40.  
  41. \renewcommand*{\listalgorithmcfname}{List of Protocols}
  42. \renewcommand*{\algorithmcfname}{Protocol}
  43. \renewcommand*{\algorithmautorefname}{protocol}
  44.  
  45.  
  46.  
  47. \title[Online FCR Control]{Online Control of the False Coverage Rate and\\ False Sign Rate}
  48. \author[author short]{author long}
  49.  
  50.  
  51. \begin{document}
  52.  
  53. \begin{table}[h!]
  54. \centering
  55. \begin{tabular}{||c c c c||}
  56. \hline
  57. Col1 & Col2 & Col2 & Col3 \\ [0.5ex]
  58. \hline\hline
  59. 1 & 6 & 87837 & 787 \\
  60. 2 & 7 & 78 & 5415 \\
  61. 3 & 545 & 778 & 7507 \\
  62. 4 & 545 & 18744 & 7560 \\
  63. 5 & 88 & 788 & 6344 \\ [1ex]
  64. \hline
  65. \end{tabular}
  66. \caption{Table to test captions and labels}
  67. \label{table:1}
  68. \end{table}
  69.  
  70. \end{document}

User avatar
Ijon Tichy
Posts: 35
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Jun 05, 2019 8:13 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
  1. \begin{table}
  2. \caption{\label{table:1}Table to test captions and labels}
  3. \centering
  4. \fbox{%
  5. \begin{tabular}{c c c c}
  6. \hline
  7. Col1 & Col2 & Col2 & Col3 \\ [0.5ex]
  8. \hline\hline
  9. 1 & 6 & 87837 & 787 \\
  10. 2 & 7 & 78 & 5415 \\
  11. 3 & 545 & 778 & 7507 \\
  12. 4 & 545 & 18744 & 7560 \\
  13. 5 & 88 & 788 & 6344 \\ [1ex]
  14. \hline
  15. \end{tabular}}
  16. \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. ;)


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests