help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cdlatex-mode in emacs


From: uzibalqa
Subject: Re: cdlatex-mode in emacs
Date: Thu, 25 Aug 2022 15:03:48 +0000

------- Original Message -------
On Thursday, August 25th, 2022 at 1:07 PM, Thibaut Verron 
<thibaut.verron@gmail.com> wrote:


> On 25/08/2022 14:03, uzibalqa wrote:
> 
> > ------- Original Message -------
> > On Thursday, August 25th, 2022 at 11:39 AM, Thibaut Verron 
> > thibaut.verron@gmail.com wrote:
> > 
> > > On 25/08/2022 12:41, uzibalqa wrote:
> > > 
> > > > ------- Original Message -------
> > > > On Thursday, August 25th, 2022 at 8:08 AM, Thibaut Verron 
> > > > thibaut.verron@gmail.com wrote:
> > > > 
> > > > > On 25/08/2022 08:53, wilnerthomas--- via Users list for the GNU Emacs
> > > > > text editor wrote:
> > > > > 
> > > > > > Aug 25, 2022, 06:33 by eliz@gnu.org:
> > > > > > 
> > > > > > > > Date: Thu, 25 Aug 2022 06:20:09 +0000
> > > > > > > > From: uzibalqa uzibalqa@proton.me
> > > > > > > > Cc: help-gnu-emacs@gnu.org
> > > > > > > > 
> > > > > > > > > > Date: Thu, 25 Aug 2022 03:20:04 +0000
> > > > > > > > > > From: uzibalqa uzibalqa@proton.me
> > > > > > > > > > 
> > > > > > > > > > Does anybody know when cdlatex-mode was introduced into 
> > > > > > > > > > Emacs? I am using Emacs 27.2
> > > > > > > > > > There's no cdlatex-mode in Emacs, only org-cdlatex-mode.
> > > > > > > > > > Is there texmathp.el in emacs, which is a Gnu Package.
> > > > > > > > > > No, not in Emacs.
> > > > > > > > > > It is part of AUCTeX which is a Gnu Package. It comes with 
> > > > > > > > > > Emacs Support for writing
> > > > > > > > > > Latex Files. Could the functionality be included in Emacs. 
> > > > > > > > > > cdlatex-mode is useful for
> > > > > > > > > > rapid writing latex templates and symbols rapidly.
> > > > > > > > > > Could improve using tex-mode and latex-mode immensely in 
> > > > > > > > > > Emacs.
> > > > > > > > > > AUCTeX is on GNU Elpa, and cdlatex is on NonGNU Elpa, so 
> > > > > > > > > > both can be
> > > > > > > > > > directly installed with the package manager. In my opinion, 
> > > > > > > > > > it is the
> > > > > > > > > > right place for such packages, rather than emacs core: this 
> > > > > > > > > > way they can
> > > > > > > > > > release new versions without having to wait for the emacs 
> > > > > > > > > > release cycle.
> > > > > > > > > > (See: org-mode)
> > > > > 
> > > > > tex-mode and latex-mode are extremely basic modes in comparison, I 
> > > > > don't
> > > > > know anybody using them. And it's unfortunate that they preempted the
> > > > > tex- and latex- namespaces, forcing AUCTeX to capitalize its mode 
> > > > > names
> > > > > and variables -- but I digress.
> > > > > I agree with your last evaluation Thibaut. tex-mode and latex-mode are
> > > > > extremely basic modes. Because (as you state) almost nobody using 
> > > > > them,
> > > > > they should be beefed up using ideas from texmathp.el and cdlatex. 
> > > > > With
> > > > > the useful functionalities incorporated, emacs would not need to 
> > > > > always
> > > > > pick up on every release of those packages. But users can get them 
> > > > > seperately
> > > > > for added functionality if they wish.
> > > 
> > > But what would be the advantage of doing that? Both packages are
> > > available on the "official" repository for emacs packages, and can be
> > > installed in a matter of seconds.
> > > Emacs should have good built-in support for all language and hypertext 
> > > modes it
> > > supports.
> 
> 
> Then Emacs will be huge and the release cycle much slower.
> 
> A lot of languages and hypertext modes supported by emacs have
> relatively limited built-in support in comparison with what's available
> in packages.
> 
> Note that I said "relatively" limited, because the built-in support for
> latex is only limited when compared to amazing feats like AUCTeX. Reftex
> (table of contents, multi-file support, cross-references, bibliography
> management), and outline-mode (sectional navigation) are both included
> with emacs, and offer support that even dedicated latex IDEs can have
> trouble imitating.
> 
> > cdlatex was made because tex-mode and latex-mode are very frustrating
> > to do serious work and be productive with them. cdlatex does have problems, 
> > and
> > Emacs Maintainers are capable of doing a better job than relying just on 
> > the work
> > of one person.
> 
> 
> There seems to be a confusion: cdlatex and latex-mode are completely
> different and have different goals. latex-mode, like AUCTeX's
> LaTeX-mode, is a major mode for editing latex files. That covers
> everything from syntax highlighting to reference management to sectional
> navigation to, yes, macro and environment insertion.
> 
> On the other hand, cdlatex is a minor mode which focuses on fast
> insertion of a limited set of macros and environments. Most of its
> features are extensions of AUCTeX features, such as LaTeX-math-mode,
> TeX-electric-sub-or-superscript, etc.
> 
> AUCTeX already existed when cdlatex was invented, and I'm 99% sure that
> its author uses cdlatex on top of AUCTeX, rather than with latex-mode.
> One could argue that cdlatex could be included in AUCTeX. I personally
> would not like this to happen, because cdlatex has a very different
> philosophy and can be a lot more intrusive than AUCTeX.
> 
> By the way, the "one person" maintaining cdlatex is also the original
> author of org-mode, as well as texmathp and RefTeX which are two major
> components of AUCTeX. If anything, that alone convinces me that keeping
> cdlatex and AUCTeX separate is a reasonable choice.
> 
> Most of the problems I see with cdlatex come from the fact that it's a
> rather small package, designed to implement precisely the ergonomics
> intended by its author. The result is an opinionated package which is
> reliably doing exactly what it is supposed to do, but with whom users
> can occasionally disagree. Making it more flexible would come at the
> cost of reduced reliability. And allocating more humanpower to the
> maintenance would not really change anything.
> 
> > > Right now the purpose of each package is clear: built-in basic support,
> > > auctex for advanced IDE-like features, cdlatex for quick math insertion.
> > > (Note that cdlatex is a minor mode, and can be used to insert maths in
> > > any emacs buffer.)
> > > 
> > > > I encourage that tex-mode and latex-mode stop being intertwined 
> > > > together, but
> > > > developed seperately. The syntax is so different that they produce 
> > > > choas when
> > > > all functionality is put in a single file.
> > > 
> > > The file tex-mode.el which implements basic support for both tex, latex
> > > and doctex is less than 4000 lines long. The syntax may be superficially
> > > different, but a lot of concepts are common between the different
> > > languages of the family. Plus, one gets support for tex syntax in latex
> > > documents for free.
> > > 
> > > AUCTeX, too, builds support for latex on top of the support for tex.
> > > 
> > > Best wishes,
> > > Thibaut
> > > Concept that are exactly common should be moved out in a separate files.
> > > tex-mode, latex-mode, etc, can call them. Better to have a number of 
> > > smaller
> > > files but with a well organised design.
> 
> 
> The file seems well organized to me, the code is grouped according to
> the provided features. That's a lot easier to use and manage than having
> to modify n files at exactly the right place anytime one wants to add a
> new feature.
> 
> Most of the contents is common concepts, with little bits of
> instantiation here and there. And a lot of the language-specific content
> (in terms of lines of code) is documentation rather than code. Again,
> that's because tex- and latex- mode do not attempt to implement more
> than basic support for latex files.
> 
> In any case it is a concern for developers, not users. Do you have
> changes that you would like to include in tex-mode.el, but can't because
> of the current file structure?

One feature I did include in my implementation for tex-mode is to highlight
tex commands such as "\sqrt", "\omega" and the rest.  But the starting "\"
is not highlighted in order to distinguish different components such as in 
"\alpha\beta" and "\sin\omega_k".  
 
> Best wishes,
> Thibaut

cdlatex would also be useful for use with texinfo-mode, particularly now that
texinfo uses mathjax.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]