Tag Info

Hot answers tagged

7

Add this to your notebook or init file $PrePrint = If[MatrixQ[#], MatrixForm[#], #] &; Then all matrices will automatically display as MatrixForm and If you want to format lists as column vectors also, try $PrePrint = Which[MatrixQ[#], MatrixForm[#], VectorQ[#], ColumnForm[#], True, #] &; Now also


3

Let me through a first version into the room: SetAttributes[echo, HoldAll]; echo[x___] := StringRiffle[{##}, ", "] & @@ Function[arg, ToString[Unevaluated[arg], InputForm], {HoldFirst}] /@ Hold[x]; Now you get Print[TemplateApply[">``<", echo[2^2, "foo", 2 + 2, None]]] (* >2^2, "foo", 2 + 2, None< *) Be aware that you might ...


2

As @kattern pointed out, MatrixForm will pretty print your lists to look like matrices. {{0}, {1}, {0}, {-1}} // MatrixForm A word of caution, however: MatrixForm can get in the way of your calculations if you are not careful. See this question and the related answers: Why does MatrixForm affect calculations?. For instance, you could get bitten by ...


1

I know I have answered a very similar question before but I can't find it now. Of what I can find my own question How can I get the unchanged Box form of an arbitrary expression? is probably closest, though more recently Why aren't parentheses ( ) an expression in Mathematica? maybe closer in application to what you need. For pursuing your goal it is ...


1

I'm running V10.1 on OS X 10.10.2 (Yosemite). There may be a problem on OS X. On all versions of OS X prior to Yosemite the system font was Lucida Grande. On Yosemite it is Helvetica Neue. So I tried both. ButtonLabelStyle[x_] := Style[x, 9, FontFamily -> "Helvetica Neue"] Button["//ContractBasis" // ButtonLabelStyle, Null, ImageSize -> 85] ...



Only top voted, non community-wiki answers of a minimum length are eligible