auctex-devel
[Top][All Lists]
Advanced

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

Re: set the latex binaries, locally to different texlive distributions


From: Uwe Brauer
Subject: Re: set the latex binaries, locally to different texlive distributions
Date: Thu, 08 Jun 2023 17:59:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> Uwe Brauer <oub@mat.ucm.es> writes:

> Personally, I have the following in my .emacs file:

> (defun TeXlive (year)
>   "Use TeXlive with the given year (given as string), nil if no TeXlive."
>   (interactive
>    (let* ((year
>          (directory-files "/usr/local/texlive/" nil "\\`[0-9]+\\'")))
>      (setq year
>          (completing-read (format "Year to use (default %s): "
>                                   (car (last year)))
>                           (cons "none" year)
>                           nil t nil nil (car (last year))))
>      (list (unless (string= year "none") year))))
>   (let ((path (getenv "PATH")))
>     (while (string-match "/usr/local/texlive/[0-9]+/bin/[^:/]*:" path)
>       (setq path (replace-match "" t t path)))
>     (when year
>       (let* ((dir (format "/usr/local/texlive/%s/bin" year))
>            (defs (directory-files dir nil "\\`[-a-zA-Z0-9_]+\\'"))
>            (arch (cond ((null defs) (error "No architectures in %s" dir))
>                        ((null (cdr defs)) (car defs))
>                        (t
>                         (completing-read "Architecture? " defs nil t nil nil 
> defs)))))
>       (setq path (concat dir "/" arch ":" path))))
>     (setenv "PATH" path)))

> I call it as

> M-x TeXlive RET

Thanks very much, that looks very nifty.


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of the Ukraine.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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