MathGroup Archive 2005

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

Search the Archive

Re: Text Manipulation


Here's a simple function that produces what you want.

Proposition[foo_] :=
CellPrint[Cell[TextData[{"Propostion ",
     CounterBox[
       "Title",foo],".",
         CounterBox["Section",foo],".",
           CounterBox["Proposition",foo]}], "Text"]]

Then you call it for the desired tag

Proposition["tag"]

You can cut and paste the the output to where you want it. These kinds 
of operations are discussed in the upcoming issue of Mathematica in 
Education & Research (MIER).

http://www.ijournals.net/

Also, with one of our packages, you can easily make this into a palette.

<<FormMaker`

DisplayNotebook[MakeNotebook[
     ActionBox[
       "Insert Proposition",
       Module[{foo},
         foo = InputString["Enter tag:"];
         NotebookWrite[
       InputNotebook[],Cell[TextData[{"Propostion ",
         
CounterBox["Title",foo],".",CounterBox["Section",foo],".",CounterBox["
         Proposition",foo]}],"Text"]]
         ]
       ],NotebookStyle->"Palette"]]

http://omegaconsultinggroup.com/Products/form/

----------------------------------------------
Omega Consulting
The final answer to your Mathematica needs.
http://omegaconsultinggroup.com

On Jun 13, 2005, at 4:51 AM, Garry Helzer wrote:

> I spend a lot of time using Input > Create Automatic Numbering
> Object . . .  to create references of the form : Proposition 3.7.9.
> The relevant part of the cell expression is something like
>
> TextData[{
>    "Propostion\[NonBreakingSpace]",
>
>    CounterBox["Title", "foo"],
>    ".",
>
>    CounterBox["Section", "foo"],
>    ".",
>
>    CounterBox["Proposition", "foo"]
> }]
>
> Here "foo" is a cell label and "Proposition" is a defined cell style.
>
> I would like a more efficient way to do this. What I have in mind is
> something like a function propref["foo"] which when evaluated in
> place changes to Proposition 3.7.9, or a button, or a palette, or
> something.
>
> Any suggestions of the best way to go about this?
>
> Garry Helzer
> gah at math.umd.edu
>


  • Prev by Date: Re: For Loop and Array related
  • Next by Date: Baker-Campell-Hausdorff
  • Previous by thread: Text Manipulation
  • Next by thread: Re: Text Manipulation