Tag Info

New answers tagged

1

Here's a version that doesn't require a temporary file. Linux (needs xclip) SetAttributes[copyUnicode, HoldAll]; copyUnicode[expr_] := With[{ stream = OpenWrite["!xclip -in -selection clipboard", CharacterEncoding -> "UTF-8"] }, WriteString[stream, ToString[Unevaluated@expr, InputForm]]; Close@stream; ]; Example: executing the cell ...


3

Not quite tested embeddedNotebookForm /: MakeBoxes[embeddedNotebookForm[nb : Notebook[cells_List, ___]], StandardForm] := MakeBoxes@ DocumentNotebook[{TextCell@"tag"}] /. {{{Cell["tag"]}} :> Block[{}, List /@ cells /; True], _Notebook | _DocumentNotebook :> nb} So you would do Notebook[...]//embeddedNotebookForm


1

I don't know if it will be possible to produce the Cell dingbat et al, as those don't appear on inline cells. However, you can at least get the formatting of your Cell expression by preventing it from being converted to Box form (doubly, making it inert). Here is a practical example: myPrintTemp[expr_Cell] := Internal`InheritedBlock[{MakeBoxes}, ...


5

As excellently described by andre the problem is that style is applied to the row vectors rather than the array elements themselves, and TableForm is not written to handle this situation. For ease of use you may wish to write a variant of Style that automatically threads over lists: style[args__] := Thread[Style[args], List, 1] Now: m = ...


10

Here is a solution : m = RandomInteger[{-5, 5}, {10, 10}]; m /. {x__, y_ /; y > 0} :> (Style[#, Red] & /@ {x, y}); % // TableForm Explanation about TableForm[] TableForm[] accepts as argument only a List[] of List[]. m /. {x__, y_ /; y > 0} -> Style[{x, y}, Red] seems to be a List[] of List[] : but in fact the red lines have ...


1

Apparently ImageCompose isn't working the same way across the versions, with regard to scaling. You could try either Style[f2@#, Red, 80] by itself or changing the final line to: Map[Show[Rasterize@#, Graphics@Text[Style[f2@#, Red, 80], {59, 59}]] &, grid, {2}] // GraphicsGrid


1

Here's what I've come up with based on the comments and suggestions posted: cheadings = Table["Col" <> ToString[i], {i, 1, 10}]; rheadings = Table["Row" <> ToString[j], {j, 1, 100}]; data = Table[RandomReal[], {j, 1, 100}, {i, 1, 10}]; Dynamic@Pane[ Grid[{ {"", Pane[TableForm[Insert[data, cheadings, 1]], {500, 15}, ScrollPosition ...


1

One day, WRI should get round to implementing and documenting the TableView function properly. It's frustratingly close to what you want: TableView[data] but its use isn't recommended (and the TableHeadings options are not implemented anyway).


3

I'd say it was possible, but some work would be required to make it slick: Pane[ Column[{ Pane[ Grid[Insert[data, headings, 1], Background -> {None, {LightCyan}}], {800, 15}], Pane[ Grid[data], {800, 200}, Scrollbars -> True] }] ]


0

If what you want is just formatting your output in the described way, you can use Column/Grid. MapIndexed[Column[{#1, #2[[1]]}, Alignment -> Center, Dividers -> {False, {False, True, False}}] &, {6., 6.63583, 7.64905, 8.97767, 10.5495, 12.2936, 14.1498, 16.0735, 18.0349, 20.0161, 22.0073, 24.0032, 26.0014, 28.0006, 30.0003, 32.0001, ...


1

I may be missing a subtlety in your question but if you just want the numeric values: lst = {6., 6.63583, 7.64905, 8.97767, 10.5495, 12.2936, 14.1498, 16.0735, 18.0349, 20.0161, 22.0073, 24.0032, 26.0014, 28.0006, 30.0003, 32.0001, 34., 36., 38., 40., 42., 44., 46., 48., 50., 52., 54., 56., 58., 60.}; MapIndexed[#/#2[[1]] &, lst] {6., ...


1

Try this one: Rational@@@Thread[{#, Range[Length[#]]}]&@rootslist[0, 1, 30]


2

You may use for example: pr[n_] := NumberForm[n, Infinity, ExponentFunction -> (Null &)] so that: pr[1.52522*10^7] (* 15252200. *)


3

As Anon suggests, ImageSize is the key. For instance: BarChart3D[Range[5], ImageSize -> 500] fixes the size at 500, no matter how many data points it has. You can find this kind of thing out for yourself using the built in help. When you look at the help file for BarChart3D, found by the shortcut ?BarChart3D, you can read "BarChart3D has the same ...


1

Does decimalPlaces[number_] := SetAccuracy[Floor[number, 0.01], 3] do what you want?


2

I am not certain I understand, but starting with sols = Solve[ . . . ] does this help?: {{x1, y1}, {x2, y2}, {x3, y3}} /. sols; Union[Sort /@ %] {{{-17, 7}, {7, -17}, {13, 13}}, {{-11, 3}, {7, -9}, {7, 9}}, {{-9, -3}, {3, 9}, {9, -3}}, {{-9, 7}, {3, -11}, {9, 7}}, {{-5, -5}, {1, 7}, {7, 1}}, {{-3, -9}, {-3, 9}, {9, 3}}, {{-3, 3}, {3, -3}, {3, 3}}} ...



Top 50 recent answers are included