# Typesetting a Fourier-transform expression (in a figure caption)

I tried to add the fourier function in the figure caption but i failed, any help?

\begin{figure}[h]
\centering
\subfloat{\includegraphics[width=\linewidth]{Data/DFT.png}}\label{pic9}
\caption{DFT of a signal \mathcal "here" }
\end{figure}

-
Which error do you get? – Eddy_Em Apr 8 '13 at 10:22
This is the code and i need to put the left equation in the caption in the place which i write "here" in the code \begin{figure}[h] \centering \subfloat{\includegraphics[width=\linewidth]{Data/DFT.png}}\label{pic9} \caption{DFT of a signal \mathcal "here" } \end{figure} – SMH Apr 8 '13 at 10:38
no i download it from the internet – SMH Apr 8 '13 at 10:41
A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Jubobs Apr 8 '13 at 10:41
don't use [h] as it makes it very hard for latex to find a good place for the float as it prevents all the usual places. use [htp] or no option at all. – David Carlisle Apr 8 '13 at 11:09

You need no \subfloat. Just typeset that equation in the  in \caption command.

Code:

\documentclass[varwidth]{standalone}

\usepackage[draft]{graphicx}

\begin{document}
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{Data/DFT.png}\label{pic9}
\caption{DFT of a signal $\mathcal{F}^{-1}\{\log|\mathcal{F}\{x[n]\}|\}$}
\end{figure}
\end{document}


Result:

-
Your code doesn't seem to match your screenshot: \mathcal{F}^{-\infty}? – Jubobs Apr 8 '13 at 10:56
@Jubobs: Thanks, didn't notice. In the code there was \mathcal{F^{-1}} and it typeset -1 as -\infty. – m0nhawk Apr 8 '13 at 10:58

Your question has little to do with captions, more to do with typesetting mathematical expressions.

Note that you don't need a subfloat in this particular case, since your figure consists of only one element.

\documentclass{article}
\usepackage{amsmath}
\usepackage[demo]{graphicx}
\newcommand\F{\mathcal{F}}
\newcommand\abs[1]{\lvert #1 \rvert}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{Data/DFT.png}
\caption{DFT of a signal $\F^{-1} \{ \log \abs{\F \{ x[n]\}} \}$ \label{pic9}}
\end{figure}
\end{document}

-
Each usage here of \left and \right is wrong; there's no need to \protect a \label. – egreg Apr 8 '13 at 12:06
@egreg Sorry, I fixed it. I'll learn... one day. I don't know why I added a \protect there either. – Jubobs Apr 8 '13 at 12:19
I'm rather fussy about \left and \right, you know. ;-) – egreg Apr 8 '13 at 12:20