Skip to content

Some commands, say, \bra, can't be completed in math mode, while they can be completed in normal literal typesetting mode. #19

@hongyi-zhao

Description

@hongyi-zhao

The testing configuration:

(use-package lsp-mode
 :hook
 (TeX-mode . lsp)
 :custom (lsp-prefer-capf t))

(use-package lsp-latex
  :straight (:host github :repo "ROCKTAKEY/lsp-latex"))

(use-package company
  :hook
  (TeX-mode . company-mode)
  :custom
  ;https://github.com/company-mode/company-mode/issues/14#issuecomment-290261406
  ; Do not downcase the returned candidates automatically
  (company-dabbrev-downcase nil) 
  (company-idle-delay 0) 
  (company-minimum-prefix-length 1))

(use-package company-math)
(use-package math-symbol-lists)
(use-package ac-math)
(use-package company-auctex)

;;https://www.emacswiki.org/emacs/company-math
(defun my-latex-mode-setup ()
  (setq-local company-math-allow-unicode-symbols-in-faces (quote (tex-math font-latex-math-face)))
  (setq-local company-math-disallow-unicode-symbols-in-faces nil)
  (setq-local company-math-allow-latex-symbols-in-faces nil)
;  (setq-local company-backends
;               (append '((company-math-symbols-latex company-math-symbols-unicode company-auctex-macros company-auctex-environments))
;                      company-backends)))

  (setq-local company-backends
               (append '((company-math-symbols-latex company-math-symbols-unicode company-auctex-environments 
                          company-auctex-macros company-capf company-ispell company-latex-commands
                          company-abbrev company-bbdb company-dabbrev-code company-dabbrev
                          company-files company-keywords company-semantic
                         ))
                      company-backends
                      )))
(add-hook 'LaTeX-mode-hook 'my-latex-mode-setup)

image
image

Obviously, this is not the desired result.

Any hints for this problem?

Regards,
HY

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions