Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Inconsistent syntax for Row and Column?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92747] Re: Inconsistent syntax for Row and Column?
  • From: yatesd at mac.com
  • Date: Sun, 12 Oct 2008 04:32:10 -0400 (EDT)
  • References: <gcq07h$c0r$1@smc.vnet.net>

I have encountered that as well. It is very difficult to add
formatting when using Row.

Row, Column, and Grid are all new functions in Mathematica 6. They
appear to be what I would call 'helper' functions, in that they make
it easier to create the underlying 'box forms' which represent the
formatting you want. In previous versions, you were forced to work
with the box forms directly, which required considerable effort in
reading the documentation and experimentation. The inconsistency lies
in the fact that Row creates a RowBox, which has no options
(Options[RowBox] = {} ), whereas Column creates a GridBox, which has
many options including BaseStyle (evaluate Options[GridBox] to see
them). Many of the options to GridBox allow control of formatting. The
function Grid also creates a GridBox. This points to one solution to
the problem: use Grid[{{Row[{"hello", "world"}]}},BaseStyle-
>{RGBColor[0,0,1],FontFamily->"Times"}] (assuming you want
'helloworld' to be one word) or Grid[{{"hello", "world"}},BaseStyle-
>{RGBColor[0,0,1],FontFamily->"Times"}] if you want 1 row with 2
columns, where 'hello' is in the first column and 'world' is in the
second.

As far as I know, there is no ColumnBox. I think fundamentally RowBox
and GridBox are quite different underlying constructs, but the
functions Row, Column, and Grid seem to imply that they all create
some sort of underlying grid, whereas Row is clearly different to
Column and Grid.

As you point out, using Style is often the easiest way to create the
formatting you want. Style creates a StyleBox, which I believe is new
to Mathematica 6.  It is fine when what you want is not too
complicated, but for anything where you want particular rows, columns
or cells to have special formatting, you are best using Grid (or
learning how to use GridBox directly). Unfortunately, the
documentation on GridBox is pretty sparse.

Regards,

Derek


  • Prev by Date: Re: FindFit
  • Next by Date: Re: Re: Overlapping binning of differences of
  • Previous by thread: Re: Inconsistent syntax for Row and Column?
  • Next by thread: Re: Prime Puzzle with Mathematica [CORRECTION]