Graphics, Figures & TablesDisplaying figure source under caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
squidgy_wiji
Posts: 8
Joined: Sun Aug 09, 2009 3:29 am

Displaying figure source under caption

Post by squidgy_wiji »

Hey i've tried searching on google and this forum and i havent been able to find the answer to this question.

When I insert a figure I want to name the source of the figure under the figure caption. Is there anyway to do this instead of just naming the source in the caption. Prefferably in a different font to the font in the caption.

I would appreciate any help

Thanks

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Displaying figure source under caption

Post by gmedina »

Hi,

for the source, you can use the \caption* command provided by the caption package (make sure that you are using a recent version of the package). Take a look at the following example:

Code: Select all

\documentclass{book}
\usepackage{caption}

\begin{document}

\begin{figure}[!ht]
  \centering
  \rule{4cm}{3cm}% to simulate an actual figure
  \caption{a test figure}
  \label{tab:test}
  \captionsetup{font={footnotesize,bf,it}}
  \caption*{the source of the figure}
\end{figure}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
squidgy_wiji
Posts: 8
Joined: Sun Aug 09, 2009 3:29 am

Re: Displaying figure source under caption

Post by squidgy_wiji »

Thank you very much for that. I've been looking everywhere to figure this one out.

Cheers
romanwarlock
Posts: 1
Joined: Fri Nov 19, 2010 9:48 am

Displaying figure source under caption

Post by romanwarlock »

Code: Select all

...
\newenvironment{figuree}[1]{
  \begin{figure}
    \includegraphics{#1}
    \def\catext{#1}
    \def\latext{fig:#1}
    \caption{\catext}
    \label{\latext}
  }{
  \end{figure}
...
\begin{document}
...
\begin{figuree}{<picture_source>}\end{figuree}
...
\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Displaying figure source under caption

Post by gmedina »

Hi,
romanwarlock wrote:

Code: Select all

...
\newenvironment{figuree}[1]{
  \begin{figure}
    \includegraphics{#1}
    \def\catext{#1}
    \def\latext{fig:#1}
    \caption{\catext}
    \label{\latext}
  }{
  \end{figure}
...
\begin{document}
...
\begin{figuree}{<picture_source>}\end{figuree}
...
\end{document}
Your code has an obvious typo: there's a missing closing brace right after \end{figure}. Besides, the code does not solve the original problem at all.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply