2
$\begingroup$

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[...].

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

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]];
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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