2

I am writing an article using the aa document class.

I include two column figures using the figure* macro.

Sometimes, this results in one or two figures being placed on a page with no other text. They are aligned to the top of the page.

Is it possible to vertically align all standalone figures (even if there is more than one on a page) to the center of the page?

MWE: https://www.overleaf.com/read/mxwkbphjwcpk

Contents of link:

\documentclass{aa}  

\usepackage{color}
\usepackage{xcolor}
\definecolor{xlinkcolor}{cmyk}{1,1,0,0}

\usepackage{graphicx} 
\usepackage[varg]{txfonts} 

\usepackage[activate={true,nocompatibility},
    final,
    tracking=true,
    kerning=true,
    spacing=true,
    factor=1100,
    stretch=10,
    shrink=10]{microtype}

\usepackage[bookmarks=true,         % show bookmarks bar?
     bookmarksopen=true,
     pdfnewwindow=true,      % links in new window
     colorlinks=true,    % false: boxed links; true: colored links
     linkcolor=xlinkcolor,     % color of internal links
     citecolor=xlinkcolor,     % color of links to bibliography
     filecolor=xlinkcolor,  % color of file links
     urlcolor=xlinkcolor,      % color of external links
     final=true]{hyperref} 
\hypersetup{pdfstartview=Fit}
\usepackage{bookmark}

\usepackage{longtable}

\usepackage{adjustbox}
\allowdisplaybreaks

\usepackage[labelfont=bf]{caption}

\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{\errmessage{\noexpand patch failed}}
\makeatother

\makeatletter
\renewcommand*\aa@pageof{, page \thepage{} of \pageref*{LastPage}}
\makeatother

\usepackage{afterpage}

\usepackage{lipsum}

\begin{document} 

   \title{Float placement MWE} 
   \titlerunning{MWE} 

   \author{A.\ P.\ Erson\inst{1}}

   \institute{Space Elevator Institute \\
              \email{\url{[email protected]}}}

   \date{Received \today}

   \abstract{}{\lipsum[1]}{\lipsum[2]}{\lipsum[3]}{}

   \keywords{}

   \maketitle
%
%________________________________________________________________

\section{Introduction} 
\lipsum[4-8]

\begin{figure*}[p]
    \centering
    \includegraphics[width=0.5\textwidth]{universe.jpg}
    \caption{The Andromeda Galaxy.}
\end{figure*}

\end{document}
0

2 Answers 2

0

Probably using a placement statement in your figure environment https://en.m.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#placement

\begin{figure*}[p]
  \includegraphics...
\end{figure*}

Could you post a MWE? You could put a bunch of stuff within the figure* environment that will affect vertical spacing.

3
  • I have added a MWE (which shows that this does not solve the problem) Oct 3, 2018 at 11:53
  • where you added mwe? i don't see anything like this in your question! link is not reliable and after while it will be dead, so other people will not be able to test your mwe.
    – Zarko
    Oct 3, 2018 at 12:39
  • @Zarko I have added the contents of the link to the post Oct 3, 2018 at 15:03
0

The aa class has

\setlength{\@fptop}{0pt}

whereas the value set in the LaTeX kernel (and unmodified in the standard classes) is

\setlength\@fptop{0pt plus 1fil}
\setlength\@fpsep{8pt plus 2fil}
\setlength\@fpbot{0pt plus 1fil}

When LaTeX is building a page of floats, it uses \@fptop glue at the top, \@fpsep glue between two floats and \@fpbot glue at the bottom.

With the setting done by the class aa, there is no stretchable glue at the top, but the stretchability remains at the bottom, resulting in top aligned float pages.

Since this is set by the class, you should not change it; if you are required to use the class for a submission, do as the editors want. Don't use the class for your personal papers. If you want to risk rejection of your paper, add

\makeatletter
\setlength\@fptop{0pt plus 1fil}
\makeatother

By the way, the patch to \@combinedblfloats is no longer necessary, because the current LaTeX kernel does have \unvbox\@outputbox since 2018. Also, the caption package is not compatible with the aa class.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .