When I run Mathematica in console mode (math.exe/wolfram.exe) without a GUI frontend, then printed and output expressions are (apparently) formatted using OutputForm (pseudo-2D layout). What option can I set to format them with InputForm (ideally, without attaching visible "InputForm" marker to every output)?

I tried to do $PrePrint = InputForm, but it does not affect Printed expressions. Also, it overrides FullForm, MatrixForm and others in expressions like FullForm[...].

  • $\begingroup$ So unless it is another *Form it should be an InputForm, is that correct? $\endgroup$
    – Kuba
    Commented Jan 7, 2019 at 9:41

1 Answer 1


I think what you want is:

$Post = ToString[#, FormatType -> InputForm] &;

But this does not affect Print[]. Of course, you can always define your own print function which does exactly what you want. That is what I recommend here.

Do something such as, for example:

print[x_] := Print[ToString[x, FormatType -> InputForm]];
  • $\begingroup$ Would you mind to explain, by which convoluted logic, Print[ FullForm[ expr ]] just doesn't work and print instead : FullForm[ expr ]... it make no sense to me ! $\endgroup$
    – yota
    Commented Oct 22, 2020 at 14:07
  • $\begingroup$ @yota Please give an actual example. I just tried Print[FullForm[x+y]] and it outputted Plus[x, y] as expected. $\endgroup$
    – Somos
    Commented Oct 22, 2020 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.