Graphics, Figures & TablesCentering equations in captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jediwhelan
Posts: 16
Joined: Fri Jul 25, 2008 5:54 pm

Centering equations in captions

Post by jediwhelan »

Hi,

For the life of me, I can't work out how to center equations within caption. \begin{equation ... \end{equation can't be used within \caption, and I've experimented with various methods/workarounds but to no avail. No amount of googling has helped either.

For example:

\caption{Regression of blah blah blah etc etc etc :

$rx_{t,t+12}^{(n)} = \phi^{(n)} X_t + \gamma^{(n)} Y_t + \rho^{(n)} Z_t + \varepsilon_{t+12}^{(n)}$

where $X_t$ is constructed from blah blah , $Y_t$ is a blah blah. Etc etc etc ... description of the table.}

There must be a simple solution?
Last edited by jediwhelan on Tue Oct 26, 2010 6:39 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Centering equations in captions

Post by sommerfee »

jediwhelan wrote:\begin{equation ... \end{equation can't be used within \caption
It can with a little help from the caption package:

Code: Select all

\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{figure}
\captionsetup{singlelinecheck=off}
\caption[Regression of blah blah blah etc etc etc]
{Regression of blah blah blah etc etc etc :

\begin{equation}
rx_{t,t+12}^{(n)} = \phi^{(n)} X_t + \gamma^{(n)} Y_t + \rho^{(n)} Z_t + \varepsilon_{t+12}^{(n)}
\end{equation}

where $X_t$ is constructed from blah blah , $Y_t$ is a blah blah. Etc etc etc ... description of the table.}
\end{figure}
\end{document}
(See also section 3.1 in the caption package manual)
jediwhelan
Posts: 16
Joined: Fri Jul 25, 2008 5:54 pm

Re: Centering equations in captions

Post by jediwhelan »

Fantastic!
Post Reply