Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LaTeX parser

80 views
Skip to first unread message

Merciadri Luca

unread,
Oct 17, 2009, 9:36:58 AM10/17/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Is there an already-written program for HP50g which aims at parsing a TeX/LaTeX
formula and rendering it? I think that it would be really interesting.

For example, you can keep formulas in your HP50g by saving them, but
they are *always* re-parsed and transformed, to be simplified. It
sometimes does nothing to your formula, but it sometimes transform it
to something else which equals the same, but that you do not want to
save. Consequently, I am sometimes obliged to write some (La)TeX code
on my computer, save it on the SD card, put the SD card in my HP50g,
then read these formulas, but the output can be really messy,
especially with Taylor series. (Let's say you cannot remember of the
Taylor expansion at 0 (that is, McLaurin formula) of, say,
cotanh^-1(x) and that you want it to be kept, at least until the 3th
order, on your calculator. How do you achieve this?)

If you have another way to do this, please let me know.
But I will be interested too if there exists a parser. If I had time,
I would implement it!

Thanks folks.
- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAkrZyHoACgkQM0LLzLt8MhxE7QCgluEjSFuvWR5SMrb2VQSONNMS
XMcAoKfKazFeEwdIJ6nCUtMAcEyAdxzy
=qrG8
-----END PGP SIGNATURE-----

Merciadri Luca

unread,
Nov 20, 2009, 9:06:22 AM11/20/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here is a quick survey about the first message.

Merciadri Luca <Luca.Me...@student.ulg.ac.be> writes:

> Is there an already-written program for HP50g which aims at parsing a TeX/LaTeX
> formula and rendering it? I think that it would be really
> interesting.

There is actually no program like this.

> If I had time, I would implement it!

I have some free time for the moment. I have already begun working on
this, and I realized that, as it was impossible for the HP 50G to give
the listing of a directory to its stdout, doing things on the computer
is going to be easier.

I mean... My idea is to use my C program as a standalone one which
takes as input on the command line the .tex file(s) which need(s) to be
transformed. This idea is interesting as if you have lots of .tex
files containing such equations, there is no problem: you can still
use something like

./myprogram | ls *.tex 2> /dev/stdin
to output the result of the
$ ls *.tex
on the stdin of myprogram.

However, I do not have a lot of knowledge about HPapine, etc.

As a result, if I manage to make such a C program working, I will need
help from the HP 50G community to ``convert'' the code (that is, there
are only minor modifications, but they need to be done to make this
code working on the calc) to a C code which uses HP's .h libraries.

Is there a volunteer out here?

Thanks.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksGol0ACgkQM0LLzLt8MhzHuACdFxv4MUtFTrj+vCKbLp5n+UG3
UwUAniTEwn9piIHCVGjaLT/JNXj3OQ7I
=7rFG
-----END PGP SIGNATURE-----

Merciadri Luca

unread,
Nov 20, 2009, 9:12:10 AM11/20/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Merciadri Luca <Luca.Me...@student.ulg.ac.be> writes:

> Here is a quick survey about the first message.

[snipped]

> you can still
> use something like
>
> ./myprogram | ls *.tex 2> /dev/stdin
> to output the result of the
> $ ls *.tex
> on the stdin of myprogram.

Okay, it seems to work pretty well with ./myprogram *.tex.


- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksGo7oACgkQM0LLzLt8MhxHHgCeN26bLHkGKEVTUb4eX2ZDdlUH
xhEAn0y8WTq0ykKznuLhOz1AkfZUdsU6
=bv+8
-----END PGP SIGNATURE-----

Briancon Tanguy

unread,
Nov 20, 2009, 7:40:13 PM11/20/09
to
Merciadri Luca wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Here is a quick survey about the first message.
>
> Merciadri Luca <Luca.Me...@student.ulg.ac.be> writes:
>
>> Is there an already-written program for HP50g which aims at parsing a TeX/LaTeX
>> formula and rendering it? I think that it would be really
>> interesting.

Yes. BTW it will be interesting to have the other side:
an HP algebric expression goes to LaTeX...

> There is actually no program like this.
>
>> If I had time, I would implement it!
> I have some free time for the moment. I have already begun working on
> this, and I realized that, as it was impossible for the HP 50G to give
> the listing of a directory to its stdout, doing things on the computer
> is going to be easier.
>
> I mean... My idea is to use my C program as a standalone one which
> takes as input on the command line the .tex file(s) which need(s) to be
> transformed. This idea is interesting as if you have lots of .tex
> files containing such equations, there is no problem: you can still
> use something like
>
> ./myprogram | ls *.tex 2> /dev/stdin
> to output the result of the
> $ ls *.tex
> on the stdin of myprogram.
>
> However, I do not have a lot of knowledge about HPapine, etc.

Sorry for the english (demandez moi une version fran�aise...)


