I have defined an environment that is used for calculation as shown below

$\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci}

The following environment call will help in setting the required precision.


In the similar way, I want to change the output format from "sci" to "fixed" through the argument.

\begin{calc}[2, fixed]
\begin{calc}[2, sci]

How to redefine the key in the newenvironment ?

  • 2
    Could you please provide a complete MWE in which you also show how you use the environment? Naively I would say \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed} but this is most likely no the answer you are looking for, so please add the MWE.
    – user121799
    Jun 12, 2018 at 19:07

1 Answer 1


You don't need an environment for this. Just make a new command as a shortcutwith a default argument for the printing style.

\myparse[fixed, precision=5]{5/(2^(15))},
\myparse[1000 sep=\|, precision=0]{2^15)}

enter image description here

  • Hi percusse, Thanks for the code.How to replace the Dot symbol with X
    – Raja
    Jun 15, 2018 at 19:14
  • @Narashimaraja You can add \pgfkeys{/pgf/number format/sci generic={mantissa sep=\times, exponent={10^{#1}}}} at your preamble to change all occurences.
    – percusse
    Jun 15, 2018 at 23:09

You must log in to answer this question.

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