Simple math editor/typesetter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple math editor/typesetter

Nick Chen
Hi

(Cross-posted to the Pharo mailing list because that's what I'm using primarily
but I'm also interested in packages that work in Squeak)

I'm working with some simple math equations and am looking for a nicer way to
display them. Is there any existing work that I might be able to re-use/build
upon?

For instance, given this equation, (1+2/3)*4 I would like to see it displayed
like the Equation Editor in Microsoft Word or the equations in a Mathematica
notebook. See attached screenshots:

Math Equation in Microsoft Word

Equation in Mathematica

I'm not looking for anything fancy. Something simple to get me started would
be helpful as well.

I looked briefly at Dr. Geo but I don't think it supports displaying equations in that
manner.

Thanks!

--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: Simple math editor/typesetter

Gary Dunn-2

I use Lyx on top of LaTeX, then export to image which can be imported into Squeak. All very manual. I recall seeing where someone was piping through LaTeX to do the job on the fly. I should think that would produce a print file easily, a bit harder to make a little illustration for on-screen, interactive use.

Gary Dunn
Open Slate Project
http://openslate.org

On Sep 11, 2011 4:43 AM, "Nick Chen" <[hidden email]> wrote:

Hi

(Cross-posted to the
http://forum.world.st/Simple-math-editor-typesetter-td3805250.html Pharo
mailing list  because that's what I'm using primarily
but I'm also interested in packages that work in Squeak)

I'm working with some simple math equations and am looking for a nicer way
to
display them. Is there any existing work that I might be able to
re-use/build
upon?

For instance, given this equation, (1+2/3)*4 I would like to see it
displayed
like the Equation Editor in Microsoft Word or the equations in a Mathematica
notebook. See attached screenshots:

http://forum.world.st/file/n3805256/word.png

http://forum.world.st/file/n3805256/mathematica.png

I'm not looking for anything fancy. Something simple to get me started would
be helpful as well.

I looked briefly at Dr. Geo but I don't think it supports displaying
equations in that
manner.

Thanks!

--
Nick

--
View this message in context: http://forum.world.st/Simple-math-editor-typesetter-tp3805256p3805256.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: Simple math editor/typesetter

K K Subbu
See http://www.squeaksource.com/LatexMorph.

LatextMorph is a typesetter engine that converts LaTeX snippets into Images.
It can be made to work in real time by scripting a Text object to modify its
input field. It was written primarily for middle school students using Linux
desktops. If you are using it on Wintel or Mac, it may need additional work in
terms of writing the glue code for MicTeX.

Subbu

On Sunday 11 Sep 2011 9:57:33 PM Gary Dunn wrote:

> I use Lyx on top of LaTeX, then export to image which can be imported into
> Squeak. All very manual. I recall seeing where someone was piping through
> LaTeX to do the job on the fly. I should think that would produce a print
> file easily, a bit harder to make a little illustration for on-screen,
> interactive use.
>
> Gary Dunn
> Open Slate Project
> http://openslate.org
>
> On Sep 11, 2011 4:43 AM, "Nick Chen" <[hidden email]> wrote:
>
> Hi
>
> (Cross-posted to the
> http://forum.world.st/Simple-math-editor-typesetter-td3805250.html Pharo
> mailing list  because that's what I'm using primarily
> but I'm also interested in packages that work in Squeak)
>
> I'm working with some simple math equations and am looking for a nicer way
> to
> display them. Is there any existing work that I might be able to
> re-use/build
> upon?
>
> For instance, given this equation, (1+2/3)*4 I would like to see it
> displayed
> like the Equation Editor in Microsoft Word or the equations in a
> Mathematica notebook. See attached screenshots:
>
> http://forum.world.st/file/n3805256/word.png
>
> http://forum.world.st/file/n3805256/mathematica.png
>
> I'm not looking for anything fancy. Something simple to get me started
> would be helpful as well.
>
> I looked briefly at Dr. Geo but I don't think it supports displaying
> equations in that
> manner.
>
> Thanks!
>
> --
> Nick
>
> --
> View this message in context:
> http://forum.world.st/Simple-math-editor-typesetter-tp3805256p3805256.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Simple math editor/typesetter

Nicolas Cellier
In reply to this post by Gary Dunn-2
I add a commercial software where I could do this.
The idea is to have a tree representing the expression

(1+2/3)*4

Assuming your infix expression used usual mathematical precedence,
you have a tree MultiplyExpression( AddExpression( 1 ,
DivideExpression( 2 , 3 ) ) , 4)

Then you can have a printer of the tree using the visitor pattern.
This way, you can have code generation output (C, Matlab etc...) of
your mathematical expression, LaTeX being just one special case, and
Morph composition just another one.
As long as you do not deal with page layout, the composition is quite
straight forward...

MorphComposer>>visitDivideExpression: aDivideExpression
    numeratorMorph := aDivideExpression numerator iterateFromVisitor: self.
    denominatorMorph := aDivideExpression denominator iterateFromVisitor: self.
    fractionBar := (numeratorMorph width max: denominatorMorph width)
+ self extraWidth.
   some more code to create a composite morph with correct alignment...

Nicolas

2011/9/11 Gary Dunn <[hidden email]>:

> I use Lyx on top of LaTeX, then export to image which can be imported into
> Squeak. All very manual. I recall seeing where someone was piping through
> LaTeX to do the job on the fly. I should think that would produce a print
> file easily, a bit harder to make a little illustration for on-screen,
> interactive use.
>
> Gary Dunn
> Open Slate Project
> http://openslate.org
>
> On Sep 11, 2011 4:43 AM, "Nick Chen" <[hidden email]> wrote:
>
> Hi
>
> (Cross-posted to the
> http://forum.world.st/Simple-math-editor-typesetter-td3805250.html Pharo
> mailing list  because that's what I'm using primarily
> but I'm also interested in packages that work in Squeak)
>
> I'm working with some simple math equations and am looking for a nicer way
> to
> display them. Is there any existing work that I might be able to
> re-use/build
> upon?
>
> For instance, given this equation, (1+2/3)*4 I would like to see it
> displayed
> like the Equation Editor in Microsoft Word or the equations in a Mathematica
> notebook. See attached screenshots:
>
> http://forum.world.st/file/n3805256/word.png
>
> http://forum.world.st/file/n3805256/mathematica.png
>
> I'm not looking for anything fancy. Something simple to get me started would
> be helpful as well.
>
> I looked briefly at Dr. Geo but I don't think it supports displaying
> equations in that
> manner.
>
> Thanks!
>
> --
> Nick
>
> --
> View this message in context:
> http://forum.world.st/Simple-math-editor-typesetter-tp3805256p3805256.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Simple math editor/typesetter

Nicolas Cellier
2011/9/11 Nicolas Cellier <[hidden email]>:
> I add a commercial software where I could do this.

s/I add/I had/

> The idea is to have a tree representing the expression
>
> (1+2/3)*4
>
> Assuming your infix expression used usual mathematical precedence,
> you have a tree MultiplyExpression( AddExpression( 1 ,
> DivideExpression( 2 , 3 ) ) , 4)
>
> Then you can have a printer of the tree using the visitor pattern.
> This way, you can have code generation output (C, Matlab etc...) of
> your mathematical expression, LaTeX being just one special case, and
> Morph composition just another one.
> As long as you do not deal with page layout, the composition is quite
> straight forward...
>
> MorphComposer>>visitDivideExpression: aDivideExpression
>    numeratorMorph := aDivideExpression numerator iterateFromVisitor: self.
>    denominatorMorph := aDivideExpression denominator iterateFromVisitor: self.
>    fractionBar := (numeratorMorph width max: denominatorMorph width)
> + self extraWidth.
>   some more code to create a composite morph with correct alignment...
>
> Nicolas
>
> 2011/9/11 Gary Dunn <[hidden email]>:
>> I use Lyx on top of LaTeX, then export to image which can be imported into
>> Squeak. All very manual. I recall seeing where someone was piping through
>> LaTeX to do the job on the fly. I should think that would produce a print
>> file easily, a bit harder to make a little illustration for on-screen,
>> interactive use.
>>
>> Gary Dunn
>> Open Slate Project
>> http://openslate.org
>>
>> On Sep 11, 2011 4:43 AM, "Nick Chen" <[hidden email]> wrote:
>>
>> Hi
>>
>> (Cross-posted to the
>> http://forum.world.st/Simple-math-editor-typesetter-td3805250.html Pharo
>> mailing list  because that's what I'm using primarily
>> but I'm also interested in packages that work in Squeak)
>>
>> I'm working with some simple math equations and am looking for a nicer way
>> to
>> display them. Is there any existing work that I might be able to
>> re-use/build
>> upon?
>>
>> For instance, given this equation, (1+2/3)*4 I would like to see it
>> displayed
>> like the Equation Editor in Microsoft Word or the equations in a Mathematica
>> notebook. See attached screenshots:
>>
>> http://forum.world.st/file/n3805256/word.png
>>
>> http://forum.world.st/file/n3805256/mathematica.png
>>
>> I'm not looking for anything fancy. Something simple to get me started would
>> be helpful as well.
>>
>> I looked briefly at Dr. Geo but I don't think it supports displaying
>> equations in that
>> manner.
>>
>> Thanks!
>>
>> --
>> Nick
>>
>> --
>> View this message in context:
>> http://forum.world.st/Simple-math-editor-typesetter-tp3805256p3805256.html
>> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Simple math editor/typesetter

Nick Chen
Yes, I would like it to display using Morphs so that I can have more options for
interactivity e.g. editing and drag-and-drop.

I already have a parser implemented; this whole thing is part of a bigger
project and I'm working on the display part currently. The Visitor pattern would
be used to do the projection into Morphic.

You mentioned "MorphComposer". Was that part of your original software? Would
you happen to know if there are existing Morphic objects that I could re-use or
would I need to create my own from scratch. I looked at the tiles in
Scratch/Etoys and I would like something more "pretty".

Thanks!

-- Nick

Nicolas Cellier wrote
2011/9/11 Nicolas Cellier <[hidden email]>:
> I add a commercial software where I could do this.

s/I add/I had/

> The idea is to have a tree representing the expression
>
> (1+2/3)*4
>
> Assuming your infix expression used usual mathematical precedence,
> you have a tree MultiplyExpression( AddExpression( 1 ,
> DivideExpression( 2 , 3 ) ) , 4)
>
> Then you can have a printer of the tree using the visitor pattern.
> This way, you can have code generation output (C, Matlab etc...) of
> your mathematical expression, LaTeX being just one special case, and
> Morph composition just another one.
> As long as you do not deal with page layout, the composition is quite
> straight forward...
>
> MorphComposer>>visitDivideExpression: aDivideExpression
>    numeratorMorph := aDivideExpression numerator iterateFromVisitor: self.
>    denominatorMorph := aDivideExpression denominator iterateFromVisitor: self.
>    fractionBar := (numeratorMorph width max: denominatorMorph width)
> + self extraWidth.
>   some more code to create a composite morph with correct alignment...
>
> Nicolas
>
> 2011/9/11 Gary Dunn <[hidden email]>:
>> I use Lyx on top of LaTeX, then export to image which can be imported into
>> Squeak. All very manual. I recall seeing where someone was piping through
>> LaTeX to do the job on the fly. I should think that would produce a print
>> file easily, a bit harder to make a little illustration for on-screen,
>> interactive use.
>>
>> Gary Dunn
>> Open Slate Project
>> http://openslate.org
>>
>> On Sep 11, 2011 4:43 AM, "Nick Chen" <[hidden email]> wrote:
>>
>> Hi
>>
>> (Cross-posted to the
>> http://forum.world.st/Simple-math-editor-typesetter-td3805250.html Pharo
>> mailing list  because that's what I'm using primarily
>> but I'm also interested in packages that work in Squeak)
>>
>> I'm working with some simple math equations and am looking for a nicer way
>> to
>> display them. Is there any existing work that I might be able to
>> re-use/build
>> upon?
>>
>> For instance, given this equation, (1+2/3)*4 I would like to see it
>> displayed
>> like the Equation Editor in Microsoft Word or the equations in a Mathematica
>> notebook. See attached screenshots:
>>
>> http://forum.world.st/file/n3805256/word.png
>>
>> http://forum.world.st/file/n3805256/mathematica.png
>>
>> I'm not looking for anything fancy. Something simple to get me started would
>> be helpful as well.
>>
>> I looked briefly at Dr. Geo but I don't think it supports displaying
>> equations in that
>> manner.
>>
>> Thanks!
>>
>> --
>> Nick
>>
>> --
>> View this message in context:
>> http://forum.world.st/Simple-math-editor-typesetter-tp3805256p3805256.html
>> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>