auctex
[Top][All Lists]
Advanced

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

Re: Some LaTeX commands, such as \boldsymbol and \hspace, can't be compl


From: Hongyi Zhao
Subject: Re: Some LaTeX commands, such as \boldsymbol and \hspace, can't be completed in AUCTeX.
Date: Wed, 8 Dec 2021 20:34:07 +0800

On Wed, Dec 8, 2021 at 6:53 PM Jean-Jacques Rétorré
<jj.retorre@gmail.com> wrote:
>
> mer. 08 déc. 2021,  Denis Bitouzé <denis.bitouze@univ-littoral.fr> disait :
>
> > Le 08/12/21 à 11h34, Hongyi Zhao a écrit :
> >
> >> On Ubuntu 20.04.3 LTS, I use the self-compiled git master version of
> >> Emacs and installed AUCTeX, company-math, cdlatex, etc. as a
> >> LaTeX-based document preparation environment.
> >>
> >> But I still found there are some LaTeX commands, such as \boldsymbol
> >> and \hspace, which can't completed automatically when I type some of
> >> their opening characters.
> >
> > Another one, among a lot of others: \linewidth.
> >
> >> Any hints for solving this problem?
> >
> > Compared to LaTeX IDE, e.g. TeXstudio, AUCTeX is much less handy from
> > this point of view. Would be nice for this aspect to be improved :)
> >
> > Regards.
>
> Adds
>
>         (TeX-add-symbols '("linewidth")) :....
>
> in your intit file, and all symbol who lacks.
> Usually they come with the style file associated to a package
>
> (info "(auctex)Adding Support for Macros")

But I meet the following error while running the above command by `M-:
(info "(auctex)Adding Support for Macros") RET`:

user-error: Info file ‘auctex’ does not exist; consider installing it


I install auctex with straight by the following configuration:

```emacs-lisp
(use-package auctex
  :straight (:type git :host nil :repo
"https://git.savannah.gnu.org/git/auctex.git";
           :pre-build (
                               ("./autogen.sh")
                               ("./configure" "--without-texmf-dir"
"--with-lispdir=.")
                               ("make")
                               ;;or
                   ;;(shell-command "./autogen.sh && ./configure
--without-texmf-dir --with-lispdir=. && make")
                   )
           )

  :mode
  ;;https://github.com/jwiegley/use-package#modes-and-interpreters
  ;; https://www.mail-archive.com/auctex@gnu.org/msg07608.html
  ;; 
https://www.gnu.org/software/emacs/manual/html_node/reftex/Installation.html
  ("\\.tex\\'" . latex-mode) ; Must first activate the inferior Emacs latex mode
  :hook
  (LaTeX-mode . TeX-PDF-mode)
  (LaTeX-mode . company-mode)
  (LaTeX-mode . flyspell-mode)
  (LaTeX-mode . flycheck-mode)
  (LaTeX-mode . LaTeX-math-mode)
  (LaTeX-mode . turn-on-reftex)
  (LaTeX-mode . turn-on-cdlatex)

  :init
  ;;https://github.com/raxod502/straight.el/issues/802#issuecomment-863726482
  
;;https://mail.google.com/mail/u/0?ik=7b73d6af10&view=pt&search=all&permmsgid=msg-f%3A1704339235894095762&simpl=msg-f%3A1704339235894095762
  ;;$ mkdir ~/.local/var/auctex
  ;;(setq TeX-auto-global "~/.local/var/auctex/")
  ;;M-x TeX-auto-generate-global RET
  (load "auctex.el" nil t t)
  (load "preview-latex.el" nil t t)

  (require 'reftex) ; Loading RefTeX
  ;;https://www.mail-archive.com/auctex@gnu.org/msg07608.html
  ;;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
  ;;(add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode

  ;;https://github.com/politza/pdf-tools#auto-revert
  ;; Update PDF buffers after successful LaTeX runs
  (add-hook 'TeX-after-compilation-finished-functions
            #'TeX-revert-document-buffer)

  
;;https://stackoverflow.com/questions/18172728/the-difference-between-setq-and-setq-default-in-emacs-lisp
  ;;https://www.gnu.org/software/auctex/manual/auctex/Multifile.html
  ;;If this variable is nil, AUCTeX will query you for the name.
  ;;If the variable is t, AUCTeX will assume the file is a master file itself.
  ;;If the variable is ’shared, AUCTeX will query for the name, but not
  ;;change the file.
  ;;If the variable is ’dwim, AUCTeX will try to avoid querying by
  ;;attempting to ‘do what I mean’; and then change the file.

  ;; C-h f TeX-master-file-ask RET
  ;;TeX-master-file-ask is an interactive and compiled function defined in
  ;;tex.el.

  ;;Signature
  ;;(TeX-master-file-ask)

  ;;Documentation
  ;;Ask for master file, set TeX-master and add local variables.

  ;;Key Bindings
  ;;TeX-mode-map C-c _

  
;;https://mail.google.com/mail/u/0?ik=7b73d6af10&view=pt&search=all&permmsgid=msg-f%3A1705017279168520671&simpl=msg-f%3A1705017279168520671
  
;;https://mail.google.com/mail/u/0?ik=7b73d6af10&view=pt&search=all&permmsgid=msg-f%3A1704842460526558967&simpl=msg-f%3A1704842460526558967
  (setq-default TeX-master 'dwim)

  
;;https://www.gnu.org/software/emacs/manual/html_node/reftex/AUCTeX_002dRefTeX-Interface.html
  (setq
   ;; The AUCTeX-RefTeX Interface
   reftex-plug-into-AUCTeX t

   ;; https://www.mail-archive.com/auctex@gnu.org/msg07667.html
   ;;reftex-enable-partial-scans t
   ;;reftex-save-parse-info t
   reftex-use-multiple-selection-buffers t

   ;;https://www.gnu.org/software/auctex/manual/reftex.html#IDX233
   ;;C-h o reftex-citation RET
   ;;https://www.gnu.org/software/auctex/manual/reftex.html#SEC48
   ;; method 1
   reftex-bibpath-environment-variables
   '("~/texmf/bibtex/bib/local//")
   ;;or
   ;; method 2
   ;; https://www.mail-archive.com/auctex@gnu.org/msg07678.html
   ;;reftex-use-external-file-finders t
   ;;reftex-external-file-finders
   ;;    '(("bib" . "kpsewhich -format=.bib %f"))


   TeX-data-directory (straight--repos-dir "auctex")
   TeX-lisp-directory TeX-data-directory

   ;; Or custom-set-variables as follows.
   ;; M-x describe-variable RET preview-TeX-style-dir RET
   ;;`(preview-TeX-style-dir ,(concat ".:" (straight--repos-dir
"auctex") "latex:"))
   preview-TeX-style-dir (concat ".:" (straight--repos-dir "auctex") "latex:")

   
;;https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/latex/config.el
   TeX-parse-self t ; parse on load
   TeX-auto-save t  ; parse on save
   TeX-auto-untabify t ; Automatically remove all tabs from a file
before saving it.

   ;;Type of TeX engine to use.
   ;;It should be one of the following symbols:
   ;;* ‘default’
   ;;* ‘luatex’
   ;;* ‘omega’
   ;;* ‘xetex’
   TeX-engine 'xetex
   TeX-auto-local ".auctex-auto" ; Directory containing automatically
generated TeX information.
   TeX-style-local ".auctex-style" ; Directory containing hand
generated TeX information.

   ;; ##### Enable synctex correlation.
   ;; ##### From Okular just press `Shift + Left click' to go to the good line.
   ;; ##### From Evince just press `Ctrl + Left click' to go to the good line.
   TeX-source-correlate-mode t
   TeX-source-correlate-method 'synctex
   TeX-source-correlate-start-server t

   ;; automatically insert braces after sub/superscript in math mode
   TeX-electric-sub-and-superscript t
   ;; If non-nil, then query the user before saving each file with
TeX-save-document.
   TeX-save-query nil

   TeX-view-program-selection '((output-pdf "PDF Tools"))
   ))
```



reply via email to

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