I am using a function for summing numbers like in paper and my input at arguments is like this:
\showsum{123+456}
I need to replace the custom function with other from package xlop - \opadd.
I want the same function name but there are 2 separated arguments in \opadd and I want to use {123+456} for \opadd arguments. How to make this delimiter?
\documentclass{article}
\usepackage{xlop}
\usepackage{amsmath}
\usepackage{setspace}
\newcommand{\showsum}[2][c]{%
$\edef\originalplusmathcode{\the\mathcode`+}%
\begingroup\lccode`~=`+ \lowercase{\endgroup\def~}{\\\mathchar\originalplusmathcode&}%
\edef\originalminusmathcode{\the\mathcode`-}%
\begingroup\lccode`~=`- \lowercase{\endgroup\def~}{\\\mathchar\originalminusmathcode&}%
\mathcode`+ "8000
\mathcode`- "8000
\begin{array}[#1]{@{}r@{\;}r@{}}
& #2 \\
\hline
& \the\numexpr#2\relax
\end{array}%
$%
}
\begin{document}
Original function(don't need anymore)\showsum{123+456}
\\
\\
Replacement needed \opadd{123}{456}
\end{document}

