I am using the fp
package to write a coursework in mechanics and calculate the numerical values on the fly. Here is some example code:
\documentclass{article}
\usepackage[nomessages]{fp} % http://ctan.org/pkg/fp
\begin{document}
\section{Requirements}
\FPset{P_output_kW}{11}
\FPset{n_output_max_rpm}{5000}
P_output_kW = \FPprint{P_output_kW} kW
n_output_max_rpm = \FPprint{n_output_max_rpm} rpm
\end{document}
As is evident, I am attempting to print every assigned variable by name, value and measurement unit. First of all, the above code does not compile with the error:
! Missing $ inserted.
I would like to invoke into a single command (with a single parameter) the two operations:
- print variable name, followed by
=
- print variable value
How can that be achieved?