Graphics, Figures & Tablesapa6 | Manuscript Mode with the "floatsintext" Option

Information and discussion about graphics, figures & tables in LaTeX documents.
Saam
Posts: 7
Joined: Thu Nov 08, 2012 11:45 am

apa6 | Manuscript Mode with the "floatsintext" Option

Post by Saam »

Hello everyone,

This is my first post here. I am pretty new to LaTeX, but so far I am enjoying it. I am writing a document, which unlike manuscripts, requires to have figures and tables in the text rather than at the end. Here are the relevant(I think!) parts of the code:

Code: Select all

\documentclass[man,floatsintext,draftfirst]{apa6}
and

Code: Select all

\begin{figure}[ht]
	\fitfigure{figure.jpg}
	\caption{Experiment 1}
	\label{fig:trial}
\end{figure}
When I do not use floatsintext, the figure is placed after the bibliography, like a normal manuscript (man), but when I add it, it seems the only difference that it makes is putting it before the bibliography, but still after the whole document! I have tried adding and removing more text and moving the figure to different places but it does not seem to have any effect.

Could you please point to where I am making a mistake?

Thanks in advance.

-Saam

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

apa6 | Manuscript Mode with the "floatsintext" Option

Post by cgnieder »

Hi Saam,

Welcome to the LaTeX community!

The figure should appear near to where you placed it in the source possibly at the top of a page (that's what you allow with [ht]). It that is not the case please make a complete Infominimal working example (if you do not know what that is please follow the link) for us.

Regards
site moderator & package author
Saam
Posts: 7
Joined: Thu Nov 08, 2012 11:45 am

apa6 | Manuscript Mode with the "floatsintext" Option

Post by Saam »

cgnieder wrote:Hi Saam,

Welcome to the LaTeX community!

The figure should appear near to where you placed it in the source possibly at the top of a page (that's what you allow with [ht]). It that is not the case please make a complete Infominimal working example (if you do not know what that is please follow the link) for us.

Regards
Thanks for the warm welcome and also the reply!

I played around with the figure itself and found out that as long as the figure does not occupy a whole page, everything is fine and it is placed close enough to where it has been mentioned. But, if I change the aspect ratio and resize it so it needs a whole page, then it is moved to the end of the document! I replaced \fitfigure with \includegraphics and the behaviour did not change.

Finally, I put a \newpage before the figure and it worked! So, apparently, there is some sort of bug in here. The auto-placement mechanism works until figures are too large that they need a separate page, where it fails and puts them at the end of the document.

Does that make sense? or this has been a known thing?
Last edited by cgnieder on Fri Nov 09, 2012 11:47 am, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

apa6 | Manuscript Mode with the "floatsintext" Option

Post by cgnieder »

As I said before: a more concrete example would be helpful. But maybe Frank Mittelbach's great post about LaTeX floats can help you to understand why floating works the way it does and how you can influence it.

Regards
site moderator & package author
rophys
Posts: 2
Joined: Fri Nov 09, 2012 9:58 pm

apa6 | Manuscript Mode with the "floatsintext" Option

Post by rophys »

Hello all,

I'm trying to put some figures in the right places in text but is not working.

I'm using the following packages:

Code: Select all

\usepackage{graphicx}
\usepackage{natbib}
\usepackage{float}
\usepackage{varioref}
\usepackage{wrapfig}
\usepackage{dcolumn}
\usepackage{subfigure}
\usepackage{subfigmat}
\usepackage{fancyvrb}
\usepackage{floatrow}
When I compiled the text, the figure is not going to the right position and also is appearing the symbol [t!] close to the figure. I've tried everything =/

This is the code I'm using to place the figure :

Code: Select all

\begin{figure}[t!]
\begin{center}
\includegraphics[keepaspectratio,width=13cm]{./figures/introduction/fig.eps}
\end{center}
\caption{}
\label{fig}
\end{figure} 
Many thanks
Last edited by cgnieder on Sat Nov 10, 2012 11:33 am, edited 1 time in total.
Saam
Posts: 7
Joined: Thu Nov 08, 2012 11:45 am

apa6 | Manuscript Mode with the "floatsintext" Option

Post by Saam »

cgnieder wrote:As I said before: a more concrete example would be helpful. But maybe Frank Mittelbach's great post about LaTeX floats can help you to understand why floating works the way it does and how you can influence it.

Regards
Thanks Clemens for the link - it was extremely helpful. I have made a MWE which is attached to this post. Obviously \rule did not work instead of figures as you need actual figures to see the behaviour. I am also attaching a simple JPG figure.

Thanks again.

-Saam
Saam
Posts: 7
Joined: Thu Nov 08, 2012 11:45 am

apa6 | Manuscript Mode with the "floatsintext" Option

Post by Saam »

Saam wrote: Thanks Clemens for the link - it was extremely helpful. I have made a MWE which is attached to this post. Obviously \rule did not work instead of figures as you need actual figures to see the behaviour. I am also attaching a simple JPG figure.

Thanks again.

-Saam
Sorry, forgot to attach them!
Attachments
sample.jpg
sample.jpg (13.4 KiB) Viewed 9724 times
sample.tex
(3.78 KiB) Downloaded 476 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

apa6 | Manuscript Mode with the "floatsintext" Option

Post by cgnieder »

@rophys: Are you also using the apa6 class? If not I'd be tempted to move your question to a separate topic. Best regards.

@Saam: The behaviour looks expected to me. If you need the figure nearer to where you put it in the source you can add ! to the float specifier:

Code: Select all

\begin{figure}[!ht]
  \centering
  \fitfigure{sample.jpg}
  \caption{The first figure's caption}
  \label{fig:sample}
\end{figure}
Another question: do you need to use \fitfigure? You could also use \includegraphics

Code: Select all

\begin{figure}[ht]
  \centering
  \includegraphics{sample.jpg}
  \caption{The first figure's caption}
  \label{fig:sample}
\end{figure}
Regards
site moderator & package author
Saam
Posts: 7
Joined: Thu Nov 08, 2012 11:45 am

apa6 | Manuscript Mode with the "floatsintext" Option

Post by Saam »

cgnieder wrote: The behaviour looks expected to me. If you need the figure nearer to where you put it in the source you can add ! to the float specifier:

Code: Select all

\begin{figure}[!ht]
  \centering
  \fitfigure{sample.jpg}
  \caption{The first figure's caption}
  \label{fig:sample}
\end{figure}
Wonderful! It worked! I must have missed that bit of the documentation! Thanks a lot Celemens! Certainly a much better solution than using a \newpage before the figure.
cgnieder wrote: Another question: do you need to use \fitfigure? You could also use \includegraphics
The apa6 class documentation recommends using \fitfigure instead of \includegraphics, however, I even tried different varieties of \includegraphics, but it still resulted in the same behaviour.

It was a great help. Thanks again!

-Saam
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

apa6 | Manuscript Mode with the "floatsintext" Option

Post by cgnieder »

As far as I can see it \fitfigure scales the images to fit a whole page. This might not always be what one wants. Also, this can be the reason for putting the float to another position in the text.

However, if things are working for you now: never mind.

Regards
site moderator & package author
Post Reply