I have this overleaf figure: \begin{figure*}[t]…
- User
I have this overleaf figure:
\begin{figure*}[t] \includegraphics[width=0.5\columnwidth]{figs/gold_categories_hist.pdf} \caption{The distribution of feedback categories for the first conversations in the dataset, as deemed by manual annotation. The most frequent categories are `Repeat and Rephrase'' and Ask for Clarification''. There are only cases of Positive Feedback''.\label{fig:manual_categories} } \end{figure*}
from some reason the caption span to the whole page width, and not half of it like the figure itself. How to fix?
- Assistant
The issue arises because you're using a figure* environment, which spans both columns in a two-column layout (e.g., in \documentclass{IEEEtran} or \documentclass[twocolumn]{article}). Even though your image is only half a column wide, the figure* environment makes the caption span the entire text width, since it’s designed for full-width figures. Fix If your figure is meant to only span one column, you should use the regular figure environment instead of figure*. Here's the fix: latexCopyEdit\begin{figure}[t] \centering \includegraphics[width=0.5\columnwidth]{figs/gold_categories_hist.pdf} \caption{The distribution of feedback categories for the first conversations in the dataset, as deemed by manual annotation. The most frequent categories are Ask for Clarification''. There are only cases of ``Positive Feedback''.} \label{fig:manual_categories} \end{figure}
- User
\begin{figure}[t] \includegraphics[width=0.5\columnwidth]{figs/gold_categories_hist.pdf} \caption{The distribution of feedback categories for the first conversations in the dataset, as deemed by manual annotation. The most frequent categories are `Repeat and Rephrase'' and Ask for Clarification''. There are only cases of Positive Feedback''.} \label{fig:manual_categories} \end{figure}
it's the same
- Assistant
Thanks — the behavior you're describing (caption spanning the full column width, even when the image is narrower) is actually expected in LaTeX. The caption in a figure environment (whether figure or figure*) is by default typeset across the entire width of the float — i.e., the whole column (in figure) or the full page width (in figure*). If you want the caption width to match the image width, you need to manually restrict the width using a minipage, parbox, or the caption package. Here's how to do it cleanly:
✅ Solution with caption package First, add this to your preamble if you haven’t already: latexCopyEdit\usepackage{caption}
Then update your figure code to: latexCopyEdit\begin{figure}[t] \centering \begin{minipage}{0.5\columnwidth} \includegraphics[width=\linewidth]{figs/gold_categories_hist.pdf} \captionof{figure}{The distribution of feedback categories for the first conversations in the dataset, as deemed by manual annotation. The most frequent categories are Ask for Clarification''. There are only cases of ``Positive Feedback''.} \label{fig:manual_categories} \end{minipage} \end{figure}