1

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}
\usepackage{adjustbox}

\begin{document} \begin{tikzpicture} \draw[red,line width = 1mm] (0,0)--nodecolor=black,left { \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. enter image description here

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

Thanks in advance for your contribution!

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?

enter image description here

I tried by wrapping the + sign in scriptstyle:

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

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

Cheers!

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

2 Answers2

2

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$}
\dimen1=\ht0 \advance\dimen1 by\dp0
\count0=\dimen0 \multiply\count0 by 1000
\count1=\dimen1 \divide\count0 by\count1
\magnification=\count0
\box0
\bye

(Rounding errors are smaller than tattooing errors.)

1

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

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

pascal974
  • 4,652