3

I am using the jfm document class, and I tried to use a placement specifier to adjust my figure as follows.

\begin{figure}[ht]

\centerline{\includegraphics[scale=0.11]{figure3.eps}}

\caption{Averaged streamwise velocity field of (a) 0.2$\delta$ case and (b) 0.4$\delta$ case, normalized by \emph{U}$_\infty$=0.508 m s$^{-1}$. Blue is slow, white is fast.}

\label{fig:48d}

\end{figure}

However, the [ht] keeps showing up in the printed pdf right in front of the figure.

enter image description here

Could anyone tell me why this is happening?? Thanks! ;D

  • 3
    Welcome to TeX.sx! Are you using a special document class? Can you complete your code into a minimal working example (MWE) that let's us reproduce the issue? – cgnieder Jun 12 '13 at 9:54
  • I tried your code but was not able to reproduce it! does it work with other Editors? BTW. you should definitely improve your $U_\infty$ Term :) – Rico Jun 12 '13 at 10:43
  • 1
    You probably have some wrong redefinition of the figure environment. Without more information it's impossible to say more. By the way, your formula should be written $U_\infty=\SI{0.508}{m.s^{-1}}$ (requires the siunitx package). – egreg Jun 12 '13 at 10:46
  • Thanks for egreg's great adcive on the siunitx package!!! :D – rockayu Jun 12 '13 at 11:22
  • 2
    You generally shouldn't it is the choice made by the Journal. Sadly many journal classes makes choices that does not comply to what users expect. I'd suggest writing them as suggesting that they support the [] option but when used issue a warning to the user that the placements are ignoted in this class. – daleif Jun 12 '13 at 13:30
1

The figure environment in the jfm document class does not appear to accept optional positioning arguments. If you include them, they end up typeset as part of the figure.

\documentclass{jfm}
\begin{document}
\begin{figure}[ht]
\rule{4cm}{4cm}
\end{figure}
\end{document}

figure

An old set of guidelines for jfm.cls said the following.

The JFM class will cope with most figure positioning problems and you should not normally use the optional positional qualifiers 't', 'b', 'h' on the figure environment, as this would override these decisions.

The current version of the guidelines doesn't appear to mention this, but it is noticeable that none of the figures in jfm-instructions.tex uses optional positioning arguments. Therefore it is probably best to avoid them.

0

Avoid using centerline, use \centering instead. E.g:

\begin{figure}[ht]
\centering
\includegraphics[scale=0.11]{figure3.eps}
\caption{Averaged streamwise velocity field of (a) 0.2$\delta$ case and (b) 0.4$\delta$ case, normalized by \emph{U}$_\infty$=0.508 m s$^{-1}$. Blue is slow, white is fast.}
\label{fig:48d}
\end{figure}

As an extra advise: If you are using subfigures, you could try using the subcaption package, which will give you something like this:

enter image description here

Code:

\documentclass[12pt,a4paper]{article}

\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
    \begin{subfigure}[b]{2.5in}
        \centering
            \includegraphics[scale=1]{demo}
            \caption{Skeletal}
        \label{fig:SkeletalTissue}
    \end{subfigure}
    \begin{subfigure}[b]{2.5in}
        \centering
            \includegraphics[scale=1]{demo}
            \caption{Cardiac}
        \label{fig:CardiacTissue}
    \end{subfigure}
    \caption{Types of Muscular Tissue}
    \label{fig:MuscularTissue}
\end{figure}

\end{document}
  • This is good advice, but it doesn't seem to be connected to the question. – egreg Jun 12 '13 at 10:45
  • It's just because I saw the OP code for the figure... and I saw there actually are two. – Mario S. E. Jun 12 '13 at 10:47
0

This may be too late. I started writing my paper and stumbled upon the same problem. I have to admit that I am a little obsessed about figure positioning and cannot just let it go thinking that the journal will fix it. Many of us would also like to post it on places like arxiv and it is important to have the figure corret. So here is a solution:

  1. Open the jfm.cls file.

  2. Line 1046 has the jfm figure definition. Simply comment it and put the following above it:

     \newcounter{figure}
     \renewcommand \thefigure {\@arabic\c@figure}
     \def\fps@figure{tbp}
     \def\ftype@figure{1}
     \def\ext@figure{lof}
     \newcommand\figurename{Figure}
     \def\fnum@figure{\figurename~\thefigure}
     \newenvironment{figure}
     {\@float{figure}}
     {\end@float}
    
  3. Finally line 1101 to 1110.

  4. Use the float package in your .tex file and use [H] for figure positioning. Works fine for me!

Hope this helps!

  • Do you include the modified jfm.cls with your submission? I'd imagine they're going to ignore it, so this is perhaps specific to submissions of a paper to somewhere other than the Journal of Fluid Mechanics, right? Also, why edit the .cls and not just add the updated code to your document preamble? – Werner Aug 17 '17 at 20:13
  • I guess editing a .cls file is a question of taste. Nothing else. You are right you can get away with adding it to preamble. I have not submitted the paper yet. I was planning to include the modified .cls file. However you are right that they may ignore it. If you still want the JFM tex format and put the same file on arxiv or somewhere else then it is helpful. – Brato Aug 17 '17 at 21:31

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.