0

This question already has an answer here:

So I'm trying to format my paper for submission, and the style file for JRSS-b (statsoc.sty) seems to be badly mungling tables. Here is a simple example;

\documentclass{statsoc}
\usepackage[a4paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath,amssymb}

\title[Short title]{Statistics Journal Style Guide}
\author[Author 1 {\it et al.}]{Author}
\address{Affiliation, City, Country.}
\email{Author@emailaddress.com}


\begin{document}

\begin{abstract}
\end{abstract}
\subsection{Sample title}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.



\begin{table}
\caption{\label{tab01}A table as an example}
\centering
\fbox{%
\begin{tabular}{*{10}{c}}
\em a&\em b&\em c&\em da&\em b&\em c&\em da&\em b&\em c&\em d\\
\hline
a&b&c&da&b&c&da&b&c&d\\
a&b&c&da&b&c&da&b&c&d\\
a&b&c&da&b&c&da&b&c&d\\
a&b&c&da&b&c&da&b&c&d\\
\end{tabular}}
\end{table}

\end{document}

Which compiles to

enter image description here

The caption is way to the left and the table outside the bounds to the right, whereas they should both be centered

marked as duplicate by egreg captions Mar 2 '18 at 18:26

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.

  • I do not have this problem, but I had to compile several times. – Bernard Mar 1 '18 at 23:20
  • huh,... So it looks like the issue is reproducible on sharelatex.com with or without the patch from that question. When I run it with my local distribution however, it works fine with or without the patch. – Ian Fellows Mar 1 '18 at 23:45
0

As egreg's linked issue suggested, applying the following patch and clearing the aux files solved the issue.

\usepackage{etoolbox}

\makeatletter
\patchcmd{\@makecaption}
  {\parbox}
  {\advance\@tempdima-\fontdimen2\font\parbox} % decrease the width!
  {}{}
\makeatother 

On sharelatex the aux files can be removed by clearing the cache.

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