2022 Developer Survey is open! Take survey.

# Tag Info

## Hot answers tagged auctex

Accepted

### How to let AUCTeX open PDF with pdf-tools

Here's my setup, using auctex-11.89 and pdf-tools-20151224.1159: ;; Use pdf-tools to open PDF files (setq TeX-view-program-selection '((output-pdf "PDF Tools")) TeX-source-correlate-start-...
• 2,915
Accepted

### changing the role of the underline and the minus-sign just in LateX-mode

Something like this: (add-hook 'LaTeX-mode-hook 'my-latex-hook) (defun my-latex-hook () (require 'tex-site) (define-key LaTeX-mode-map "-" (lambda () (interactive) (insert "_"))) (define-key ...
• 13.6k
Accepted

### How to indent items in LaTeX/AUCTeX itemize environments?

@sykora's comment about (setq LaTeX-item-indent -2 LaTeX-indent-level 4) is almost there, but it does mean we spill over to every other environment as well. So, for example, we would also have: \...
• 31k
Accepted

### How to call pdflatex under TeX-PDF-mode?

Just type latex instead of pdflatex at the C-c C-c prompt. TeX-PDF-mode sets the TeX-engine to pdflatex automatically. The command you are entering at the prompt is only representative of what you ...
• 3,816
Accepted

### How to find out what my AUCTeX version is?

It is contained in the AUCTeX-version variable: C-h v AUCTeX-version RET
• 1,831
Accepted

### How to make auto-complete work in AucTeX mode?

After doing a long research in the web and careful examination of ac documentation with a lot of trials on my machine to examine code line by line, I came up with this solution that can have yasnippet ...
• 1,612
Accepted

### How to delete a LaTeX macro while preserving its text content?

Try this function: (defun mg-TeX-delete-current-macro (&optional arg) "Remove the current macro. With an optional argument ARG, delete just the ARG-th macro starting from the innermost." (...
• 3,215
Accepted

### Select images in auctex with preview

If you set LaTeX-includegraphics-read-file to LaTeX-includegraphics-read-file-relative, autocompletion with helm provides this feature: Setting up AUCTeX You can either customize LaTeX-...
• 3,215
Accepted

### How can I preview TeX formulas inline in arbitrary modes?

I've tried to re-use AUCTeX preview-latex but failed and gave up. Org-mode also provide the same feature. Turns out weechat managed to re-use it to automatically show latex preview. I've extracted ...
• 313
Accepted

### how to detect if inside a LaTeX math environment?

The function texmathp defined in AUCTeX (autoloaded from texmathp) does exactly that (ok, actually it does a bit more). Used interactively, it will give you some more information, including whether ...
• 4,093
Accepted

### Auto-inserting last used sub-/superscript values in math formulae

Add to your init file: (defvar mg-TeX-insert-subscript-history nil) (defvar mg-TeX-insert-superscript-history nil) (defun TeX-insert-sub-or-superscript (arg) "Insert typed key ARG times and ...
• 3,215

### How to use AUCTeX and outline-minor-mode together for folding?

Outline mode and the AUCTeX folding facilities are two different beasts that are meant to do broadly the same thing: hide and show selected parts of the buffer. Personally, I find the AUCTeX ...
• 31k
Accepted

### A comprehensive list of shortcuts provided by AUCTeX

Yes, there is an index of keybindings: it's in the index of the AUCTeX manual. Note: I got to this index by googling "auctex manual", opening up the first hit, which is the manual, selecting the HTML ...
• 31k

### How to delete a LaTeX macro while preserving its text content?

From the AUCTeX manual node on Changing the font: C-c C-f C-d Delete the innermost font specification containing point.
• 31k
Accepted

### Gradually learning the keybindings provided by AUCTeX

Modifying my answer from here we can just pull this data out of LaTeX-math-default, which is a list of 4-tuples (CHARACTER MACRO MENU UNICODE) where CHARACTER is the character used to bind it (I ...
• 12.1k
Accepted

### Arara integration in Emacs?

Add the appropriate entry to TeX-command-list. Insert the following code in your init file: (eval-after-load "tex" '(add-to-list 'TeX-command-list '("Arara" "arara --verbose %s" TeX-run-...
• 3,215
Accepted

### Multiple major modes in one buffer (e.g., python-mode & LaTeX-mode)

MMM-mode (multiple major modes) seems exactly what you're looking for. It is mentionned on the emacs wiki. You need to define a submode class to mix LaTeX and python, specifying that python parts ...
• 6,943
Accepted

### Define a new key binding for font (Auctex)

Customize LaTeX-font-list: M-x customize-variable RET LaTeX-font-list RET. Select Math Prefix: for ^C key (the prefix C-c C-f is omitted) and add \mathscr{ to "Math Prefix:" field and } to "Math ...
• 3,215
Accepted

### What is "override advice"?

Some information about advices An advice is mainly a method of last resort to customize the behavior of functions defined in other libraries. There are many variants of advice. Examples are: ...
• 29.8k
Accepted

### AucTeX: can I hide comments?

You can use TeX-fold-comment (C-c C-o C-c) to hide the comment. You need to enable TeX-fold-mode to make use of this functionality. See the AUCTeX manual on folding macros and environments for more ...
• 31k

### Indentation in square brackets

Setting LaTeX-begin-regexp and LaTeX-end-regexp does not help here because inside LaTeX-indent-level-count it searches a backslash before checking the regexp. I got it working by modifying TeX-brace-...
• 81
Accepted

### Formatting of usepackage commands in LaTeX document

If you want a command to stay in a line on its own, add it to LaTeX-paragraph-commands: (setq LaTeX-paragraph-commands '("documentclass" "usepackage")) But, honestly, I didn't ever see anyone trying ...
• 3,215
Accepted

### How to pass flags to the LaTeX compiler with AUCTeX?

Use TeX-command-extra-options (and check out the manual before asking questions ;-) AUCTeX handles in a special way most of the main options that can be given to the TeX processors. When you need to ...
• 3,215
Accepted

### AUCTeX - delete 'other' files like .out, .aux, .log on successful compilation

Actually, you don't need to customize anything. The variable in question is called LaTeX-clean-intermediate-suffixes and has the following default value: LaTeX-clean-intermediate-suffixes is a ...
• 1,603
Accepted

### Surprisingly persistent local variable

In case someone else runs into this, I had enabled TeX-auto-save, which saves settings to an auto/ directory and loads them when a file is revisited. https://www.gnu.org/software/auctex/manual/...
• 2,904

### How does AucTeX display superscripts?

Use the raise display property. As explained in (info "(elisp) Other Display Specs"): `(raise FACTOR)' This kind of display specification raises or lowers the text it applies to, relative ...
• 6,661

### A comprehensive list of shortcuts provided by AUCTeX

You can run C-hb to see the current bindings.
• 1,752
Accepted

### Is there a shortcut for \mathrm in AUCTeX?

C-c C-f C-r will do it. Check out the AUCTeX manual for the keybindings for all of the standards.
• 31k
Accepted

### Overriding fill-paragraph in LaTeX mode

It would be better to have 2 functions, although one can be implemented in terms of the other. The reason being that a paragraph is an implicit region, so the input in both cases should be different (...
• 4,440