0

I've been trying to make a centered figure in my document. It is rather wide and I want it at the top. I am using memoir and twocolumn. I've tried the \usepackage{multicols} before, but it introduced a lot more errors than my current setup. It works pretty nicely, but figures can be hard to get right. I've tried

\begin{figure}[t]
    \centering
    \includegraphics[width=0.9\textwidth]{attachments/xrdceo2.png}
    \caption{...}
    \label{fig:XRDCeO2}
\end{figure}

Which works, but it is not centered by any means (few pixels) and it gets worse the lower text width gets. Another method I tried were to use \makebox which worked until something were written in the next column as it were transparent.

\begin{figure}[t]
    \centering
    \makebox[\textwidth][c]{\includegraphics[width=0.9\textwidth]{attachments/xrdceo2.png}}
    \caption{Orthorhombric unit cell of tin selenide, \ce{SnSe}, at \SI{100}{K}.}
    \label{fig:XRD_CeO2}
\end{figure}

I've also been giving minipage a try, but without luck. Thanks in advance.

MWE:

\documentclass[11pt,openany,british,a4paper,twoside,twocolumn]{memoir}

\usepackage{graphicx} \usepackage{etoolbox} \usepackage{fancyhdr} \usepackage{lipsum}

\begin{document}

\lipsum

\begin{figure}[t] \centering \includegraphics[width=0.9\textwidth]{xrdceo2.png} \caption{...} \label{fig:XRDCeO2} \end{figure}

\lipsum

\end{document}

XRDCeO2

  • 1
    Have you tried using a starred figure environment i.e. \begin{figure*}...\end{figure*}? See also https://tex.stackexchange.com/questions/3173/ – imnothere Oct 31 '22 at 08:09
  • Please always provide a full but minimal example and please use images that others have access to for example those provided by the mwe package, https://ctan.org/tex-archive/macros/latex/contrib/mwe. – daleif Oct 31 '22 at 08:13
  • @imnothere I've tried to use the figure*environment, but it forces it to use the next unused page instead. @daleif Sorry! It should hopefully be updated and okay. – JonasDenmark Oct 31 '22 at 08:23
  • 2
    That is generally the case with two column envs, you cannot span both columns on the current page. It always comes on the next. There might be some package hacks that can alter some of this, but often it is not worth it. Just loose the mentality of always wanting the image to be right here. – daleif Oct 31 '22 at 08:45
  • The traditional solution is to add the figure* earlier in the document, although that sometimes interferes with other figures. – John Kormylo Oct 31 '22 at 13:11
  • See also https://tex.stackexchange.com/questions/499556/order-of-figure-and-figure-figure-either-goes-to-next-page-or-order-reversed and https://tex.stackexchange.com/questions/663365/how-to-place-caption-centered-under-a-table/663377?r=SearchResults&s=1%7C0.0000#663377 – John Kormylo Oct 31 '22 at 13:20

0 Answers0