0

How can I modify the code that all words in the same line , i.e. u=0.3230mm in the same line

\begin{figure}[h]
        \centering
        \subfloat[$u = 0.3230 mm$  ]
.....
\end{figure}[h]

enter image description here

thanks a lot in advance!

  • Without a complete MWE hard to tell but chances are that there is not enough space for the text. – marmot Mar 4 at 2:19
  • @marmot ,i thinks how to solve space problem, i need beautiful results ... – ABCDEMMM Mar 4 at 2:26
  • 1
    And we need an MWE to be able to help you to get a beautiful result. – marmot Mar 4 at 2:42
  • It looks like the width of each subfigure is too narrow to accommodate the text of its caption in one line. If you can make the subfigures a bit wider, the problem should go away. – barbara beeton Mar 4 at 3:13
  • 1
    If the width of the subfigures can't be increased, some other possibilities are to (1) make the font of the caption smaller, (2) omit the identifying letter, or (3) increase the allowed width of the caption. Any of those might require patching the package you're using, but you haven't identified the package. Or, if you put braces around the [=] that will reduce the space, but there may still not be enough space. – barbara beeton Mar 4 at 3:22
2

the following mwe:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{siunitx}

\begin{document}
    \begin{figure}[htb]
\subfloat[$u = \SI{0.3230}{mm}$]{\includegraphics[width=0.24\linewidth]{example-image-duck}}
\hfill
\subfloat[$u = \SI{0.3392}{mm}$]{\includegraphics[width=0.24\linewidth]{example-image-duck}}
\hfill
\subfloat[$u = \SI{0.3781}{mm}$]{\includegraphics[width=0.24\linewidth]{example-image-duck}}
\hfill
\subfloat[$u = \SI{0.4541}{mm}$]{\includegraphics[width=0.24\linewidth]{example-image-duck}}
    \caption{Figures \dots}
\end{figure}
\end{document}

gives:

enter image description here

however, you not provide any information about your document layout (consequently we dot know what is your problem), so we don't know, if in your document you will obtain the same result ...

  • I would have used \makebox[0.24\linewidth]{...} with smaller images. – John Kormylo Mar 4 at 18:21
  • @JohnKormylo, why? you mean in case, when natural width of images are smaller than 0.24\linewidth?. – Zarko Mar 4 at 18:56
  • Yup, since that is the case with the Mystery Wonder Example. – John Kormylo Mar 4 at 21:49
  • @Zarko why I have to use \usepackage{siunitx}? – ABCDEMMM Mar 6 at 0:06
  • @JohnKormylo I don't want to change figure size .......... – ABCDEMMM Mar 6 at 0:07

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.