5

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

\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). – jub0bs 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
7

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:

enter image description here

| improve this answer | |
  • Your code doesn't seem to match your screenshot: \mathcal{F}^{-\infty}? – jub0bs 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
7

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.

enter image description here

\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}
| improve this answer | |
  • 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. – jub0bs Apr 8 '13 at 12:19
  • 1
    I'm rather fussy about \left and \right, you know. ;-) – egreg Apr 8 '13 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.