all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: uzibalqa <uzibalqa@proton.me>
To: thibaut.verron@gmail.com
Cc: wilnerthomas@tutanota.com, Eli Zaretskii <eliz@gnu.org>,
	help-gnu-emacs@gnu.org
Subject: Re: cdlatex-mode in emacs
Date: Thu, 25 Aug 2022 16:49:30 +0000	[thread overview]
Message-ID: <k8fvO1iIdicGbTzoJR_tIQRE2xnXlTceNrkrrvtunCafAZ_zThCaOcZZ8cXisEYXtSJoDCx4v5OzdKO54DH49wnbIbT2c6uSaSWXtWVEDv0=@proton.me> (raw)
In-Reply-To: <b0b20e17-af6f-da63-a81b-2803c4ce7d92@gmail.com>


------- Original Message -------
On Thursday, August 25th, 2022 at 3:58 PM, <thibaut.verron@gmail.com> wrote:


> 
> On 25/08/2022 17:03, uzibalqa uzibalqa@proton.me wrote:
> 
> > ------- Original Message -------
> 
> > > 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".
> 
> 
> This sounds like a feature which would be common to all tex flavours, and therefore be easy to integrate in the current code base, no?

Correct.  It can be done as follows

(defface texmark-colour

  '( (default :inherit bold)

     ( ((class color) (background light)) :foreground "#00FF00" )

     ( ((class color) (background dark))  :foreground "#00FF00" )

     (t :inherit font-lock-builtin-face) )

  "User defined colour typeface for tex command keywords.")

(defconst texmark-cluster

  `(
    
    (,(rx "\\" word-start (group (or "alpha" "beta" "chi" "delta"

          "Delta" "epsilon" "varepsilon" "eta" "gamma" "Gamma" "iota"))

	  word-end)

     (1 'texmark-colour))

and so on
 
Finally doing

(defun texmark-typeface-enable ()

  "Sets the highlight colour for tex commands."

  (font-lock-add-keywords nil texmark-cluster t)

  (font-lock-flush))



> > cdlatex would also be useful for use with texinfo-mode, particularly now that
> > texinfo uses mathjax.
> 
> 
> cdlatex is a minor mode, so you can activate it in texinfo-mode buffers. Do you run into problems when you do that?
> (Some languages do expect different markup than latex, leading to wrapper packages like org-cdlatex. I don't know texinfo, but I seem to remember that cdlatex supports \( \) as math delimiters, which should be useful for mathjax.)

There can be certain instances where cdlatex might not work for certain environments.  I think that cdlatex
looks at the math context, and if it not as expected, the commands do nothing.  Se really it is not so general
as it ought to be.



  reply	other threads:[~2022-08-25 16:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  3:20 cdlatex-mode in emacs uzibalqa
2022-08-25  6:03 ` Eli Zaretskii
2022-08-25  6:20   ` uzibalqa
2022-08-25  6:33     ` Eli Zaretskii
2022-08-25  6:53       ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-08-25  8:08         ` Thibaut Verron
2022-08-25 10:41           ` uzibalqa
2022-08-25 11:39             ` Thibaut Verron
2022-08-25 12:03               ` uzibalqa
2022-08-25 13:07                 ` Thibaut Verron
2022-08-25 15:03                   ` uzibalqa
2022-08-25 15:58                     ` thibaut.verron
2022-08-25 16:49                       ` uzibalqa [this message]
2022-08-27  6:31 ` [historical remarks] (was: cdlatex-mode in emacs) Uwe Brauer
2022-08-27 15:52   ` [historical remarks] Stefan Monnier via Users list for the GNU Emacs text editor
2022-08-27 16:16     ` uzibalqa
2022-08-27 17:10       ` Alessandro Bertulli
2022-08-27 18:27         ` uzibalqa
2022-08-27 19:40         ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-08-28  9:02           ` Arash Esbati
2022-08-28  9:09             ` Arash Esbati
2022-08-28 15:21             ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-08-28  8:56     ` Arash Esbati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='k8fvO1iIdicGbTzoJR_tIQRE2xnXlTceNrkrrvtunCafAZ_zThCaOcZZ8cXisEYXtSJoDCx4v5OzdKO54DH49wnbIbT2c6uSaSWXtWVEDv0=@proton.me' \
    --to=uzibalqa@proton.me \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=thibaut.verron@gmail.com \
    --cc=wilnerthomas@tutanota.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.