Questions tagged [tex]

Working with TeX documents

TeX document typesetting system. It is often used to typeset scientific or technical books and articles, usually with the LaTeX macro package.

Use this tag for general questions about working with TeX documents in Emacs. There are two modes for working with TeX documents:

  • The basic tex-mode package included in GNU Emacs. Use the tag for questions about this mode.
  • The more elaborate AUCTeX third-party package (included in XEmacs). AUCTeX provides more advanced features including syntax highlighting and completion of macros in third-party packages, better support for complex compilations, preview of mathematics, etc. Use the tag for questions about AUCTeX.

For questions about (La)TeX and companion tools that are not related to Emacs, see TeX - LaTeX Stack Exchange.

37 questions
14
votes
2 answers

How can I preview TeX formulas inline in arbitrary modes?

How can I get TeX previews inside modes other than AUCTeX or org-mode? I'd love to see TeX equations in jabber, erc and markdown. If I ever switch to Emacs for email, I'd presumably like to see previews there too.
Tikhon Jelvis
  • 6,152
  • 2
  • 27
  • 40
13
votes
2 answers

How to call pdflatex under TeX-PDF-mode?

I am already in TeX-PDF-mode. When C-c C-c and type in pdflatex, it doesn't run. How can I run pdflatex in TeX-PDF-mode? Note: I don't change my emacs configuration file. Thanks.
Tim
  • 4,987
  • 7
  • 31
  • 60
12
votes
1 answer

Auto-Indenting \if statements with AUCTeX

The current AUCTeX behaviour for primitive tex code involving if-like statements is to indent the conditional statement at the same level as the surrounding condition. I.e. code such…
elemakil
  • 2,517
  • 1
  • 18
  • 26
6
votes
3 answers

Search and replace TeX \over with LaTeX \frac

I have a source file that was originally coded in TeX (well, this is actually a conTeXt file). A fraction like 1/(2/x^2) is coded as {1 \over {2 \over x^2}}. I'd like to convert to LaTeX syntax, that is \frac{1}{\frac{2}{x^2}}. Any hints? Thanks.
cjorssen
  • 197
  • 6
6
votes
1 answer

Inserting unicode symbol for rational numbers ℚ using TeX input method

Hello good people of Emacs! To insert unicode math symbols I use TeX input method. This way I get unicode character ℝ by typing \Bbb{R}, ℕ by typing \Bbb{N}, ℤ by typing \Bbb{Z}, etc... I'm unable to get symbol ℚ, since typing \Bbb{Q} does not…
Empty_Mind
  • 1,341
  • 12
  • 27
5
votes
1 answer

Looking for a way to have LaTeX source code and its real-time rendering in side-by-side Emacs windows

I am looking for a way to use Emacs as a LaTeX editor that couples a persistent LaTeX source window with an adjacent real-time rendered view of the LaTeX-encoded content, similar to what is available at several StackExchange sites (e.g. see…
kjo
  • 3,145
  • 14
  • 42
5
votes
2 answers

How to convert the emacs manual to org format?

I like to read the Emacs manual on a hard copy but I would like to have a copy in org format to kill parts that I have understood and so to only keep what's important to remember (titles, functions and keybindings mostly). I have tried with pandoc…
4
votes
2 answers

AUCTeX: only use monospace for rendering macros?

I've been using the fontify features of AUCTeX, as well as magic-latex-buffer, to display my TeX code in a more readable way. But I'm wondering if I can crank this up to 11: is there a way to render the document text in a variable width font, but…
jmite
  • 183
  • 6
3
votes
1 answer

LaTeX-environment inserts unwanted empty line

When I'm editing a LaTeX document and I'm using C-c C-e for LaTeX-environment, I often get a blank line after the newly-inserted environment. This is never what I want and sometimes even plainly wrong because it can lead to errors if you for…
Frunobulax
  • 153
  • 6
2
votes
1 answer

Don't replace " in LaTeX Mode

In LaTeX mode, when I type \" (to produce a Umlaut like ö, ä or ü in the resulting PDF) emacs replaces it by ''\` (two single quotation marks, a backslash, and a backtick) which does not work for typesetting Umlaute. There is a related question…
M0M0
  • 143
  • 5
2
votes
2 answers

I have to enable `hl-todo-mode` in LaTeX-mode?

Currenty I am on LaTeX-mode-hook and added following line global-hl-todo-mode into .emacs file to use hl-todo. On its readme it says: To highlight keywords turn on hl-todo-mode in individual buffers or use the the global variant…
alper
  • 1,238
  • 11
  • 30
2
votes
0 answers

Indenting LaTeX code for \if \else \fi statements

This is related to this Emacs.SE question. I use the code from the answer: (setq LaTeX-begin-regexp "\\(?:begin\\|if@\\)\\b") (setq LaTeX-end-regexp "\\(?:end\\|else\\|fi\\)\\b") (defun LaTeX-indent-level-count () "Count indentation change caused…
Jan
  • 373
  • 2
  • 12
2
votes
1 answer

Emacs26 -- (1) view PDF with Okular; (2) compile TEX file silently

I am running Emacs 26 built with GTK toolkit. AUCTeX has been successfully installed. 1) How to force Emacs to open an Okular session to view the PDF file, instead of opening another window within Emacs (aka DocView)? 2) How to delegate the…
2
votes
0 answers

Is it possible in org-mode to export a * heading to a \begin{heading} \end{heading} block construct?

I'm trying to export a heading as a block construct. Something like * heading Content * Another Heading gets exported to \begin{heading} Content \end{heading} \section{Another Heading} Using something like a tag :block: or a :export: block…
Sparx
  • 1,111
  • 9
  • 20
1
vote
1 answer

Switch a TeX \macro and a script on a region of text

How can I search and replace in a region of a (TeX)buffer all occurences of \macro{foo}_{bar} to \macro{foo_{bar}}, foo and bar not being "constants" ?
cjorssen
  • 197
  • 6
1
2 3