I just picked code from What's the best way to include graphics in an enumerated list? to include a graphic in an enumerated list. But the code causes a overfull \hbox if I use it in the first enumeration item. How can I solve this?
MWE:
\documentclass{scrartcl}
\usepackage[demo]{graphicx}
\usepackage{adjustbox}
\begin{document}
\begin{enumerate}
\item
\begin{minipage}[t]{\textwidth}
\raggedright
\adjustbox{valign=t}{%
\includegraphics[width=\textwidth]{E53a}%
}
\end{minipage}
\end{enumerate}
\end{document}
Edit: Another MWE using \linewidth but still doesn't work:
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\newcounter{mycounter}
\setcounter{mycounter}{1}
\newenvironment{myenv}[1]{
\section{Title}
}{\stepcounter{mycounter}}
\newtheorem{myth}{}[mycounter]
\begin{document}
\begin{myenv}
\begin{myth}
\begin{enumerate}
\item \includegraphics[width=\linewidth,valign=t]{E53a}%
\end{enumerate}
\end{myth}
\end{myenv}
\end{document}


width=\textwidthwithin anenumerateis slightly too wide, you could trywidth=0.9\textwidthto make it fit better. – Marijn May 23 '20 at 19:19\linewidthnot\textwidth– David Carlisle May 23 '20 at 19:33\linewidthdoesn't work either @DavidCarlisle. – ATW May 23 '20 at 19:34exportoption when loading adjustbox you can use teh nicer syntax\includegraphics[valign=t]{...}ratther than needing teh adjustbox wrapper (and you do not need theminipagein any case. – David Carlisle May 23 '20 at 19:34\linewidthdoes work:-) I posted some code as an answer – David Carlisle May 23 '20 at 19:38myenvto take an argument#1which it discards, so it is discarding the blank line hrere but if you didn't have a blank lien after\beginit would discard teh\beginor\begin{myth}is that the intended behaviour??? – David Carlisle May 23 '20 at 20:03\item zzzafter it you will see that the 2 is in the usual place then\linewidthwill work but for the first item 1 is inlined after the theorem heading so not in line with the other labels that's intentional in the latex code (but I never liked it:-) if you want that you need to account for the theorem heading o simply use\begin{myth}\mbox{}so the label 1. goes in line with 2. and then\linewidthis the right thing. – David Carlisle May 23 '20 at 20:11