Message Boards Message Boards

0
|
4802 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

[?] Mimic "cases" from tex's amsmath into Wolfram Language?

Posted 7 years ago

greetings!

I am trying to create a visual output similar to tex's amsmath cases, in which a giant single curly bracket opens a column of different cases to a function. So far I haven't found any way to duplicate this effect in mathematica. Here are some of the things I tried, in case it sparks your imagination:

StringForm["````", Style["{", 90], Column[{1, 2, 3, 4, 5}]]

This style isn't very adaptive, and the bracket does not align with the column. So inspired by MatrixForm I tried this:

RowBox[{"cases:", "(", "", 
   Column[{1, 2, 3, 4, 5, 6, 7}]}] // DisplayForm

perfect! but when I try a curly bracket...

RowBox[{"cases:", "{", "", 
   Column[{1, 2, 3, 4, 5, 6, 7}]}] // DisplayForm

it's just not changing size... Also it seems that I have to use RowBox because regular Row doesn't do this kind of streching.

Thanks in advance!

p.s. is there a way to render the code that I'm posting so that you see what I mean in each example?

POSTED BY: Lior Samuel

SpanMaxSize does the trick:

Style[DisplayForm@
  RowBox[{"cases", "=", "{", Column[{1, 2, 3, 4, 5, 6, 7}]}], 
 SpanMaxSize -> Infinity]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract