It was recommended that I post this as a new question. Sometime back, this marvelous solution was posted on this site.
\documentclass{article}
\usepackage{tikz,xparse}
\ExplSyntaxOn
\NewDocumentCommand{\calcinput}{m}
{
\tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }
}
\ExplSyntaxOff
\begin{document}
\def\quest{\calcinput{1/(4.2+5.4)-(3.5+4.7)/9}}
\def\ans{\calcinput{-0.806944444}}
\begin{tikzpicture}[font=\Large\ttfamily]
\draw (0,0) rectangle (5,-4);
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (qu) {\quest};
\node[align=right,text width =5cm,
anchor=north west,inner sep=1pt] (an) at (qu.south west) {\ans};
\end{tikzpicture}
\begin{tikzpicture}[font=\Large\ttfamily]
\draw (0,0) rectangle (4,-4);
\node[align=flush left,text width =4cm,
anchor=north west,inner sep=1pt] (qu) {\quest};
\node[align=right,text width =4cm,
anchor=north west,inner sep=1pt] (an) at (qu.south west) {\ans};
\end{tikzpicture}
\end{document}
However, in emulating the calculator on some practice problems I am writing for our students, I need to emulate the square root symbol. When I try this:
\def\quest{\calcinput{normalcdf(.53,1E99,.5,$\sqrt{\phantom{i}}$(.5*.5/100))}}
I get this error:
./Untitled.tex:20: Missing { inserted.
<to be read again>
\let
l.20 ...hor=north west,inner sep=1pt] (qu) {\quest
};
Any suggestions for a workaround?