# How to define the height of text in cm

I know the question I am going to ask is similar to others posted here. However, I still can not find the right answer. I have checked:

How to export a math formula with a beautiful, high resolution font for a tattoo?

What measure in the text is it that is the font size?

What is the local height of a capital letter?

\settoheight is slightly shorter than actual height

Down to business, I want to get a tattoo with Eulers' identity. So I want to be sure of the height of the text.

And basically that is my question, how to set the height of the text to a specific height (in this case probably fron the baseline to the ascender) in cm, say 1 cm.

Here is what I have done so far:

\documentclass{standalone}
\usepackage{xcolor}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw[red,line width = 1mm] (0,0)--node[color=black,left](T) { \adjustbox{scale=3}{
$\displaystyle e^{i \pi} + 1 = 0$
}} (0,1cm);
\draw[red] (0,0)--(-6cm,0);
\draw[red] (0,1)--++(-6cm,0);
\end{tikzpicture}
\end{document}



Here I am getting approx. the height I want, but basically I am just working around the problem for the solution, instead of doing it right. I draw a vertical line of height 1 cm, and two other horizontal lines, on the base and upper part. Then, after tweaking around with the value of the scale in the adjust box, I get something similar to what I am looking for.

But once again, Is there any other way (direct, efficient, or simple better) to get the desire result?

Editing 1: I have one additional question: In either my solution as with the @pascal974 s, the plus sign is lower than the baseline. Is there a way to move up the + such that it stays above the baseline?

$e^{i \pi}\, {\scriptstyle + } \,1 = 0$


But this command just makes the sign smaller, placing it a the same "ground".

Cheers!

• There is \resizebox{!}{1cm}{...} from either the adjustbox or graphicx packages (it moves around). It can still be fooled by white space. May 30, 2022 at 14:24

With {adjustbox}{totalheight=..} 3cm in my example.

    \documentclass{article}
\usepackage{tikz}

\begin{document}
\newcommand{\h}{3cm}
\begin{tikzpicture}
\node [draw,inner sep =0pt] at (0,0){%
$e^{i \pi} + 1 = 0$
\end{tikzpicture}\rule{1mm}{\h}
\end{document}

• Thanks for your help. I have just one additional question: In the equation, the plus-sign is lower than the baseline. Is there a way to move up the + such that it stays above the baseline? May 31, 2022 at 14:44
• I don't really like it but by tinkering $e^{i \pi}\,\raisebox{1pt}{+}\,1\,\raisebox{1pt}{=}\,0$ or $e^{i \pi}\,\tikz\node {$+$};\,1=0$ Jun 1, 2022 at 10:38
• or $e^{i \pi}\,\scalebox{0.8}{\tikz\node {$+$};}\,1=0$... Jun 1, 2022 at 10:49
• thanks for your help. much appreciated. Jun 8, 2022 at 3:48

In plain TeX, you can divide 1 cm by the height of your formula and apply the quotient (times 1000) as \magnification:

\dimen0=1cm
\setbox0=\hbox{$e^{i\pi}+1=0$}