X-Wei / texmacs-demo

a small demostration of the usage of TeXmacs
7 stars 1 forks source link

Semantic mathematical editing #3

Open Iey4iej3 opened 5 years ago

Iey4iej3 commented 5 years ago

(My English is bad. I write in English so that general international visitors are able to understand.)

Dear author,

Thanks for your efforts writing such an demonstration and an introduction. However, I find an incorrect idea involved in the article and the demonstration, namely, TeXmacs sacrifices the precisions of typesettings in comparison to LaTeX. This is not true.

As far as I understand, TeXmacs precisely addresses the task to visualize the structural markup without sacrificing the controllability. Your test example of "obsession of LaTeX" example in your demonstration, $\mathrm{A}^\intercal$, along with your comments, is quite misleading. It is as easy in TeXmacs to achieve this as in LaTeX. And also, there are source codes of TeXmacs files (.tm files). You can even view the (beautified Lisp-like) source code in TeXmacs (Document -> Source -> Edit the source tree).

In effect, TeXmacs could be pickier than LaTeX. It differentiates * (multiplication) and (function composition or application). I would like to refer to Joris' article Towards semantic mathematical editing.

Especially, there are some issues in your demo from this respect. For example, there should be no spaces around the equality operator =. For the integral, the integrand should be f(x)*d x. You can enable the semantic editing mode in TeXmacs, and you will see that most of your formulae in your demo are semantically incorrect to TeXmacs. By the way, there is a typo of Newton-Leibniz formula.

And there is another advantage of TeXmacs over LaTeX (in fact, TeX): seen as a programming language (sorry, I need to stress that it has source codes), it is much more maintainable than TeX. For example, different constructions like \let, \def, \expandafter, etc, seem to be very error-proning and hard to manage in my eyes. Almost everything is global, and one usually overrides existing variables or macros to achieve goals. I believe that this should play some role in the conflicts of packages in LaTeX. Sometimes the order of including packages is important. The reverse order will simply break the compilation, or lead to incorrect results. To be concrete, let's consider the following C-like code:

static int x, y;
void sqr() {
  y = x * x;
}

We set x be the operand that we want to square, and call function sqr() and retrieve the result by y. Well, usually we don't write codes like this: exposing x,y as global variables which makes the maintenance much harder.

I would like to add that this is not a fault of Knuth, according to his response about the TeX macro programming language:

It would be nice if there were a well-understood standard for an interpretive programming language inside an arbitary application. Take regular expressions — I define UNIX as “30 definitions of regular expressions living under one roof.” [laughter] Every part of UNIX has a slightly different regular expression. Now, if there were a universal simple interpretive language that was common to other systems, naturally I would have latched onto that right away.

X-Wei commented 5 years ago

Many thanks for bring up this issue, highly appreciated ! I'm not an advanced user of TeXmacs and that blog post is more for the introduction, in a practical prospective. I'll update code in this repo as well as that post when I have time. In the mean time, feel free to create pull requests and I'm happy to merge, thanks ! :smiley:

Iey4iej3 commented 5 years ago

I am new to TeXmacs. I wrote much because I am also a newbie of LaTeX but when it does not work, I am forced to go to details about implementations of LaTeX and "enjoy" the hardship of debugging. It is much more difficult than things like \mathrm A^\intercal that does not present even a percent of difficulty of debugging.

Feel free to join the mailing lists Developers are very kind. Once they said that

If you are not able to do something in LaTeX you feel its your fault (maybe because somebody told you that TeX is Turing complete), if you are not able to do something in TeXmacs, then its Joris’ fault. :)

They also call for supports for a stack exchange:

out stack exchange proposal

https://area51.stackexchange.com/proposals/121978/texmacs

is not very active and not reaching the goal for this first part of the admissibility process. We still need 28 questions with more than 10 points.

We (and here I mean also the main developers) think that it would be important for the community and its visibility if we manage to have a forum on Stack Exchange. I think does not take much time to give its own contribution and would be a way to witness the extent of the active TeXmacs user community.

Please, try to cast all your available votes if you already subscribed to the proposal and if you still haven’t done so, please do it. It would be a nice help and somewhat will encourage the developers.