New answers tagged

2

Question 2: But I don't know why this is done this way: MakeBoxes @ Graphics[Disk[]] (*GraphicsBox[DiskBox[{0, 0}]]*) MakeBoxes @ Whatever[Disk[]] (*expected*) (*RowBox[{"Whatever", "[", RowBox[{"Disk", "[", "]"}], "]"}]*) This is because typesetting rules are applied in a chain where the choices of branches depend of the previous choices ...


2

Information[TraditionalForm] indicates that TraditionalForm is ReadProtected (and Protected). We can remove that with ClearAttributes[TraditionalForm, {Protected, ReadProtected}]. Then Information[TraditionalForm] shows only a few definitions: besides some for dots and for InactiveDTraditional, there are definitions for use within MakeExpression or ...


2

I am going to attempt to answer your questions off the cuff. I have been somewhat inactive on this site recently and also not using Mathematica much, so I am surely not at my best, so "take this with a grain of salt" as they say. Question 1 What is the typesetting in Mathematica? What procedures does it include? Typesetting is anything that is done for ...


4

An good explanation can be found an old mathgroup archive thread which I have reconstructed: When you create a typeset form for a function or operator, you must write a MakeBoxes definition for that function. For example, if you want Transpose[A] to have the typeset form $A^T$ then you might, erroneously, write it this way: Transpose /: ...


1

Here is a slight modification of Karsten's answer. Previously I felt it was too similar, but I suppose it cannot hurt to post it. The main difference is that I avoid MakeExpression. I also like the alternative in your question, which is to use StringToStream. read[cObj_] := DeleteCases[#, HoldComplete[Null]] &@( ToExpression[#, InputForm, ...


3

Instead of SelectionMove and NotebookSelection one can use NotebookRead[PreviousCell[]] and then cleanup the text returned by the ExportPacket. Thread @ MakeExpression[ "{" <> StringReplace[ First[FrontEndExecute[FrontEnd`ExportPacket[NotebookRead[PreviousCell[]], "InputText"]]], {"\r\n " -> "", "\r\n" -> ","}] <> "}", ...


5

You can check also the docs for PrecedenceForm for examples. Precedence can be used to force parenthesization. If you put a low-ish number, you will likely get a parenthesis. I am afraid I cannot help with the fourth argument (group).


10

It is well-documented! According to the Documentation page for StandardForm, StandardForm generates output that gives a unique and unambiguous representation of Wolfram Language expressions, suitable for use as input. » StandardForm is the standard format type used for both input and output of Wolfram Language expressions in notebooks. ...


0

(The full code is at the end of this post, put together into a shortcut ctrl-| that copies the cell containing the selection, wraps the selection in brackets, and places the cursor before the brackets so as to allow the user to type some function to apply to that subexpression.) My solution is by no means pretty nor bulletproof. Most checks are done by ...


4

You can get this behaviour by setting StucturedSelection to True at the Global`, Notebook, or Cell level. See the Options for Expression Input and Output guide. This can be done with the Options Inspector or with SetOptions. To set it at the notebook level: SetOptions[EvaluationNotebook[], StructuredSelection -> True] After this is done you will only ...



Top 50 recent answers are included