RE: LaTex: Make image as wide as text column


\begin{figure*}[h!]

\centering

\includegraphics[width=\textwidth]{figures/UNETR_overview.png}

\caption{Placeholder for a figure. If you use a figure from a publication or other source you need to state this here in the caption.}

\label{fig1}

\end{figure*}

How can I make this the same width as my column? I use two-column layout but the image is as wide as the whole document.

Add Comment
2 Answers
The image appears to be spreading across the entire document because you're using the "figure*" environment, which is designed for two-column layouts in LaTeX, making the image span the full width. If you aim to have the image the same width as a single column, use the "figure" environment instead. Here's how you can modify your existing code: ``` \begin{figure}[h!] \centering \includegraphics[width=\columnwidth]{figures/UNETR_overview.png} \caption{Placeholder for a figure. If you use a figure from a publication or other source you need to state this here in the caption.} \label{fig1} \end{figure} ``` Just replace "figure*" with "figure" and "textwidth" with "columnwidth" to fit the image in one column.
Answered on August 2, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.