3

I am trying to make an invoice where the entries are all using ttfamily, in the invoice2 package, but can't seem to get the numbers (as opposed to the table text) in monospace. This is frustrating as it is especially the numbers I want monospaced. How can I get the table to be entirely (or even just for the numbers!) in ttfamily?

A minimum example, where the problem is apparent:

\documentclass{article}
\usepackage{times}
\usepackage{invoice2}
\usepackage{eurosym}
\begin{document}
\ttfamily
 \invoiceoptions{vat=.09}
 \begin{invoice}[currency-symbol={\euro{}}]
 \ttfamily
    \invoicesingleitem{Ignition!}{4087.99}
    \invoiceitem{1.5}{The Art of Computer Programming 1--4}{162.99}
    \invoiceitem{20}{The TeXbook}{55.69}
 \end{invoice}
\end{document}
1

The invoice2 package internally uses the siunitx package to format numbers. If you want to change the font of the numbers you can use siunitx settings, with the command \sisetup.

The settings are described in the siunitx manual on page 18. The default mode for numbers is math, which means you can influence the number font by setting the math-rm option, in this case to \mathtt.

MWE:

\documentclass{article}
\usepackage{times}
\usepackage{invoice2}
\sisetup{math-rm = \mathtt}
\usepackage{eurosym}
\begin{document}
 \invoiceoptions{vat=.09}
 \begin{invoice}[currency-symbol={\euro{}}]
    \invoicesingleitem{Ignition!}{4087.99}
    \invoiceitem{1.5}{The Art of Computer Programming 1--4}{162.99}
    \invoiceitem{20}{The TeXbook}{55.69}
 \end{invoice}
\end{document}

Result:

enter image description here

If you prefer the Times monospace font then you can also use \sisetup{math-rm = \texttt}:

enter image description here

| improve this answer | |

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.