On Tue, May 2, 2023 at 12:19 AM Arash Esbati <ar...@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.z...@gmail.com> writes:
>
> > I commented out the `company-fuzzy` and `company-math` packages, now
> > it works.
> >
> > But I really want to have the feature provided by `company-math`, and
> > it seems that my following configuration seems to be both chaotic and
> > problematic:
> > [...]
> > If anyone has experience about how to configure and use this package
> > better, I will be very grateful.
>
> I have no idea about company-math,

See https://github.com/vspinu/company-math for more information.

My current configuration:

(use-package company-math
  :hook
  ;; This will enable the company-math backend for LaTeX mode
  (LaTeX-mode . (lambda ()
          (setq-local company-backends
                  (append '((company-math-symbols-latex company-latex-commands))
                      company-backends))))
  )

See the attached file for the results returned using your example.

> but AUCTeX offers in-buffer
> completion for (La)TeX macros and math symbols; you could try that.  A
> simple example looks like this for me:
> The example is with corfu and not with company.

What's your corfu configuration? And also see here [1] for the related
discussion.

>  The Capf provided by
> AUCTeX is aware of math mode and doesn't offer math symbols outside math
> environments.  Since AUCTeX adds its Capf to standard Emacs machinery,
> it should also work with standard company backends.

[1] https://github.com/minad/corfu/issues/321#issuecomment-1529834819

> Best, Arash

Reply via email to