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
  • 1,975
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
  • 1,975
3 votes

Getting Latex preview to work with org mode (.dvi not found)

In my case the issue was that the expansion of the relative path %f in "dvipng -fg %F -bg %B -D %D -T tight -o %O %f" from org-preview-latex-process-alist wasn't correct. I fixed it by ...
zacho314's user avatar
2 votes
Accepted

Adding some padding for LaTeX fragments in Org mode

I came up with the following solution, which may not be ideal, but does exactly what I want: (defun org-latex-clear-newlines-around-equations (backend) (when (org-export-derived-backend-p backend '...
daedsidog's user avatar
  • 157
2 votes
Accepted

Pointing Emacs to LaTeX under zsh (for org-latex-export-to-pdf)

Try this: (setenv "PATH" (concat "/Library/TeX/texbin/latexmk/" path-separator (getenv "PATH"))) Perhaps PATH can be inherited from Emacs when ...
shynur's user avatar
  • 5,288
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
Accepted

How to get the starred version of a latex section on org-mode?

I found it: I need to add the unnumbered property to the headline * Section with number Text of numbered section * Section without number :properties: :unnumbered: t :end: Text of unnumbered section
onlycparra's user avatar
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,805
2 votes

Create table with circles around words and hiding some of the grid lines in Emacs Org-mode

(Author of the original ODT exporter here) All artefacts included in this answer as a zip file This example uses The Authoritative fork of Org mode's ODT exporter and uses the following features that ...
mxnt's user avatar
  • 674
2 votes
Accepted

How to change the value of cdlatex-math-modify-prefix?

This is due to the fact that the prefix key is mapped during the loading of the cdlatex package and all subsequent changes to the variable do not update the keymap. Therefore, the cdlatex-math-modify-...
Divvy's user avatar
  • 23
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
  • 29.8k
2 votes
Accepted

How to change the color of superscripts and subscripts in latex in org mode?

You can ask emacs: with the cursor on such a subscript, do M-x describe-char to discover what face has been applied. Now use set-face-attribute in your init to set your desired colour.
Fran Burstall's user avatar
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 can I get color in an example org block exported to a verbatim beamer environment

This doesn't answer the question of how to add options to an example block, but I found a solution that gets me color in a verbatim block in case someone is looking to do that in the future: #+...
Dargscisyhp's user avatar
1 vote

When trying to compile the exported tex file, I get the error `Environment org undefined`

Having :wrap org in the header will wrap the results in a #+begin_org...#+end_org block and the latex exporter will translate that to \begin{org}... \end{org. Try this instead: #+name: mygraph #+...
NickD's user avatar
  • 29.8k
1 vote

How do I stop converting underscores to \textsubscript while exporting from org to latex?

Okay, found it! Org manual entry on Latex Fragments states that "Environments of any kind" are identified as latex fragments. "The only requirement is that the ‘\begin’ statement ...
digikar's user avatar
  • 141
1 vote
Accepted

How to make orgtbl-mode work within embedded LaTeX environment in org-mode itself?

I assume what you are trying to do is a radio table: define a table under an #+ORGTBL: keyword that can be translated into LaTeX and inserted where the placeholders BEGIN RECEIVE ORGTBL <table name&...
NickD's user avatar
  • 29.8k
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
  • 29.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
  • 1,975
1 vote
Accepted

Why does adding a return value to my Python code stop it from printing?

When you uncomment the return and try to export, there is an error: the error message is added to the *Org-babel Error Output* buffer and a diagnostic with the exit code (but not the error message(s)) ...
NickD's user avatar
  • 29.8k
1 vote
Accepted

org-latex-preview fails when \usepackage{fontspec} used

Here are the modifications to add to your init file: (with-eval-after-load 'org (setq org-preview-latex-default-process 'imagemagick) (setf (plist-get (cdr (assq 'imagemagick org-preview-latex-...
NickD's user avatar
  • 29.8k
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
  • 766
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
  • 1,975
1 vote

browse-url: replace \% with % in the url argument

You shouldn’t change browse-url at all; it should continue to accept a simple string with a properly–formed url in it. This habit of putting slashes in front of the percent–signs is unique to LaTeX, ...
db48x's user avatar
  • 18.1k
1 vote
Accepted

How to tangle code blocks from an org file, compile the output, and open the result, with a single command?

If each block in the file uses its own language and/or its own tangle path, then you will have to examine each one separately. That's what I assumed at first and that assumption is behind my original ...
NickD's user avatar
  • 29.8k
1 vote

How to tangle code blocks from an org file, compile the output, and open the result, with a single command?

Thank you @NickD, I managed to build a function from the full-path (cdr (assq :tangle (caddr (org-babel-get-src-block-info)))) command that you provided here. Here it is: (defun mda/tangle-tex-...
crocefisso's user avatar
  • 1,306
1 vote

Why are LaTeX previews oversized when using Imagemagick but not when using Dvipng?

Hi! I had the exact same problem yesterday and I think I've found a (somewhat hacky) solution today. Explanation The command that gets executed depending on what you set for org-preview-latex-default-...
0c1v1z3's user avatar
  • 11
1 vote

Suppress empty lines around `align` in latex export from `org-mode`

I've asked a similar question here and answered myself there, but I feel like that solution is less ideal than what I had hoped, and instead wrote something better. Below is a function that should be ...
daedsidog's user avatar
  • 157
1 vote
Accepted

Always replace " with \enquote{ or }

AUCTeX provides an interface for this: Write your own AUCTeX style file which corresponds to your own custom LaTeX class file. Suppose the name of your custom class is classname.cls. A simple ...
Arash Esbati's user avatar
  • 1,975

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