3

I am using \floatfoot to creates notes for a figure in a paper. I would like to include an equation in the notes for this figure. Specifically, I am trying to use the following code:

\floatfoot{Notes: The figure shows coefficients from the following specification:
$$ y = \alpha + \beta X $$
where $y$ is an outcome.}

When I compile this code, the PDF looks correct, although I get several errors in TeXnicCenter. I get errors like,

! Missing $ Inserted

where there are clearly no issues with a missing $ in the above code.

I was wondering if anyone has any recommendations to avoid getting these errors in TeXnicCenter. I've also tried to use the align and equation environments in the \floatfoot command and this generates different (but obviously still problematic) errors.

2
  • Well, you shouldn't use $$ ... $$ anyway (see e.g. Why is \[ ... \] preferable to $$ ... $$?). Using inline math isn't an option? I.e. $ y = \alpha + \beta X $. Commented Feb 12, 2015 at 7:41
  • The problem with inline math $ y = \alpha + \beta X $ is that the text looks pretty cluttered at that point. My equation is actually a good amount longer than my example illustrates. The entire equation takes up more than a line by itself. So, I wanted to use something like \begin{equation} to set off the text by indenting, etc.
    – Eric
    Commented Feb 12, 2015 at 7:59

1 Answer 1

1

You can hide the equation in a \parbox or put the whole \floatfoot contents in a minipage as follows:

Sample output

\documentclass{article}

\usepackage{floatrow}

\begin{document}

\begin{figure}
\floatbox{figure}{\caption{Caption}}
  {\rule{2cm}{2cm}
  \floatfoot{Notes: The figure shows coefficients from the following
  specification:\endgraf
  \parbox{\linewidth}{%
  \begin{displaymath}
    y = \alpha + \beta X 
    \end{displaymath}}\endgraf
  where $y$ is an outcome.}}
\end{figure}

\begin{figure}
\floatbox{figure}{\caption{Caption}}
  {\rule{2cm}{2cm}
  \floatfoot{%
  \begin{minipage}{1.0\linewidth}
    Notes: The figure shows coefficients from the following
    specification:
  \begin{displaymath}
    y = \alpha + \beta X 
  \end{displaymath}
  where $y$ is an outcome.
\end{minipage}%
}}
\end{figure}

\end{document}

You must log in to answer this question.

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