MathGroup Archive 2002

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

Search the Archive

Re: Redefing a Numberedfigure-Style in a MyReport Style Sheet

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34075] Re: [mg33791] Redefing a Numberedfigure-Style in a MyReport Style Sheet
  • From: Omega Consulting <omega_consulting at yahoo.com>
  • Date: Wed, 1 May 2002 08:00:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

At 02:50 AM 4/16/2002, Helge Andersson wrote:
>Hello,
>
>Until now I have been using Mathematica just as a tool for calculations and
>datamanipulation. However, lately I've been considering writing reports and
>other documents using the Notebook as a worldprocessor. In some Style
>sheets there are Styles for automatic numbering of equations and figures
>which i would like to use but modify a little bit for my purposes. I have a
>question that came up during my work with changing the format of the
>"Numberedfigure"-Style in the "Report" Style Sheet.
>
>I want to use LEFT adjustment of the figuretext indicataing the number of
>the figure instead of the default Center adjustment. Editing the Style
>Sheet Notebook defing the Style "NumberedFigure" one can see that the
>figurenumber-text is displayed using the CellFrameLabel Option for the main
>Cell.  My question is therefore, Is it possible to left adjust the
>CellFrameLabel  with respect to the whole Cell or is it bound to the center
>of its frames? If the Anser is NO could anyone give me some hints to
>reformulate the Cell definition without using CellFrameLabel option but
>still have the figurenumber-text leftadjusted below the figure. If possible
>I also would like to put some additional text right after the "Figure X" text.
>
>/Helge
>
>Helge Andersson
>Chalmers University of Technology
>Sweden

There are no perfect ways of doing this, but here are some things that you 
can do:

1) Add whitespace to the CellFrameLabel (like a bunch of tabs). This is not 
ideal and assumes that the window size is fixed, but it's easy to do.

2) Insert the CounterBox directly into the cell. For cells that contain 
graphics, this can be a bit tricky so here's a palette that does the trick.

NotebookPut[
   Notebook[{Cell[
         BoxData[ButtonBox["Make Figure", Active -> True,
             ButtonEvaluator -> Automatic,
             ButtonFunction :> Module[{nb = InputNotebook[], in},
                 in = NotebookRead[nb];
                 If[Head[in] =!= Cell, Print[in]; Return[]];
                 in = ReplacePart[in, "NumberedFigure", 2];
                 NotebookWrite[nb,
                   Cell[TextData[{in, "\nFigure ",
                         CounterBox["NumberedFigure"]}], "NumberedFigure",
                     CellFrameLabels -> {{None, None}, {None, None}}]]
                 ]  ]], "Text"]}, WindowClickSelect -> False,
     ShowCellBracket -> False, WindowSize -> {125, FitAll},
     WindowFrame -> "Palette", WindowElements -> {},
     WindowFrameElements -> {"CloseBox"}]]

--------------------------------------------------------------
Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.
http://www.wz.com/internet/Mathematica.html



  • Prev by Date: Re: Mathematica EPS to Distiller PDF Font Problem Solved (?)
  • Next by Date: RE: Test of a pure function
  • Previous by thread: Re: Mathematica EPS to Distiller PDF Font Problem Solved (?)
  • Next by thread: Animation in Flash (.swf)