I would like to put a \xRightarrow into a list instead of a bullet, unfortunately I get
! Argument of \\xRightarrow has an extra }.
<inserted text>
\par
l.8 \item[$\xRightarrow[continuous]
{norm}$] Test
This is from the MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{itemize}
\item[$\xRightarrow[continuous]{norm}$] Test
\end{itemize}
\end{document}
using
$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux)
$ lualatex --version
This is LuaTeX, Version 1.10.0 (TeX Live 2019/Arch Linux)
How can I fix this?
Edit: as @Phelype Oleinik points out in the comments, this is related to parsing the braces [,].
\item[{$\xRightarrow[continuous]{norm}$}], i.e. add braces around$\xRightarrow[continuous]{norm}$. – Dec 04 '19 at 23:11\itemlooks for a[and the first brace-balanced], which (without the braces in Mr. Cat's suggestion) ends up being$\xRightarrow[continuous, and then chaos ensues. The braces prevent that. This is explained in my answer to the linked question (see the 5th paragraph there). If after reading that you still disagree on the duplicate, I'll remove my comment, no problem :-) – Phelype Oleinik Dec 04 '19 at 23:28[...]as it balances{...}. There are exceptions, for example commands defined withxparse. If you did\NewDocumentCommand\test{O{z}}{(#1)}and used\test[a[b]c]you'd get(a[b]c), whereas if you used the equivalent\newcommand\test[1][z]{(#1)}you'd get(a[b)c]for the same input. – Phelype Oleinik Dec 04 '19 at 23:46