0

I'm trying to use this answer to insert a custom png to itemize with.

I have a problem however, since the image moves out of the slide and is blurred.

I have tried

\begin{itemize}
\item[\includegraphics[width=0.3]{hardhat.png}] first sentence
\end{itemize}

to no avail.

1 Answers1

1

There are two problems here. First, you forgot the unit of your width. Second, You are nesting optional arguments. When reading an optional argument starting with [, TeX looks for the next ] and considers everything in between the optional argument. In your case, the next ] really belongs to the optional argument of \includegraphics, not \item. You can hide the inner argument with a group.

I would recommend using enumitem to change the label for the whole list at once.

\documentclass{article}

\usepackage{mwe}
\usepackage{enumitem}

\begin{document}

\begin{itemize}
    \item[{\includegraphics[width=1em]{example-image}}] first sentence
\end{itemize}

\begin{itemize}[label={\includegraphics[width=1em]{example-image}}]
    \item first sentence
\end{itemize}

\end{document}
schtandard
  • 14,892
  • Thanks for your help. – rami_salazar Jun 05 '19 at 09:56
  • 1
    @rodger_kicks You are welcome. Please consider the remarks in the comments to your question. Make your code snippet an MWE (yes, even though I already answered) and make a habit of including an MWE and any relevant error messages in future questions. You will find that the problem often reveals itself when you work on writing a complete and concise question. At the very least, it helps everyone else to help you as well as later visitors who have similar problems. – schtandard Jun 05 '19 at 10:00
  • Good answer and comment. +1 – Dr. Manuel Kuehner Jun 05 '19 at 10:05