Sorry but I didn't understant what myprogram exactlyd does (or will do):
take a .tex file and what is the output: a c code? An HP object?
If your progran produce some c code no need for HPapine: your c code
will be directly use by the HP.

If the question is taking a .tex formula and get an HP algebric
object "02AB8..." I can't see where HPapine can be usefull...

By the expression "c code" I mean the source code of a program
written in c (what one puts in gcc). I am so sorry
for my english...

A.L.

unread,
Nov 20, 2009, 9:31:43 PM11/20/09
to
On Sat, 17 Oct 2009 15:36:58 +0200, Merciadri Luca
<Luca.Me...@student.ulg.ac.be> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi,
>
>Is there an already-written program for HP50g which aims at parsing a TeX/LaTeX
>formula and rendering it?

For what?...

A.L.

Briancon Tanguy

unread,
Nov 21, 2009, 5:38:08 AM11/21/09
to

I think for the beauty!

A few years ago (I think it is the same now)
you could copy some Mapple equation and paste it in Scientific-word
(which produce a LaTex file) and the same in the other way. Texmacs is I
(think) doing the same kind of things (and it's free...).

On an hp50 you have something like Mapple but nothing like TeX and of
course it will be useless... Transfering files from the hp to a pc takes
more times than just enter the equation on the hp or in your
TeX editors.

So useless! So we needs it!

Tanguy

Merciadri Luca

unread,
Nov 21, 2009, 6:31:15 AM11/21/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Briancon Tanguy <tanguy_...@yahoo.fr> writes:

> Yes. BTW it will be interesting to have the other side:
> an HP algebric expression goes to LaTeX...

For sure, but expressions which are typed on the HP 50g are
habitually less complicated than the ones you could ever type in
LaTeX, aren't they?

> Sorry for the english (demandez moi une version française...)
No problem, I can speak French. (Pas de problème, je peux parler Français.)


>
> Sorry but I didn't understant what myprogram exactlyd does (or will
> do): take a .tex file and what is the output: a c code? An HP object?
> If your progran produce some c code no need for HPapine: your c code
> will be directly use by the HP.

myprogram simply takes as input a list of .tex files (this list has at
least one element). The output is redirected to stdout, and should be
the same as the same formula, but that would be typeset in the HP 50g.
For example, let's say that there is a test.tex file where
$ cat test.tex
\sum_{i=0}^{n}i

That is, you then call myprogram using
$ myprogram test.tex
and it results in
SUM((i=0),(n),(i))

because if you had to type the equivalent of the LaTeX command
\sum_{i=0}^{n}i
on your HP calc, you would type
SUM((i=0),(n),(i))
where SUM is the SIGMA symbol of the HP 50G.

That is, it does not output any .c code. I finally do not need any
hpapine, etc., as this program will be launched on a computer, save
the outputs in distinct files. As a result, it will be possible for
you to transfer the output files (i.e. files having code like
SUM((i=0),(n),(i))
) on your HP, and then directly interpret them.

>> Is there a volunteer out here?

There are lots of things to implement:
* matrices,
* COMB: they can be given as C^{i}_{n} in LaTeX, or even using the
english notation with braces, etc.,
* ...

but there are not so much things to do. If you want, you can answer in
French and English. Do you want me to translate everything that I say
in French too, or do you understand English in a correct way?

Thanks.
- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksHz4MACgkQM0LLzLt8MhxSOwCfUkmNKa0QCTQGqQBjq8RFKnWK
apgAnjcAN+eHZ+1iXLDKvFPb6U6+VMUM
=YR3a
-----END PGP SIGNATURE-----

Merciadri Luca

unread,
Nov 21, 2009, 6:36:33 AM11/21/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A.L. <alew...@aol.com> writes:

As I explained before, taking a LaTeX command and rendering it
directly on the HP could be useful.
Let's say that you have something like
\sum_{i=0}^{n}\left(\sum_{j=1}^{m}C^{i}_{j}\right)
where C^{i}_{j} denotes the number of possible combinations of i
elements among j. You have two solutions if you have to copy these
formulae on your HP:
1. You do this tedious task manually,
2. You save this formula in a .tex file (without anything more), ask
the rendering program, which outputs you (on stdout or in a dedicated
file) directly:
SUM((i=0),(n),(SUM((j=1),(m),(COMB(j,i)))))

It is nice and useful, isn't it? You may wonder when you will use
this, but
* if you have lots of .tex files with huge formulae which may be
useful on the go, wouldn't you like to copy their HP output directly
on your calc?
* ...

'Hope you are convinced.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksH0L8ACgkQM0LLzLt8MhyHKACfdhJIXGA2rYwCbBUObZghf2lu
3wsAn1kaN+etXEb+5XlWzLGSi9e6q0tt
=aMnc
-----END PGP SIGNATURE-----

Merciadri Luca

