1

I want to use numprint to add separators every three digits of a decimal representation of a rational BUT with an overline over the repeating digits.

For example, for the unitary fraction 1/42, I get:

1/42

without numprint and I want numprint spaces.

I mention that the number is constructed within pythontex concatenating integer part, irregular part and finally repeating part with overline.

edit

\documentclass[12pt]{article}

\usepackage{pythontex}

\begin{pycode}[dvt]
from dvtDecimal import *
\end{pycode}

\begin{document}

\begin{pycode}[dvt]
f = dvtDecimal(1, 42) 
print("$" + f.toTeX()[2] + "$")
\end{pycode}

\end{document}

and the python code looks like this: enter image description here

4
  • 2
    ...okay... so what does the input look like?
    – Werner
    Commented Jan 31, 2019 at 19:49
  • 1
    What's a "numprint space"? Please elaborate.
    – Mico
    Commented Jan 31, 2019 at 21:09
  • numprint is a package to separate digits. Maybe, I'd better put some LaTeX spaces \, every 3 digits directly in the python code instead... But as numprint is language sensitive, I thought it should be the first thing to try.
    – david
    Commented Jan 31, 2019 at 21:12
  • 1
    Why adding the Python code as an image? And where's it supposed to be used? I get ImportError: No module named dvtDecimal.
    – egreg
    Commented Jan 31, 2019 at 21:39

0

You must log in to answer this question.

Browse other questions tagged .