What you see is *NOT* what you get...
- To: mathgroup at smc.vnet.net
- Subject: [mg80898] What you see is *NOT* what you get...
- From: "Q.E.D." <aoe at netzero.net>
- Date: Wed, 5 Sep 2007 02:49:24 -0400 (EDT)
I looked at the example for "Export Text, Tables, or Complete Documents". It's off the "New in 6" "Language for Data Integration" page, the lowest right image, the green/blue table. URL: http://www.wolfram.com/products/mathematica/newin6/content/LanguageForDataIntegration/ This is one of the few examples which doesn't give the actual input, so here is what I reconstructed: Style[Grid[ Apply[{#, TraditionalForm[Factor[x^# - 1]], #2} &, Transpose[{Range[1, 10], {2, 3, 4, 4, 4, 6, 4, 5, 6, 6}}], 2], Alignment -> Center, Frame -> All, Background -> {{Pink, None}, {{LightGreen, LightBlue}}}], FontFamily -> "Times New Roman", FontSize -> 11, FontWeight -> Bold] I couldn't figure out what the right-hand column of numbers was, so I've put them in as a list here. (Now there's a challenge, can you compute those numbers based on what's in this table?) Now when I evaluate this as input, everything matches as far as I can tell, including the use of TraditionalForm. (If nothing else, you've just seen how to make a table with this nifty color scheme.) If I then input and evaluate: Export["table.pdf", %] then the table.pdf file is written to $InitialDirectory which, when viewed, everything (except the fonts) matches the table as shown. However, when I cut and paste the table in place of the % as shown in the "Export Text, Tables, or Complete Documents" example, the table.pdf is different in one very noticeable way. The table.pdf shows the output in StandardForm instead of TraditionalForm as before! (That means -1+x instead of x-1, etc.) Changing to "table.html" produced similar results (StandardForm instead of TraditionalForm) with the fonts matching but the background colors absent. Now *CHANGING* the input a bit might explain some of this: Graphics[Text[ Style[Grid[ Apply[{#, Factor[x^# - 1], #2} &, Transpose[{Range[1, 10], {2, 3, 4, 4, 4, 6, 4, 5, 6, 6}}], 2], Alignment -> Center, Frame -> All, Background -> {{Pink, None}, {{LightGreen, LightBlue}}}], FontSize -> 11, FontWeight -> Bold]]] Now again, export this graphics object (I had to streatch it after pasting) and view the resulting PDF file. This gives a much, much better result, the font is correct now and the table is in TraditionalForm (that's the default for Graphics[] anyway). So adding Graphics[Text[%]] (don't need the FontFamily -> "Times New Roman" either) makes all the difference, but should it? Q.E.D.