this post was submitted on 24 Oct 2023
1 points (100.0% liked)

Emacs

312 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I have installed the auctex via elpaca but unable to load it. how to do that. please help

top 7 comments
sorted by: hot top controversial new old
[–] nv-elisp@alien.top 1 points 1 year ago (1 children)

Auctex requires a :pre-build step which involves generating elisp files. If that step fails, certain parts will break. There are several ways to configure the build as well. See the various issues on the bug tracker for more info. e.g,

https://github.com/progfolio/elpaca/issues/191

[–] noobaster-pro-007@alien.top 1 points 1 year ago (1 children)
[–] varsderk@alien.top 1 points 1 year ago

Auctex is a notoriously tricky package to get built.

[–] Ok_Advisor1053@alien.top 1 points 1 year ago (1 children)

This is how I got it to work

```
(use-package tex
  :demand t                             
  :elpaca (auctex :pre-build (("./autogen.sh")
                              ("./configure"
                               "--with-texmf-dir=$(dirname $(kpsexpand '$TEXMFHOME'))")
                              ("make")))

... rest of your config)
```
[–] noobaster-pro-007@alien.top 1 points 1 year ago (1 children)

"--with-texmf-dir=$(dirname $(kpsexpand '$TEXMFHOME'))")

didn't got this.

Also when i added the code to my init file it is returning error

[–] noobaster-pro-007@alien.top 1 points 1 year ago

Error (use-package): tex/:catch: Cannot open load file: No such file or directory, tex-site

[–] linusstrang5@alien.top 1 points 1 year ago

Here is the solution I came up with, following the hints given by [[https://github.com/progfolio/elpaca/issues/191]]

 (defun ded:elpaca-build-dir (p)
    "Return the elpaca build directory for package symbol p"
    (-first-item
     (f-directories elpaca-builds-directory
  	                (lambda (dir) (string-match-p (concat "^" (symbol-name p) "$") (f-filename dir))))))

  (use-package auctex
    :elpaca (auctex :pre-build (("./autogen.sh")
                                ("./configure" "--without-texmf-dir" "--with-lispdir=.")
                                ("make")
                                ("install-info" "doc/auctex.info" "doc/dir")
                                ("install-info" "doc/preview-latex.info" "doc/dir")))
    :mode (("\\.tex\\'" . TeX-latex-mode)
           ("\\.tex\\.erb\\'" . TeX-latex-mode)
           ("\\.etx\\'" . TeX-latex-mode))
    :init
    (add-to-list 'Info-additional-directory-list (f-join (ded:elpaca-build-dir 'auctex) "doc"))
    (add-hook 'tex-mode-hook
              (lambda ()
                (load "auctex.el")
                (setq TeX-command-extra-options "-shell-escape")))
    :config
    (setq-default TeX-global-PDF-mode 1)
    (setq-default  preview-scale-function 1.5)
    (setq TeX-auto-save t
          TeX-parse-self t
          default-truncate-lines t
          TeX-save-query nil
          TeX-source-correlate-method 'synctex))