1

I'm having issues with this table and can't find the problem. I'm including all the packages I'm using for customizing the table:

\usepackage{spreadtab}
\usepackage{arydshln} % For the dotted line on the table
\renewcommand{\arraystretch}{1.5} % Apply vertical padding to table cells
\usepackage{hhline} % For single-cell borders
\newcounter{pos}
\setcounter{pos}{0}

\begin{spreadtab}{{tabular}[t t t]{lp{8.2cm}r}}
  \hdashline[1pt/1pt]
  \STtextcell \textbf{Pos.} & \STtextcell \textbf{Leistung/Beschreibung} & \STtextcell \textbf{Preise in EUR} \\ \hline
  \STtextcell \refstepcounter{pos} \thepos & \STtextcell Die erste Leistung  & 750.0 \\
  \STtextcell \refstepcounter{pos} \thepos & \STtextcell Die zweite Leistung & 180.0 \\
  \STtextcell \refstepcounter{pos} \thepos & \STtextcell Die dritte Leistung & 55.0  \\
  \STtextcell \refstepcounter{pos} \thepos & \STtextcell Die fierte Leistung & 55.0 \\ \hline
  \STtextcell & \STtextcell \multicolumn{1}{r}{\textbf{Rechnungsbetrag:}}   & \textbf{sum(c1:c4)} \\ \hhline{~~-}
\end{spreadtab}

I'm getting the following error: Paragraph ended before \ST@left@ii was complete. Can anyone see what I'm doing wrong? Any help would be much appreciated.

  • 1
    Replace \STtextcell by @ and change \textbf{sum(c1:c4)} into \textbf{:={sum(c1:c4)}} – cgnieder Oct 31 '15 at 17:01
  • That worked, thanks. If you post your suggestion as an answer I will accept it. – zool Oct 31 '15 at 21:10
  • Anyway, I thought @ and \STtextcell were equivalent, but it doesn't work using \STtextcell. – zool Oct 31 '15 at 21:12
3

Replace \STtextcell by @. By redefining \STtextcell you can change the marker for text cells but you can't use \STtextcell directly.

Also change \textbf{sum(c1:c4)} into \textbf{:={sum(c2:c5)}}. This is explained in the manual in the section about mixed cells where \textbf is actually shown as an example:

Note that ‘:={numeric field}’ may be inside brackets, whatever be the level of nesting. For example, if a cell contains \textbf{:={a1+1}} and if the numeric value of the cell a1 is 5, then finally, the cell will contain \textbf{6}

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{spreadtab,array}
\usepackage{arydshln}
\renewcommand{\arraystretch}{1.5}
\usepackage{hhline}
\newcounter{pos}

\begin{document}

\STautoround*{2}
\STsetdecimalsep{,}
\begin{spreadtab}{{tabular}[t t t]{lp{8.2cm}r}}
  \hdashline[1pt/1pt]
  @ \textbf{Pos.} &
  @ \textbf{Leistung/Beschreibung} &
  @ \textbf{Preise in EUR} \\ \hline
  @ \refstepcounter{pos} \thepos & @ Die erste Leistung   & 750.0 \\
  @ \refstepcounter{pos} \thepos & @ Die zweite Leistung  & 180.0 \\
  @ \refstepcounter{pos} \thepos & @ Die dritte Leistung  & 55.0  \\
  @ \refstepcounter{pos} \thepos & @ Die vierte Leistung  & 55.0 \\
  \hline
  @ &
  @ \multicolumn{1}{r}{\textbf{Rechnungsbetrag:}} &
  \textbf{:={sum(c2:c5)}}
  \\ \hhline{~~-}
\end{spreadtab}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.