3.1.7. TeXUnit

This module provides functions to convert units used in the TeX world:

  • mm stands for milimetre,
  • in stands for inch which corresponds to 25.4 mm,
  • pt stands for TeX point, there is 72.27 pt in one inch,
  • sp stands for scale point, there is 2**16 sp in one pt,
  • dpi stands for dot per inch.

The DVI format uses the measure 100 nm as base unit. A scaled point is defined as a fraction:

  • num = 2.54 * 1e7 = 25400000
  • den = 7227 * 2**16 = 473628672
  • 1 sp = num/den = 5.4 nm

For a resolution of 1200 dpi, a pixel measures 21 um.

PyDvi.TeXUnit.dpi2mm(x)[source]

Convert dpi to mm

PyDvi.TeXUnit.in2mm(x)[source]

Convert in to mm

PyDvi.TeXUnit.in2pt(x)[source]

Convert in to pt

PyDvi.TeXUnit.in2sp(x)[source]

Convert in to sp

PyDvi.TeXUnit.mm2in(x)[source]

Convert mm to in

PyDvi.TeXUnit.pt2in(x)[source]

Convert in to pt

PyDvi.TeXUnit.pt2mm(x)[source]

Convert pt to mm

PyDvi.TeXUnit.pt2sp(x)[source]

Convert pt to sp

PyDvi.TeXUnit.sp2in(x)[source]

Convert sp to in

PyDvi.TeXUnit.sp2mm(x)[source]

Convert sp to mm

PyDvi.TeXUnit.sp2pt(x)[source]

Convert sp to pt

PyDvi.TeXUnit.sp2dpi(x)[source]

Convert sp to dpi

Previous topic

3.1.6. OpcodeParser

Next topic

3.1.8. TexDaemon

This Page