2

could anyone tell me why the subfigure can't generate space between the words, they are all linked together?

\begin{figure}[htb!]
  \centering
  \subfigure[\label{fig:beamFRFdr(a)}$Original  stiffness  distribtution$]
   {\includegraphics[width=0.45\textwidth, height=0.2\textheight]{Kdr.eps}}
  \subfigure[\label{fig:beamFRFdr(b)}$Corresponding  FRF $]
   {\includegraphics[width=0.45\textwidth, height=0.2\textheight]{FRFdr.eps}}
  \caption{\label{fig:beamFRFdr} degradation  Distribution  Identified  by  Original  Algorithm  and the  Corresponding  FRF. }
\end{figure}

enter image description here

Zarko
  • 296,517
CuteQi
  • 23
  • 6
    Welcome to TeX.SE! Dollar signs switch to math mode, so $Original stiffness distribution$ is interpreted as a math formula, hence the missing spaces. Remove the $. – campa Feb 28 '23 at 13:00
  • Welcome. // Please make it a habit to present code, which we can copy and compile. Please test it yourself, your snippet won't compile. Thanks – MS-SPO Feb 28 '23 at 13:06
  • 1
    In addition to the comment above: in math mode words are treated as series of variables. If you use $\text{sentence}$ the words in the sentence are set as an ordinary words and spaces. But why are you setting the subcaptions in math mode anyway? They don't contain math .. – alchemist Feb 28 '23 at 13:10
  • 3
    I’m voting to close this question because it was solved in the comments. – José Carlos Santos Feb 28 '23 at 13:26
  • 3
    I disagree with closing question. Comments doesn't complete solve OP problems. As (s)he is novice on site, (s)he probably is not aware with other possible issues of provided code fragment. – Zarko Feb 28 '23 at 14:08
  • I was stupid, just copied the template from others and did not figure out the all functions, thanks. – CuteQi Mar 02 '23 at 09:31

1 Answers1

6

I guess that you after the following (but I may be wrong):

enter image description here

  • From code fragment can be concluded, that you use obsolete package subfigure.
  • Instead of it rather use subfig or even better subcaption package. - Both packages define subfloat environment with similar functionality as has subfigure.
  • If you like to have italic shape of subcaption text, accordingly define this at package. Using math environment for this is wrong.
  • For more possibilities to formating caption and subcaptions, please consult caption (and su8bcaption) package documentations.
\documentclass{article}
\usepackage{graphicx}
\usepackage[text font=it]{subcaption}

\begin{document} \begin{figure}[ht] \centering \setkeys{Gin}{width=0.45\textwidth, height=0.2\textheight} \subfloat[Original stiffness distribution \label{fig:beamFRFdr}]{\includegraphics{example-image-a}} \hfil \subfloat[Corresponding FRF \label{fig:beamFRFdr}]{\includegraphics{example-image-b}} \caption{Degradation Distribution Identified by Original Algorithm and the Corresponding FRF.} \label{fig:beamFRFdr} \end{figure} \end{document}

Zarko
  • 296,517
  • Thank you, for so a careful and detailed explanation, how to close this question? – CuteQi Mar 02 '23 at 09:33
  • @CuteQi, simple: just accept my answer (by clicking on the check mark at top left side of answer) :-) – Zarko Mar 02 '23 at 12:29