I’ve written a function TableauForm to draw a standard Young Tableau. This problem is related to this one, however, the difficulty is that, a function has to be applied to the list in my case.
This is my first version code:
TableauForm [l : {{__} ..}, opts : OptionsPattern[{Alignment -> {Center, Center},FrameStyle -> Thin, Grid}]] :=
Grid[l,
Frame -> {None, None,
Thread@Rule[Flatten[Function[{a, b}, {a, #} & /@ b] @@@ Transpose[{Range@Length@l, Range /@ Length /@ l}], 1], True]},
Alignment -> OptionValue[Alignment], FrameStyle -> OptionValue[FrameStyle]];
The function works well when evaluate this:
youngTableau = {{1, 2, 3}, {4}};
TableauForm [youngTableau]

Or even this:
TableauForm [youngTableau, FrameStyle -> {Red, Thin}]

But the flaw is that if someone doesn’t wants to show the lines (regardless of such a strange usage of this function) and evaluate this
TableauForm [youngTableau, Frame->None]
The output will still draw up the lines just like the first one.

I’ve put the drawing function into the OptionsPattern, but only make it worse
TableauForm [l : {{__} ..}, opts : OptionsPattern[{Alignment -> {Center, Center},
Frame -> {None, None, (Thread@ Rule[Flatten[Function[{a, b}, {a, #} & /@ b] @@@ Transpose[{Range@Length@#, Range /@ Length /@ #}], 1], True] &)},FrameStyle -> Thin, Grid}]] :=
Grid[l, Frame -> OptionValue[Frame],Alignment -> OptionValue[Alignment],FrameStyle -> OptionValue[FrameStyle]];
Now evaluating TableauForm[youngTableau] will give a table with empty frame.

To sum up and put the problem into another way, how to write a function sharing the same OptionsPattern with Grid only changing some default settings? (Note that some default settings may be a function of the parameters.) Is it possible to put a function into OptionsPattern, or are there any other ways to do this(plot a Young Tableau)?
Frameindependly ofFrameStyle. You can use, FrameStyle -> Transparent– Kuba Jul 18 '13 at 09:14OptionsPattern, add, Frame -> Automatic,to it and add the following to thebody:Frame -> If[OptionValue[Frame] =!= Automatic, OptionValue[Frame], {None, None, ...– Kuba Jul 18 '13 at 09:24If[OptionValue[Frame] =!= None, ...,but my trial is not as good as yours)But the handling is not consistent with FrameStyle or others. And when applied to other functions with default settingsAutomatic,this solution will have to change again. – luyuwuli Jul 18 '13 at 09:34FrameStyle, then runningTableauForm[...,FramStyle->Automatic], I hope to get the defaultGridoutput but I will get a specified one. I think the solution is restricted to the case that the default setting isNone; it will conflict with the options whose default setting isAutomatic. That's why I think the solution is not universal. – luyuwuli Jul 18 '13 at 09:55FrameStyle. OnlyFrame, it works for me with automatic or customFrameStyle. Or maybe I'm missing something. – Kuba Jul 18 '13 at 10:06Frame. I just takeFrameStyleas an example (maybe not a proper example) to point out the possible flaws or restrictions. I'm looking for a more general way to handle this issue. It should work for all functions, all defaultRulesetting, just like the ordinary use ofOptionsPattenin the documentation. – luyuwuli Jul 18 '13 at 10:24