# How to typeset dimensional tolerances (mechanical engineering) with LaTeX?

Is there a package which allows to typeset dimensional tolerances as used in mechanical engineering like:
?

I have to use them in the text and wonder how to do that best. So I'm searching for a package which can

• correctly typeset the upper and lower limits
(also in combination with length units! I admit that I'm not sure how to do that the best way.)
• also makes available the symbols for form tolerances like roundness, cylindricity, straightness, etc.

You should use the siunitx package to format all your numbers and units. The symbol can be drawn using \diameter from the wasysym package and the tolerances are simple math super- and subscripts:

\documentclass{article}

\usepackage{wasysym}
\usepackage{siunitx}
\sisetup{output-decimal-marker={,}}

\newcommand{\tol}[3]{\ensuremath{\si{#1}^{+\num{#2}}_{-\num{#3}}}}

\newcommand{\diatol}[3]{\ensuremath{\diameter\si{#1}^{+\num{#2}}_{-\num{#3}}}}

\begin{document}

\diatol{0,125}{0.000}{0.001}

\tol{2,225\meter}{0.100}{0.20}

\tol{2,225m}{0.100}{0.20}

\end{document}


### Result:

• I think the tolerances need to be in scriptscriptsize. – Charles Stewart Apr 13 '11 at 10:13
• This is a mixed bag question of normal as well as Geometric tolerances . I think it is more a job for TikZ – Danie Els Apr 13 '11 at 10:19
• In technical drawings, the tolerances are set on size smaller than the target measure. From that point of view, scriptsize is ok. – Christoph Apr 13 '11 at 10:39