I'm trying to split an image and its caption across two minipages, but the caption is running into the right margin of the page:

\documentclass[a4paper, 12pt]{article}

\usepackage[margin=2cm, left=2cm, top = 2cm, bottom=2cm]{geometry}
\usepackage{amsmath, mathtools}





\captionsetup{font={normalfont},labelfont=footnotesize, width=.6\textwidth}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\newcommand\cjaa{Chinese Journal of Astronomy \& Astrophysics}
\newcommand\pasp{Astronomical Society of the Pacific, Publications}
\newcommand\apj{The Astrophysical Journal}

The original spectrum, taken by Green and Schmidt, is shown in Figure \ref{fig:3c273 spectrum}.\\
        \includegraphics[width=0.9\textwidth]{"../3c273 spectrum"}
        \caption[3C 273 spectrum]{Spectrum of the quasar 3C 273. Comparison spectrum is H + He + Ne. Redshifted emission lines of H and O\textsc{iii} are indicated.} \label{fig:3c273 spectrum}
Correcting for cosmological expansion yields a redshift for 3C 273 of 0.154, close to the


enter image description here

I've based the code on an answer from this question (the "direct and robust method"). I like this method for its simplicity, so I'd like to just adjust it slightly if possible.

How can I stop the caption from running into the margin? I've tried several different value of minipage and graphics width.

EDIT: put compilable code into the question.

  • Could you please post a complete compilable code?
    – Bernard
    Feb 21, 2019 at 20:28

1 Answer 1


You defined the caption width to be 0.6\textwidth outside the minipage.

\captionsetup{font={normalfont},labelfont=footnotesize, width=.6\textwidth}

If you remove the width definition (width=.6\textwidth) you will get the behavior you're looking for.

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.