unread,
Nov 21, 2009, 6:40:50 AM11/21/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Briancon Tanguy <tanguy_...@yahoo.fr> writes:

> I think for the beauty!

As I explained in the last message, that is not only for the beauty,
as beauty is a subjective notion. ^^

> A few years ago (I think it is the same now)
> you could copy some Mapple equation and paste it in Scientific-word
> (which produce a LaTex file) and the same in the other way. Texmacs is
> I (think) doing the same kind of things (and it's free...).

Such transforms are so useful when you do lot of calculations...

> On an hp50 you have something like Mapple but nothing like TeX and of
> course it will be useless... Transfering files from the hp to a pc
> takes more times than just enter the equation on the hp or in your
> TeX editors.

I think Tanguy wanted to say `useful' at the place of `useless'. If it
is not the case, I would not have misunderstood the


> So useless! So we needs it!

sentence, at first glance, with an humorous aftertaste.

BTW, I think that Tanguy prefers the other possibility, i.e. parsing
HP formulae, and rendering them in LaTeX. It can be useful, but it
seems to be less interesting than my sense, doesn't it? (As I said in
my first message of today, you will never write very complicated
formulae on the HP, but the opposite can be true.)


Thanks.


- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksH0cIACgkQM0LLzLt8MhyFfgCgkNwIQItqxC4RX1kevMmLNa/s
2BIAoJmJOC8WgG7V9K5/mhcfkHacBsTB
=zS8Z
-----END PGP SIGNATURE-----

A.L.

unread,
Nov 21, 2009, 9:46:28 AM11/21/09
to

Understand... You have too much free time....

A.L.

Eric Rechlin

unread,
Nov 21, 2009, 11:48:04 AM11/21/09
to
"A.L." <alew...@aol.com> wrote:
> Understand... You have too much free time....

Some people spend their free time watching television or browsing the web.

Some people spend their free time expanding their knowledge, learning how to
make new things, however useful or useless to others.

Some people spend their free time trolling Usenet to ridicule or annoy
others.

To each his own.

Regards,

Eric Rechlin

Merciadri Luca

unread,
Nov 22, 2009, 7:29:38 AM11/22/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Eric Rechlin" <er...@hpcalc.org> writes:

The aim of this thread is not to ridicule others or anything else;
thanks Eric for explaining this to A.L.

Is there any volunteer out here?

Thanks.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksJLrIACgkQM0LLzLt8MhzurgCfcenzk4L2CCDb+C7xGXzB9kKF
kGEAn0NUvQWPCn2m4PaBmi6qyWpx/l5z
=YdFz
-----END PGP SIGNATURE-----

Tim Bradshaw

unread,
Nov 22, 2009, 8:23:31 AM11/22/09
to
On 2009-11-21 11:36:33 +0000, Merciadri Luca
<Luca.Me...@student.ulg.ac.be> said:

> As I explained before, taking a LaTeX command and rendering it
> directly on the HP could be useful.

But is not really possible, since TeX is at its core a layout language
which does not aim to capture semantics. It might be possible if you
restrict yourself to some subset of TeX, (and some of the LaTeX stuff
might help there), but it's not possible in general.

For instance in your example:

$\sum_{i=0}^{n}\left(\sum_{j=1}^{m}C^{i}_{j}\right)$

How does whatever does the translation know that $C^{i}_{j}$ means
combinations: it could mean anything.


A.L.

unread,
Nov 22, 2009, 10:47:39 AM11/22/09
to
On Sat, 21 Nov 2009 10:48:04 -0600, "Eric Rechlin" <er...@hpcalc.org>
wrote:

Talking about yourself?...

Anyway, having LaTex on HP50 is stupid idea

A.L.

Merciadri Luca

unread,
Nov 24, 2009, 10:02:21 AM11/24/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Bradshaw <t...@tfeb.org> writes:

For sure. I should have been more explicit. A one-to-one relationship
between a TeX code and a HP 50g representation is not possible, and it
is therefore not the goal of this thing. Note that one is not able to
put subscripts on the HP 50g. Consequently, a C^{i}_{j} can only be
interpreted the way I explained.

There are only some commands which could be useful, and the
implementation is consequently not very difficult, and not so tedious:
\sum, C^{i}_{j}, \int, \partial, D_.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksL9X0ACgkQM0LLzLt8MhycRACgk8GUk044dchxH6Jklp/BfNJo
iV4Anja4Y1W5hRsXG12GAX8BAri2hYmy
=lrU+
-----END PGP SIGNATURE-----

supergems

unread,
May 19, 2015, 3:59:37 AM5/19/15
to
latextogrob

"A simple script to convert a file with LaTeX formulae into a readable file with HP 50g."

https://bbs.archlinux.org/viewtopic.php?id=117953
https://aur.archlinux.org/packages.php?ID=48628
0 new messages