I'm trying to use Pandoc for the semi-automatic generation of billing statements from YAML text inputs:

  • For doing sum calculations I use the spreadtab package.
  • For getting automatic page breaks if the statement is long, the longtable package is wrapped inside spreadtab.

Most elementary things work now as needed, but I want to polish the appearance of long numbers by inserting a thousand separator. However, I'm now lost with this last issue: inserting a "thousands separator" into the display of long numbers:

MWE example -- resulting table displays numbers without "thousands separator".

Here is a minimally working example LaTeX code which Pandoc generated from my own custom LaTeX template:

    \geometry{a4paper, paperwidth=595pt, paperheight=842pt, left=25.0mm, right=18mm, top=45.5mm, bottom=32mm}
\usepackage[boldmath, np, oldcolumntypes, sepfour, warning, autolanguage, addplus,]{numprint}




% I'm really using WeidemannStd-Medium
%    \setsansfont{WeidemannStd-Medium}

% However, for the MWE I'm switching to Vollkorn, because not everybody has Weidemann fonts...


\usepackage{enumitem}                       % Anpassen von Listen
    \setlist{nolistsep}                     % Kein whitespace zwischen Listen-Items
    \setlist[itemize]{leftmargin=0.6cm}     % Reduziere linken Einzug bei Listen
    \setlength{\tabcolsep}{6pt}             % Größeren gutter zwischen Spalten

% To be decided!

\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \newcommand{\RL}[1]{\beginR #1\endR}
  \newcommand{\LR}[1]{\beginL #1\endL}





{{longtable}[t t t]{rp{120.0mm}r}}
@ \textbf{Pos.}               & @ \textbf{Beschreibung}                  &  @ \textbf{Preise in EUR}  \\
@ \refstepcounter{pos}\thepos & @ Die erste erbrachte Leistungs-Position &  14450                     \\
@ \refstepcounter{pos}\thepos & @ Weitere Position, mit einer Liste von Einzelheiten
                                                         \myFootnotesize \item
                                                         Nähere Erläuterungen zur erbrachten\ldots{}
                                                         \myFootnotesize \item
                                                         \ldots{}Leistung, wie evtl. erforderlich
                                                         \myFootnotesize \item
                                                         Sieht gut aus
                                                      \end{itemize}      & -734                       \\
@                             & @ \multicolumn{1}{r}{Summe, netto:}      &  :={sum(c1:[0,-1])}        \\
@                             & @ \multicolumn{1}{r}{MWSt. 19\%:}        &  19/100*[0,-1]             \\
@                             & @ \multicolumn{1}{r}{\textbf{Gesamt:} }  &  \textbf{:={[0,-1]+[0,-2]}}\\


I'm using xelatex to compile the LaTeX code to PDF.

As you can see, the numprint packages is loaded in line 5 with the sepfour option, so I can possibly get the thousands separator to work. I played with the available options there, but I did not find any which would get it to work.

I would assume that the \npthousandsep{\.} command (line 73 of the MWE) should do what I want, but it doesn't.

So I must clearly be missing something obvious...

My main question for now is the first one below. However, I'm interested in getting answers for the second and third ones too:

  1. How can I get a "thousands separator" (either a dot, or a narrow space) inserted into all long numbers?
  2. Is there a way to automatically append the Euro sign to all displayed numbers in column 3?
  3. I could not get the code to work with other table packages (other than longtable), as they are listed in lines 44-49:
    • Which one of the other table packages can also automatically insert line breaks if required?
    • What do I need to change in the table code to use that other package?

Update: I can hardly believe that no-one tried to answer my question(s) more than 12 months after submitting it. Maybe this update draws new attention to it?

1 Answer 1


don't know if it matters anymore, but I believe numprint can do what you want with the commands:


I also had to redefine the decimal separator. An example is shown below (sorry not a long table). table with thousands , seperator


\usepackage{booktabs} % for more table lines



          & @Time step  & @\shortstack{Simulation\\ Time [sec] } &@ \shortstack{Data File \\Size [KB] }  &@ \shortstack{Real time \\Speed up}& @\shortstack{ PSDS\\Speed up} & @\shortstack{Reduction \\ of file size}  & @ \shortstack{Steady State $f$ \\ error [Hz]}\\
        @PSDS       &@4.167 ms      &  56.12    & 35070     & \STcopy{v}{90/C2}     & 1                     & 1                     & 0\\
        @LTD        &@  2 sec       & 13.88     &   300     &                       & \STcopy{v}{56.12/c3}  & \STcopy{v}{!d!2/d3}   &@ NA \\ 
        @LTD        &@  1 sec       & 26.28     &   496     &                       &                       &                       &@ 9.50E-4\\
        @LTD        &@  0.5 sec     & 52.27     &   888     &                       &                       &                       &@ 9.71E-4\\ 
        @LTD        &@  0.25 sec    & 102.43    &   1672    &                       &                       &                       &@ 9.78E-4\\

  • Thanks for the answer, even if it is almost three years later. I cannot verify it right now, but I'll upvote it for now, just for the effort. Once I verified it (can take a while till I get round), I'll also accept it. Thanks again! May 22, 2019 at 20:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .