How can I do math directly in LaTeX? I don't want to calculate it first and input the value to it.

  • 1
    In what context would you use that?
    – egreg
    Mar 4 at 13:59
  • @egreg I'm using it for my TikZ drawing. \draw (A) node[above, font=\fontsize{10/0.88348}{12}\selectfont] {$V_X$}. I want to do this to account for scale factor in the article.
    – hana
    Mar 4 at 14:02

1 Answer 1


You can use \fpeval

\RequirePackage{fix-cm} % or define a scalable font in the preamble


\node (A) at (0,0) {};
\node (B) at (1,0) {};
\draw (A) node[above, font=\fontsize{\fpeval{10/0.88348}}{0}\selectfont] {$V_X$};
\draw (B) node[above, font=\fontsize{\fpeval{10*1.35}}{0}\selectfont] {$V_X$};


enter image description here

Not the answer you're looking for? Browse other questions tagged .