# [texhax] how to put endnote in caption

Paul Tremblay phthenry at iglou.com
Thu Feb 15 04:34:25 CET 2007

On Wed, 14 Feb 2007 20:47:15 -0500
Paul Tremblay <phthenry at iglou.com> wrote:

> I have a document with four tables. Each table has a caption. I need
> to put a endnote in the caption so that I can inform the reader the
> source of the table. However, the endnote package crashes when I try
> to make the end note part of the caption:
>
> \caption{Chain Store Growth in the Early Twentieth
> Century}\endnote{some source and so on.}
>
> Is there any way around this other than not including a caption at all
> and putting the caption outside of the table, and having to use
> Chain Store Growth..\endnote{some source}

I got this to work. In the preamble, I put the following:

\newcommand{\myCaption}[2]{\stepcounter{table}
\vskip3ex\centerline{\tablename{} \thetable{}:  {#1}{\endnote{#2}}}%
\ignorespaces {#1}}
}

Then my table looks like this:

\begin{table}[h]
\center
\begin{tabular}{|p{1in}||p{1.5in}|p{1.5in}|}
\hline
{\bfseries Year} & {\bfseries Chain Store Companies} & {\bfseries Chain
Store Units}\tabularnewline \hline1900&25&226\tabularnewline\hline
1910&125&1,127\tabularnewline\hline
1920&553&15,568\tabularnewline\hline
1930&1478&69,534\tabularnewline\hline
\end{tabular}
\myCaption{Chain Store Growth in the Early Twentieth Century}{source}
\end{table}

Paul