1

I'm using class beamer and package spreadtab.

First frame works well, sum(cell(aaf):cell(aal)) gives output.

Second frame: sum(cell(ccf):cell(ccl)) gives error.

MWE:

\documentclass{beamer}
\usepackage{spreadtab}
\usepackage{booktabs}


\begin{document}
\begin{frame}{working}
\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aaf) & 5tag(bbf) & \STcopy{v2}{a1+b1}tag(ccf) \\
4 & 6 &  \\
4tag(aal) & 3tag(bbl) &   \\
\hline
sum(cell(aaf):cell(aal)) &  sum(cell(bbf):cell(bbl)) & \\
\end{spreadtab}
\end{frame}

%%\end{document}

\begin{frame}{not working well}
\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aaf) & 5tag(bbf) & \STcopy{v2}{a1+b1}tag(ccf) \\
4 & 6 &  \\
4tag(aal) & 3tag(bbl) &  tag(ccl) \\
\hline
sum(cell(aaf):cell(aal)) &  sum(cell(bbf):cell(bbl)) & sum(cell(ccf):cell(ccl))\\
\end{spreadtab}
\end{frame}
\end{document}
%
Mensch
  • 65,388
sandu
  • 7,950

1 Answers1

2

No, the first frame does not work well, because you can see tag(ccf) in the third column of row 1:

first original frame

To correct this you need to delete tag(ccf), because \STcopy can not work with tag!

You need to change the coding for your second frame:

\begin{frame}{now working well}
\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aag)                & 5tag(bbg)                & sum(a1:b1)tag(ccg)      \\ % <===========
4                        & 6                        & sum(a2:b2)              \\ % <===========
4tag(aah)                & 3tag(bbh)                & sum(a3:b3)tag(cch)      \\ % <===========
\hline
sum(cell(aag):cell(aah)) & sum(cell(bbg):cell(bbh)) & sum(cell(ccg):cell(cch))\\
\end{spreadtab}
\end{frame}

Please see the complete mwe

\documentclass{beamer}

\usepackage{spreadtab}


\begin{document}
\begin{frame}{working}
\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aaf)                & 5tag(bbf)                & \STcopy{v2}{a1+b1} \\ % tag(ccf)
4                        & 6                        &                    \\
4tag(aal)                & 3tag(bbl)                &                    \\
\hline
sum(cell(aaf):cell(aal)) & sum(cell(bbf):cell(bbl)) &                    \\
\end{spreadtab}

\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aaf)                & 5tag(bbf)                & \STcopy{v2}{a1+b1}tag(ccf) \\ % tag(ccf)
4                        & 6                        &                    \\
4tag(aal)                & 3tag(bbl)                &                    \\
\hline
sum(cell(aaf):cell(aal)) & sum(cell(bbf):cell(bbl)) &                    \\
\end{spreadtab}
\end{frame}

\begin{frame}{now working well}
\begin{spreadtab}{{tabular}{rrr}}
%@ values of $x$ & 4 & 5\\
2tag(aag)                & 5tag(bbg)                & sum(a1:b1)tag(ccg)      \\ % <===========
4                        & 6                        & sum(a2:b2)              \\ % <===========
4tag(aah)                & 3tag(bbh)                & sum(a3:b3)tag(cch)      \\ % <===========
\hline
sum(cell(aag):cell(aah)) & sum(cell(bbg):cell(bbh)) & sum(cell(ccg):cell(cch))\\
\end{spreadtab}
\end{frame}
\end{document}

and the result:

corrected first frame

and the second frame:

second frame

Mensch
  • 65,388