News for hackers. Stuff that matters.

guraltsev

Re:I hate LaTeX, I love LaTeX on Thursday May 26, 2022 @11:42AM (#31519725)
Before starting to use TeXmacs I tried LyX. It is true that the typesetting is not optimal, as often pointed out by TeXmacs users, but for me that was not a dealbreaker. I found LyX to be extremely un-customizable. TeXmacs has Scheme that allows you to do potentially anything! That made me very happy coming from Emacs land.

An important thing for me was having context-aware keyboard shortcuts (that are barely possible in LyX).

Another cool thing that seems to be possible that I plan on exploring next is integrating math typing in TeXmacs with sympy and or Maxima. This would allow symbolic manipulation using the above packages directly in TeXmacs.

Re:I hate LaTeX, I love LaTeX on Thursday May 26, 2022 @11:37AM (#31519667)
I recently converted myself to using TeXmacs. I did it because I was constantly getting lost in the minutiae of proofs of a large paper I was working on [1]

The WYSIWYG aspect of TeXmacs was crucial for me because I was able to "think about math" while working on the PC. When doing things in LaTeX I always found myself thinking on paper and then writing down in TeX.

I personally believe that "thinking on paper" is still better for me at the starting stage of mathematical research. However, once the outline of the proof was clear and I needed to clean up details and to write technical proofs then working directly on the PC helped a lot

Another fantastic feature of TeXmacs is the "preview on hover" package. If you have a reference to an equation and you put your mouse over it, TeXmacs can show you the equation in a popup. This was very important when I was going over the draft once I have written the proofs and when checking for correctness. I have hundreds of numbered equations and checking that I was citing the correct bound in a proof of a lemma was made much easier by this feature. Before passing to TeXmacs I tried to find way to do this efficiently using LaTeX. Intrestingly enough very few PDF's have a "breadcrumbs" feature for you to be able to jump to a reference and then go "back" to your previous position in the paper. The closest I came was Emacs+Auctex+preview. Since Emacs is scriptable and already has the notion of "mark ring" that is essentially the "breadcrumb" feature, that helped a lot.

TeXmacs also has some shortcomings. While it is written in Scheme, I found discoverability and documentation lacking. However, there is a very friendly community of people that are very active on the forum. Any question I had about how to do something was usually answered in at most a day. This is actually great because the "basics" that one needs to work immediately are actually well documented. The things that are hidden are more advanced features. For example, there is math folding [2] that I accidentally discovered browsing the menus and then figured/asked on the forums. I had to ask about how to remove sub-sub-sections from the TOC [3] but, to be fair, even in LaTeX you cannot figure it out unless you know the macro.

The thing that I miss most from Emacs is the "self-documenting" nature of all the Lisp (Scheme in the case of TeXmacs) code and functions and the somewhat quirky search/replace functionality in TeXmacs. Honestly, the regexp search and replace (especially with a visual help package) in emacs was very powerful. But I believe the community is actively working on the former.

[1] https://arxiv.org/abs/2205.09851

[2] http://forum.texmacs.cn/t/folding-computation/551/5

Re:I hate LaTeX, I love LaTeX on Thursday May 26, 2022 @11:25AM (#31519502)
I recently published a paper [1] that I wrote using TeXmacs and then converted to LaTeX before publishing it on arXiv. The conversion was not completely seamless: it took me around 2 hours to tweak it to my liking. However, I feel that I would not have been able to finish the paper without TeXmacs. Honestly, 2 hours was a fair trade-off. Probably I would have spent a similar amount of time aligning equations by hand once I was done with writing. Texmacs -> LaTeX conversion actually made that part more streamlined.

[1] https://arxiv.org/abs/2205.09851

Re:Differential Forms and Integration (2008) [pdf] on Friday May 22, 2020 @08:24PM (#23278633)
There is a philosophical reason to distinguish forms, manifolds, and integration. When you talk about integrating a form on a manifold you concentrate on the result: the number you obtain. You almost do not notice that the form and the manifold exist somewhat independently. If you think of expressing forms via coordinates, you already need to have a manifold (so also a coordinate system) in place to even "define" the form. However this is not necessarily the case.

Let me be more specific:

Suppose your ambient space is $\R^3$ and you are looking at a vector field (let us say your space is full of water and the vector field models the velocity of the movement of water at every point). The vector field $V$ is a $1$-form, it exists.

Now suppose you insert a membrane (2d surface) into the water and want to compute how much water flows through it at any given moment in time. This is the "flow" of $V$ through your surface $S$.

If you go and look how to do this there are intuitive pictures and the computation reduces to 1) parameterize the 2d surface using 2 variables $(u,v)$ 2) compute some partial derivatives of the parameterization 3) wedge product them 4) take the dot product with $V$ 5) integrate in $u$ and $v$. At first this seems like magic but whoever is explaining the procedure draws a bunch of pictures to explain why this is reasonable and tries to convince you. Usually they eventually manage.

However this is only part of the story. You see, you have a map that inputs $V$(the vector field) and $S$ the surface and spits out a number. Furthermore this map is intuitively "continuous" in the sense that if you change $V$ a bit or $S$ a bit you do not expect the result to change too much. However if you try to prove this or explain this at any mathematical level, you run into trouble!!!

The reason is that the way you defined integrating the vector field DEPENDS on the parameterization, and worse, it depends on it at the first step of your procedure. If you have to membranes that are "close" how can you even think that their parameterizations be "close". You can't! Even the SAME surface can have drastically different parameterizations.

So clearly you need to abstract away the coordinates so you can talk about continuity, stability, perturbation.

Let us get back to abstract definitions. You know that you can integrate 2-forms on 2-manifolds (2d surfaces). You are used to having a 2-form DEFINED on a 2-manifold (so you don't really see the difference between integration and 2-forms). However we do know that we have this rather standard procedure of computing the flow of a vector field (1-form) through a 2-manifold (2d surface). How so? It seems that for whatever reason a vector field is ALSO a 2-form. And it is a 2-form just floating around R^3 in the same way a vector field (the velocity of water) exists independently of whether you are computing how much of it is flowing through a given surface.

So how is this the case? This is exactly an instance of Hodge duality. Since the ambient space $\R^3$ has a volume form (3-form) there is an intrinsic association from $k$ forms to $3-k$ forms (specifically, given a $k$ form the associated $3-k$ form is that unique $3-k$ form such that wedged with the original gives you the volume form).

So there you go! Given a vector field you have an associated 2-form in $\R^3$ that is there, by itself, without needing any 2-manifold to justify its existence. In practice if $V=(V_x,V_y,V_z)$ then the two form is $V_x dy dz + V_y dz dx + V_z dx dy$.

And if by chance it encounters a 2d surface it can naturally be integrated through it. The Hodge duality above actually expresses in a very concise form the multiple points on HOW to compute the flow (the procedure we started with).