Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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} –  sherif Haggag Apr 8 '13 at 10:38
    
no i download it from the internet –  sherif Haggag 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
add comment

2 Answers

up vote 6 down vote accepted

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

share|improve this answer
    
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
add comment

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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