New answers tagged

3 votes
Accepted

Unable to get proper Latex format from Mathematica

TeXForm can be used to convert the lists, or any Mathematica expression, to LaTeX. In this case you may want use TeXForm with <...
LouisB's user avatar
  • 12.4k
4 votes
Accepted

Making a dynamic table

Unfortunately, TableForm is not very flexible. Therefore, you have to insert the spaces by hand: ...
Daniel Huber's user avatar
  • 50.5k
4 votes
Accepted

How can I keep the form when I use Expand[2a+3b]^5 and apply to all elements of a list?

One way of many myex = (x + y)^5 e = myex /. {x -> HoldForm[2 a], y -> HoldForm[3 b]} Expand[e] Expand@ReleaseHold[e] For formatting, you could use ...
Nasser's user avatar
  • 142k
0 votes

Manipulation Table

...
Syed's user avatar
  • 49.3k
1 vote

Manipulation Table

SeedRandom[1234]; m = RandomInteger[5, {9, 10}]; Grabbing kglr's data and using ReplacePart: ...
E. Chan-López's user avatar
1 vote

Manipulation Table

Using kglr's data SeedRandom[1234]; m = RandomInteger[5, {9, 10}]; p = Prepend[All] /@ Position[m[[5]], 0] {{All, 2}, {All, 8}} Using ...
eldo's user avatar
  • 62.2k
5 votes
Accepted

How can I output rational numbers in properly formatted parentheses?

Here is a simple solution with boxes. DisplayForm[RowBox[{"(", ToBoxes[15/2], ")"}]]
Domen's user avatar
  • 22.3k
5 votes

How can I output rational numbers in properly formatted parentheses?

One way would be: ToString@TraditionalForm@MatrixForm[{15/2}] that gives:
vindobona's user avatar
  • 2,791
6 votes

How can I output rational numbers in properly formatted parentheses?

Since this is just for display purpose, why not simply use MaTeX? ...
Nasser's user avatar
  • 142k
4 votes
Accepted

How can I change x -- a into x + a when using Defer?

one way ...
Nasser's user avatar
  • 142k
4 votes

How can I change x -- a into x + a when using Defer?

You can use Inactive. This way the other arguments will still evaluate. ...
Syed's user avatar
  • 49.3k
6 votes
Accepted

How can I reduce the time to select three points on sphere to make an equilateral triangle?

The same way as my previous answer. https://mathematica.stackexchange.com/a/289295/72111 ...
cvgmt's user avatar
  • 70k
1 vote

What is wrong when I use Length[{a, b, c}] == 3 in this code?

Another way using Array and Cases: ...
E. Chan-López's user avatar
2 votes

What is wrong when I use Length[{a, b, c}] == 3 in this code?

Some variations: ...
Syed's user avatar
  • 49.3k
2 votes
Accepted

What is wrong when I use Length[{a, b, c}] == 3 in this code?

You can use Table[If[CountDistinct[{a, b, c}] == 3, {a, b, c}, Nothing], {a, 3}, {b, 3}, {c, 3}]; Flatten[%, 2] {{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {...
minhthien_2016's user avatar
2 votes

What is wrong when I use Length[{a, b, c}] == 3 in this code?

Add DeleteDuplicates or Union. ...
herbertfederer's user avatar
0 votes

Apply conditional styling to the rows of a table

Since "row number" is not clearly specified in the OP, here I just assume that the first row ({0, 0, 0, 0, 0, 0}) has row number 1. Using MapIndexed: <...
sci707's user avatar
  • 146
1 vote

Apply conditional styling to the rows of a table

Dataset[table1, ItemStyle -> _?(PrimeQ[# - 1] &) -> Bold, Background -> (If[PrimeQ[#2[[1]] - 1], Cyan, White] &)]
kglr's user avatar
  • 392k
2 votes

Apply conditional styling to the rows of a table

Grid has flexible formatting options for table items compared to TableForm. The syntax is also cleaner. ...
Syed's user avatar
  • 49.3k
1 vote

Apply conditional styling to the rows of a table

...
eldo's user avatar
  • 62.2k

Top 50 recent answers are included