TransWikia.com

How to position a figure in the itemize environment?

TeX - LaTeX Asked on July 30, 2021

I am trying to position my figure in the middle of the itemize environment. However, the left figure is always a little bit out of the left boundary. I marked the left boundary with a red horizontal. Does anyone know, how to fix this? Thank you in advance!

usepackage{float}
usepackage{amsmath}
begin{document}

begin{itemize}

item fdgdg
begin{figure}[ht!]
   centering
   subfloat{includegraphics[width=0.45textwidth]{Pspectrum_1024_Abweichung.png}}
   hfill
   subfloat{includegraphics[width=0.45textwidth]{Pspectrum_2048_Abweichung.png}}
   caption{}
   label{fig:Vergleich_Pspectrum}
end{figure}

end{itemize}
end{document}

One Answer

Assuming you want the figure on a separate line.

documentclass{article}
usepackage{subcaption}
usepackage[draft]{graphicx}

makeatletter
newcommand{setcaptype}[1]{def@captype{#1}}
makeatother

begin{document}

begin{itemize}

item fdgdg

begin{minipage}{linewidth}
   setcaptype{figure}
   subfloat{includegraphics[width=0.45textwidth]{Pspectrum_1024_Abweichung.png}}
   hfill
   subfloat{includegraphics[width=0.45textwidth]{Pspectrum_2048_Abweichung.png}}
   caption{}
   label{fig:Vergleich_Pspectrum}
end{minipage}

end{itemize}
end{document}

Answered by John Kormylo on July 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP