# fontspec changes indention of itemize

When I add the fontspec package, the items in an itemize environment get an additional indention. You find the code in the following example, it is mainly from this question:

\documentclass{scrreprt}
\usepackage{blindtext, enumitem, fontspec}

\newcommand{\myicon}[1]{%
\smash{%
\raisebox{\dimexpr0.5\baselineskip-\height}{#1}%
}
}

\setlist{nosep}

\begin{document}

\blindtext
\begin{itemize}[labelindent=4cm, leftmargin=*]
\item[\myicon{\rule{4cm}{4cm}}] \blindtext
\end{itemize}
\blindtext

\end{document}


The rule square does not align with the text.

When I remove the fontspec package the indention is correct:

How is it possible to keep the correct indention with the fontspec´ package?

• I can't see your problem, but there is spurious space in your \myicon definition, and I would probably use [labelwidth=4cm, leftmargin=!,align=left] – Ulrike Fischer May 11 '15 at 16:12
• I do not understand why I get an additional indention with the fontspec package. Where do I have the spurious space? I tried your option, unfortunately the rule jumps into the text. – Dirk May 11 '15 at 16:18
• Your code works. I was to hectic and did not change the first option. – Dirk May 11 '15 at 19:48

The problem is probably in the different value of the em; but your way of setting the itemize is wrong:

\documentclass{scrreprt}
\usepackage{fontspec}

\newcommand{\myicon}[1]{%
}

\setlist{nosep}

\begin{document}

\lipsum[1]
\begin{itemize}[labelindent=-4cm, leftmargin=\dimexpr4cm+\labelsep]
\item[\myicon{\rule{4cm}{4cm}}] \lipsum[1]
\end{itemize}
\lipsum[1]

\end{document}


I used \adjustbox because it's easier.

The output with or without fontspec is the same.

• We now have three possible options for the itemize environment. Which one is correct and why aren't the others? – Dirk May 11 '15 at 19:52
• @Dirk There are several ways to do the same thing with enumitem. – egreg May 11 '15 at 19:57
• I see. ;) Why do you think my way is wrong? – Dirk May 11 '15 at 20:16
• @Dirk Because it doesn't work. ;-) – egreg May 11 '15 at 20:25
• Good answer. :) One question: The top of the rule` is a bit higher than the top of the corresponding textline "Lorem ipsum...". Is it possible to align this? – Dirk May 11 '15 at 20:34