3
$\begingroup$

Background

The box-formmating behavior is affected by the downvalues of the symbol MakeBoxes. But the formatting behavior is not exactly MakeBoxes, but seems to be the same to menu command "ConvertTo/StandardForm". There's an example for the difference: 159959.

Another key process of evaluations in Mathematica is sending the content of evaluating input cell to evaluators. This can be strongly changed by setting the option CellEvaluationFunction (however, for example, this way can't handle multi-line cell, see: 29264).

Question

Similarly, is there any way to change the box-formatting behavior more than changing the definition of MakeBoxes?

Related Question

(Not essential for understanding this question. You can skip them if you are not interested.)

  1. Is any way to change the cell-creation behavior which is similar to If[# =!= Null, CellPrint@Cell[BoxData@MakeBoxes@#, "Output"(* , ... *)]] &?

  2. Difference between "ConvertTo/InputForm" and MakeExpression(76056), "ConvertTo/StandardForm" and MakeBoxes. (As Itai Seggev mentioned here, they uses BoxForm`ConvertForm)

  3. Why the default form used for output-formatting differs in different environments of the kernel(approximately ToString[#, InputForm]& for command-line, BoxData@ToBoxes[#, StandardForm]& for notebook)? Can we choose a form for it programmatically? See: 226209

$\endgroup$
6
  • $\begingroup$ I am not sure what exactly do you want to change or what should be the effect and in what circumstances. Currently my interpretation is that Format is a potential answer but I am not 100% sure. $\endgroup$
    – Kuba
    Oct 22, 2020 at 7:38
  • $\begingroup$ @Kuba Nice. Definitions to Format[_, InputForm] affects "Related Question 3"(MSE 226209) successfully. But this question seeks for a function or method for interference which has a similar position to CellEvaluationFunction in the box-explaination process. Perhaps such a method does not exist. $\endgroup$
    – asd1dsa
    Oct 22, 2020 at 15:41
  • $\begingroup$ CellEvaluationFunction is more about parsing or on the route from boxes to expressions rather than formatting which is about expressions to boxes. I am still confused :) sorry. $\endgroup$
    – Kuba
    Oct 22, 2020 at 16:48
  • $\begingroup$ @Kuba I know that. What I meant is, we can set CellEvaluationFunction to interfere "parsing or on the route from boxes to expressions" when I cannot find a similar way to interfere "formatting which is about expressions to boxes". $\endgroup$
    – asd1dsa
    Oct 22, 2020 at 16:54
  • $\begingroup$ Now, I'm able to get an better way to discribe my question. I will post my edit later. $\endgroup$
    – asd1dsa
    Oct 22, 2020 at 16:57

0

Your Answer

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

Browse other questions tagged or ask your own question.