Graphics, Figures & Tablesarray within caption environment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sohail
Posts: 2
Joined: Thu May 21, 2009 12:33 pm

array within caption environment

Post by sohail »

Hi,
I am trying to put an array within a figure caption but it gives error message
Argument of \@caption has an extra }.

Can anyone help, please.
Sohail

Recommended reading 2024:

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

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

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

Re: array within caption environment

Post by sommerfee »

See http://tug.ctan.org/get/macros/latex/co ... on-eng.pdf , appendix A.4 "Errors"

HTH,
Axel
sohail
Posts: 2
Joined: Thu May 21, 2009 12:33 pm

Re: array within caption environment

Post by sohail »

Thanks a lot. I think the answer to my question is in your refered link but I am just struggling with the document you refered. Can you tell me more precisely as I am a new latex user?

sohail
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

array within caption environment

Post by Juanjo »

This causes an error:

Code: Select all

\caption{A matrix here: $\begin{array}{lr} a & b \\ c & d \end{array}$}
This avoids the error:

Code: Select all

\caption[Text excluding the matrix]{A matrix here: $\begin{array}{lr} a & b \\ c & d \end{array}$}
The text in the optional argument will go to the List of Figures.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply