0

I would like to put my big figure in front of the text.

But when I run the code, the figure is forced into the back.

Here is the figure:

enter image description here

Here is the code:

    \documentclass{report}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx} % Required for inserting images
    \usepackage{setspace}% for\doublespacing
    \usepackage{indentfirst}% for indent the first line
    \usepackage{longtable}
    \usepackage{textalpha} 
    \usepackage{ragged2e}
     \usepackage[T1]{fontenc} % <-- new
    \usepackage{xltabular} 
    \usepackage{amsmath}
    \begin{document}  
    \begin{figure}[ht]
   \centering
   \includegraphics{BehaviorOutcome.jpg}

\caption{ Overview of behavioral and corticosterone results at short-term and long-term follow-up.A-E. Behavior tests after stress paradigm. A. The Sociability Interaction ratio (SIR) in Social interaction test for LT and ST cohorts. B. The sociability ratio (Soc score) in Sociability test for both LT and ST cohorts. In the ST cohort, the Social Defeat (SD) group spent significantly more time with a social target than the control. C. The proportion of sucrose intake in the sucrose preference test (SuP) for LT and ST cohorts. In the LT cohort, the SD group had a significantly increased sucrose preference compared to their controls. D. Immobility time of the Forced Swim Test (FST) for LT and ST cohorts. In the LT cohort, the SD group spent less time immobile than control animals. Physical activity (PhA) increased immobility time in FST. In the ST cohort, the SD group spent more time immobile than their control. E. Elevated Zero Maze (EZM) test for LT and ST. F. Baseline, stress-induced, and recovery corticosterone (CORT) levels for LT and ST cohorts. baseline, stress-induced, and recovery CORT are different along with time. Red-colored bars represent data from the SD groups, and black bars represent data from non-SD groups. Full bars represent data from the PhA+ groups, and the dashed bars represent data from PhA- groups. Data presented as mean\textpm SEM. The asterisk indicates statistical significance, \textit{p} < .05 = , \textit{p} < .01 = *. } \label{Chapter/Figure/BehaviorOutcome.jpg}

\end{figure}

The present study aimed to i) investigate the short-term and long-term effects of SD on behavior, body weight, blood corticosterone levels and ii) test the hypothesis that enhancing physical activity (PhA+) before SD exposure would attenuate or prevent the effects of SD. Concerning the second aim, the overall results of this large, experimental study on male C57BL/6J mice do not support a robust protective effect of pre-exposure PhA on SD-induced behavioral and physiological changes. A direct comparison between short-term and long-term effects of SD (according to our first aim) was not possible due to differences in body weight as well as in body weight change over time, thus suggesting that the baseline characteristics of the mice belonging to the LT cohort were not directly comparable to those of the ST cohort. Besides, one should note that the adapted SD protocol used (with a reduced time of physical contact between the resident and the experimental in the social defeat protocol to prevent death by physical injury) may have impacted the robustness of the impact of the exposure on behavioral and corticosterone levels of the study.

\end{document}

Annie
  • 93
  • 3
    [ht] will force large figures to the end, always include p, [htp] – David Carlisle Jul 29 '23 at 18:26
  • Especially https://tex.stackexchange.com/a/8631/107497, which begins "do not use a floating environment if you do not want it float." – Teepeemm Jul 29 '23 at 18:33
  • The main question si how big is BehaviorOutcome.jpg? You could add [width=\textwidth, height=0.7\textheight, keepaspectratio] to \includegraphics. – John Kormylo Jul 29 '23 at 21:08

1 Answers1

0

The placeins package provides a \FloatBarrier command that you can use to force the printing of all remaining floats like figures and tables. In general, you should only use this command as a last resort, since LaTeX usually solves the typesetting very well.

mab0189
  • 175