Skip to main content
10 votes
Accepted

Can I mark a local variable as safe for a single file only?

In the elisp manual at C-hig (elisp)File Local Variables we find: You can specify safe values for a variable with a ‘safe-local-variable’ property. The property has to be a function of one argument; ...
phils's user avatar
  • 51.7k
3 votes
Accepted

How to install AUCTeX on Emacs without automatic activation for LaTeX (.tex) files?

From the manual: 1.2.4 Loading the package [...] Once activated, the modes provided by AUCTeX are used per default for all supported file types. If you want to change the modes for which it is ...
Arash Esbati's user avatar
  • 2,020
3 votes
Accepted

LaTeX equation numbers with Emacs

This is a capability of the LSP server. With TexLab, it can look like this: You need to install a LSP server and activate it within Emacs, I did M-x eglot RET and took texlab.
Arash Esbati's user avatar
  • 2,020
2 votes

AUCTeX: Some general macros/command missing from auto-completion/macro insertion

As already explained by @gusbrs it was a typically beginners mistake. I was sure that every LaTeX macro could be invoked with C-c, RET (and am still convinced that this would be less confusing). Now I ...
lukeflo's user avatar
  • 195
2 votes

Distinction between inline and display math instead of default behavior of texmathp

C-h f texmathp says: Determine if point is inside (La)TeX math mode. Returns t or nil. Additional info is placed into ‘texmathp-why’. The function assumes that you have (almost) syntactically correct ...
NickD's user avatar
  • 30.8k
2 votes
Accepted

Auctex 14.0.2 returns errors on (wrong-type-argument number-or-marker-p nil) in run-hooks when opening tex files

My psychic debugger is not the most reliable at the best of times, but my guess is that you are using an unreleased version of Auctex from the git repository, and that it now depends on Emacs 29. Try ...
db48x's user avatar
  • 18.4k
2 votes

Determining AUCTeX Activation in Emacs Buffer: Major Mode Detection Issue

From mode-line-format we find that the "LaTeX/P" in the mode-line is configured via mode-line-modes. From there we find that "LaTeX/P" is simply the value of mode-name so you could ...
dalanicolai's user avatar
  • 7,865
1 vote

AUCTeX: Add "\Clause[optionlist]" to section commands, if package contract is loaded

I don't think it is possible to hook the macro \Clause which takes an optional key-val argument into the machinery how AUCTeX inserts sectioning commands without a bigger surgery. Therefore I suggest ...
Arash Esbati's user avatar
  • 2,020
1 vote
Accepted

How to do an ordinary forward-paragraph in latex-mode?

It depends on whether you want, in addition to the LaTeX version, a new function to do the "ordinary" forward paragraph stuff (by which I mean the Text mode version where a new paragraph ...
NickD's user avatar
  • 30.8k
1 vote

AUCTeX cannot find a working TeX distribution (again)

TL;DR $ sudo zypper install -no-recommends texlive $ sudo zypper install -no-recommends texlive-tex A comment by mxnt prompted me to guess that AUCTeX was not checking for the program I instructed it ...
gboffi's user avatar
  • 614
1 vote

Call of LaTeX via AucTeX 14.0.3 freezes emacs 27.1

I think you're facing two different issues: Updating AUCTeX from 13.x to 14.x: There were some internal changes in AUCTeX, and supposing that you're using the package interface provided by Emacs, you ...
Arash Esbati's user avatar
  • 2,020
1 vote

LaTeX equation numbers with Emacs

The following solution is perhaps less elegant than that in the LSP-based answer, but I figured it wouldn't hurt to share. It looks like this: You can search by label or equation number (as it ...
Paul Nelson's user avatar
1 vote

How to install AUCTeX on Emacs without automatic activation for LaTeX (.tex) files?

I followed the Arash Esbati answer and I noticed that the variable Tex-modes: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so ...
Gabriele's user avatar
  • 1,642
1 vote
Accepted

Stop AUCTeX from automatically adding style based on filename

This is part of AucTeX's customization features. It's explained in the manual. I don't understand all the details, but it appears to include applying styles for files when the filename (in your case ...
Tyler's user avatar
  • 22.4k
1 vote
Accepted

Org-mode LaTeX export set AUCTeX local variables

Here's a slight modification of your final-output filter function that works. It primarily involves getting rid of a test that AFAICT will never evaluate to t: (defun my/org-export-add-lines (output ...
NickD's user avatar
  • 30.8k
1 vote
Accepted

Making cleveref insertions globally available

AUCTeX has a clean interface for hand-written LaTeX package files: You can write a corresponding AUCTeX style file and AUCTeX will load it when you use the package. Say your custom package is called ...
Arash Esbati's user avatar
  • 2,020
1 vote
Accepted

Add parsing of latex-style .el file to LaTeX-hook using AUCTeX

Since AUCTeX release 13.2.3 (2023-12-07) support for completion, fontification etc. for ltcmd (former xparse) is available out of the box (see https://tex.stackexchange.com/a/703376/105447), so you ...
gusbrs's user avatar
  • 796
1 vote

How can I make AUCTeX recognise this macro?

The usual practice for this is to source out your TeX code into a private package, say ab-beamer-addons.sty which looks like this: \ProvidesPackage{ab-beamer-addons} \newcommand{\sectionfigure}[1]{% ...
Arash Esbati's user avatar
  • 2,020
1 vote
Accepted

Unexpected auto indentation by 8 spaces with AucTeX

I don't use Doom Emacs, but I think what you describe is more a feature of Doom Emacs and not AUCTeX. IIUC, you have to adjust the variable +latex-indent-item-continuation-offset: (defconst +latex-...
Arash Esbati's user avatar
  • 2,020
1 vote

Make auctex ask me only for position and width when inserting a minipage environment

AUCTeX in general queries for the next optional argument if the current one is filled with some text and is not a empty string (which is simply hitting RET by the user). For me, when I hit C-c C-e ...
Arash Esbati's user avatar
  • 2,020
1 vote

How to perform incremental search inside math environments in tex/latex documents

I have written a function to temporarily set the value of isearch-filter-predicate (it works with query-replace* functions too): ;; From AUCTeX, but it works as a standalone too: (require 'texmathp) (...
Gabriele's user avatar
  • 1,642
1 vote

Indenting LaTeX code for \if \else \fi statements

It needs more tweaking than the code in the question as you can see in this commit. At any rate, this feature is available in AUCTeX OOTB and if you mark this example: \ifx\condition \dosomething \...
Arash Esbati's user avatar
  • 2,020
1 vote

Preventing `TeX-command-run-all` from shifting focus

I had the exact same problem. It turned out that adding the -g option to the Skim command invoked in TeX-view-program-list solved it for me for Skim+MacOS. Maybe there are similar options for other ...
Adithya Bhat's user avatar
1 vote

AUCTeX not loading its TeX-latex-mode

The override advice: ‘TeX-latex-mode’ indicates that AUCTeX is properly installed and activated and the LaTeX/P also indicates that you're using AUCTeX rather than the native latex-mode [Converting @...
1 vote

AUCTeX automatic extraction: beyond regexps

AUCTeX parser works with regexps, and the position of the matches isn't recorded. I think you have 2 choices: Leave the parser alone and write a function which does the job. Maybe something like ...
Arash Esbati's user avatar
  • 2,020

Only top scored, non community-wiki answers of a minimum length are eligible