Message Boards Message Boards

1
|
6413 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Two document formatting questions...

Posted 11 years ago
Hi all:

I'm working on a document for a course that I teach, and I've come up against two problems:

First, I'm showing some mathematica work with a "equals aligned" math cell from the Writing Assistant Palette, and they involve some algebraic fractions.  The program automatically shrinks these fractions, but I'd like to leave them in the 12 point font.  I thought I might be able to get around this by putting an "AllowScriptLevelChange -> False" in the code for the cell, but my attempts failed.  Then I thought I might be able to edit the Stylesheet to do what I wanted, but I don't know how.

Second, I want to put a definition in a frame (which requires a text cell), and I'd like to have some of the cell be left-aligned, and some of the cell to be center-aligned.  Ordinarily I'd just create two cells, but I need all of the contents in a single frame.  Is there a way to do switch alignments mid cell?

Thanks for the help!

Rob Holman
POSTED BY: Rob Holman
2 Replies
Posted 11 years ago
You want to add the following code to your cell (at the cell level): 
  FractionBoxOptions->{AllowScriptLevelChange->False}]
Basically, you want to prevent script level changes inside from the fractions, without allowing any surrounding boxes (like GridBox) to interfere with their own opinions.

You can also do this at a higher or lower level  interactivly by selecting something, opening the options inspector, searching for FractionBoxOptions, and toggling AllowScriptLevelChange. 

As for your second problem, I think you'd want a cell containing two inline cells, each own with its own alignment.
  CellPrint @ Cell[
 
     BoxData[FrameBox[RowBox[{
         Cell["Hello\nI'm left aligned", "Text"],
         Cell["And I am\ncenter-aligned", "Text", TextAlignment -> Center]
     }]]],
 
     "Text" (* or "Input", or whatever you want the overall style to be. *)
 
]
POSTED BY: Itai Seggev
Grid might be useful in this case, if it does not interfere with other requirements:
Grid[{{
  "This\nis left-aligned",
  Style["This\nis center-aligned", TextAlignment -> Center]}}]
POSTED BY: Andre Kuzniarek
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