1

I've recently used Lyx to put together a bioRxiv preprint. I ended up using the IEEE Transactions document style and it came very close to looking the way I wanted, except for the styling of table captions. I'd like the table captions to look the same way as figure captions.

Here's my preamble:

\usepackage[numbers,sort&compress,super]{natbib}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{url}
\usepackage{amsmath}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makecaption}
  {\scshape}
  {}
  {}
  {}
\makeatother
\renewcommand{\thetable}{\arabic{table}}

Here's what my figure captions look like:

figure caption

And here's what the table captions look like:

enter image description here

Specific changes that these table captions need are:

  • Justified instead of centered.
  • Have a full stop after "Table x".
  • Start right after "Table x." instead of in a new line.

How can I make this happen?

Thanks!

2
  • 1
    Welcome to TeX SX! Do you want the caption to be full line wide or only the width of the table (in case the table would not be line wide)?
    – Bernard
    Aug 12, 2016 at 0:56
  • Hi Bernard, and thanks! In this case whether it's one column or two columns is easily handled in Lyx - I meant only the overall styling, i.e. the three remaining points that I mentioned in my post. I'll put in a full width table caption instead for consistency.
    – pharmhax
    Aug 12, 2016 at 15:46

2 Answers 2

1

Document >

Settings ... >

LaTeX Preamble >

Write \usepackage[labelsep=period]{caption}

OK or Apply

2
  • Perfect, that did it! It reset the caption size, though... overall the following entries to the preamble made the captions exactly the way I wanted them to be:\renewcommand{\thetable}{\arabic{table}} \usepackage[labelsep=period]{caption} \usepackage[font=footnotesize]{caption}
    – pharmhax
    Aug 13, 2016 at 16:55
  • @pharmhax Do not load the caption package twice. You can write several options in the same command (i.e., \usepackage[labelsep=period, font=footnotesize]{caption}) or add more options later with \captionsetup{} .
    – Fran
    Aug 13, 2016 at 19:01
0

I do not know your specific application, but I don't think it's a good idea to include captions as verbose as your examples. In general, it is best practice to have a short caption and include details as a note below the figure. The latter can be accomplished in LyX by entering the detailed notes below the figure and adjusting the justification as you prefer.

In raw TeX code, this would be accomplished with:

    \begin{figure}
    \caption{Sample figure}
    \begin{centering}
    \includegraphics{sample_image.eps}
    \par\end{centering}

    Notes: Figure notes go here.
    \end{figure}

If you want to adjust the width of the caption, see here.

2
  • Thanks for your response. I meant table styling rather than figure styling, though. Your example could probably be adapted to tables, but I'd like to have a definition in the LyX preamble so that I don't have to use custom TeX every time I need a table. I don't think one can simply change paragraph settings in table captions - I've just checked and it's greyed out, as in the following screenshot: imgur.com/a/T1KL4
    – pharmhax
    Aug 12, 2016 at 17:10
  • Sorry; I missed the fact that you wanted a table instead of a figure. For table notes, I recommend using the threeparttable package. I don't think LyX supports it natively, however. The advantage of this package is that it will allow you to insert table notes that will only go the width of the table, not the width of the float. Furthermore, you can format the table notes text however you want.
    – Tyler R.
    Aug 14, 2016 at 1:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .