Questions tagged [latex]

Working with LaTeX documents, LaTeX coding, and LaTeX source blocks in other documents.

Filter by
Sorted by
Tagged with
28
votes
2answers
5k views

How can I hide/display LaTeX section just like org-mode does with headlines?

When editing org files, I find it extremely convenient how you can hide and display headlines and their content by just hitting TAB on the headline. For instance, consider the following buffer * ...
27
votes
4answers
2k views

Editing files with one-sentence-per-line

A bit of background. I’m trying to version-control my latex documents, and the effectiveness of this initiative would be greatly improved if I adopt a one-sentence-per-line approach. For instance, ...
17
votes
2answers
3k views

how to setup Knitr workflow in Emacs?

RStudio provides a one-button way for produce PDF file from LaTeX+R source with Knitr. It looks great for doing reproducible research. And I am trying to configure my Emacs for: at left buffer LaTeX+...
17
votes
1answer
2k views

How to indent items in LaTeX/AUCTeX itemize environments?

Q: how can I get "proper" indentation of LaTeX itemize environments in auctex? Here's where I'd like to be with an item in an itemize environment: \item line is indented two spaces relative to the ...
16
votes
2answers
6k views

Is there a way to resize margins when exporting PDF in org-mode?

I want to export my org document as a PDF, but its margins are way too big. I would like to re-size them as I wish. I am using #+LaTeX_CLASS: report I do not know if there is a way. Any help?
14
votes
3answers
2k views

Exporting unicode characters to pdf using latex from org mode

Hello Good people of Emacs! I'm having trouble exporting unicode math symbols from buffer (org-mode) to pdf file. 1. Problem Description: Symbols are inserted to the buffer as unicode characters (...
13
votes
3answers
6k views

Label and reference LaTeX equations in org-mode

This is similar to Org export to latex and HTML references, but for equations. I like to use LaTeX math snippets in my org-files, as in * The Quadratic Equation The roots of $ax^2 + bx + c$ are ...
13
votes
1answer
584 views

Is it possible to have the entire org-table use math environment?

I have an org-mode table that needs to have some math text in each cell. Wrapping every cell with $ both looks ugly and takes much more space than it deserves. Is there any way to somehow put the ...
12
votes
2answers
7k views

Hide \author, \date, and \title when exporting to pdf with org-latex-export-to-pdf

I am very new to LaTeX and exporting org-mode files to pdf. When I run the command org-latex-export-to-pdf it adds a title, author name, and date to the top of the exported pdf. Looking at the ...
12
votes
1answer
513 views

how to detect if inside a LaTeX math environment?

Q: is there a way to detect if point is inside a LaTeX math environment? How would one detect whether point is or is not inside a LaTeX math environment, whether delineated inline by $...$ or by ...
12
votes
2answers
860 views

Aligning multi-lined equations and tables in latex-mode

Let's say I'm editing a latex in Auctex's latex-mode, and I have the following equation. This is just indented with indent-region. \begin{align} \phi & = a + b + c + d \\ & = a + ...
12
votes
1answer
179 views

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 as \if@...
12
votes
1answer
1k views

How to get rainbow-delimiters/rainbow-blocks to highlight in-line math in LaTeX equations

I'm using spacemacs with AUCTeX for LaTeX editing and would like to make rainbow-delimiters and/or rainbow-blocks highlight LaTeX math equations. Unfortunately this only works partly, i.e., some ...
11
votes
3answers
774 views

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

In TeXStudio by hitting ALT+DEL in a LaTeX macro like this \macroname{content} while the cursor stands just before the first { will result in deleting all that except its content (as shown below). ...
11
votes
3answers
7k views

How to make auto-complete work in AucTeX mode?

I want auto-complete (ac) to work when I am inside AucTeX mode. I get all packages from MELPA by package installation. This is my relevant code in init.el file: (require 'package) (package-...
11
votes
4answers
520 views

Reducing LATEX_HEADER clutter at the top of my org files

I often write notes in org mode and export them to latex. However, because some documents are complex I need to include many latex packages at the top like so: #+LATEX_HEADER: \usepackage[margin=1....
11
votes
1answer
632 views

How to change comment string used by comment-region?

Emacs generally comments regions well, but sometimes I wish I could change the string it prepends to lines. For example, in LaTeX, I would like to have a commented region only use a single % per line ...
11
votes
1answer
223 views

Gradually learning the keybindings provided by AUCTeX

If I do M-x forward-char, Emacs gives a very useful message You can run the command "forward-char" with C-f. Considering the fact that Emacs can find all LaTeX keybindings in the file latex.el ...
11
votes
2answers
785 views

RefTex searching for multiple articles with Helm

I recently started using Helm and am really enjoying it. However, I use emacs to write a lot of LaTeX. When I cite articles, I often need to cite several in the same cite macro - I could search my ...
11
votes
2answers
1k views

How to enlarge latex fragments in org mode at the same time as the buffer text?

I'm using org-mode in emacs, but I think the question is also relevant for auctex users. In org-mode you can show latex fragments, as the manual demonstrates. But: these fragments (mostly math ...
10
votes
1answer
327 views

Can emacs close open LaTeX tags automatically?

When using web-mode, typing a </ will autocomplete with the highest level open tag name. For example, if I have an open <div>, </ will be autocompleted to </div>. Is it possible to ...
10
votes
1answer
353 views

Arara integration in Emacs?

Is there a way to integrate Arara as a way to automate the building process of a LaTeX document in Emacs/AUCTex?
10
votes
2answers
846 views

Any science book written in org-mode?

I am thinking to write a physics book in org-mode. Although there are many open-source science books written in LaTeX to figure out its work-flow (and its source) I couldn't find any science book ...
10
votes
1answer
89 views

Speed up TeX-insert-macro on \input

In latex-mode when I use TeX-insert-macro to type a \input{...} macro, Auctex conveniently offers filename completion, which is great. However, it seems to search a lot of places to compile the ...
9
votes
3answers
8k views

How should I write inline equations in Org Mode so they export to LaTeX properly?

I have a sentence with the words 42 m s^{-1}. When this is exported to LaTeX it exports as 42 m s$^{\text{-1}}$. How should I write it, or what flags should I set in the #+OPTIONS: line, so that it ...
9
votes
1answer
2k views

How do I limit the width of a table or columns in org-mode PDF export?

I'd like to format a table with a wide column nicely in PDF export from org-mode. Ideally it would be with a wrap on that column, but I can deal with a manual character or fraction of \textwidth for ...
9
votes
2answers
610 views

How can I write [0,1) in LaTeX mode without breaking indentation?

When writing LaTeX using latex-mode, I often want to write "half-open intervals" in my text. For instance, [0,1), which refers to the set of all numbers x with 0 <= x < 1. Unfortunately, ...
9
votes
1answer
711 views

Helm and LaTeX mode

When I run the command LaTeX-environment (bound to C-c C-e by default) Helm properly selects from a list of all relevant environments (i.e. the same list I'd get without Helm turned on). The prompt ...
9
votes
1answer
466 views

Overriding fill-paragraph in LaTeX mode

I would like to change the behavior of fill-paragraph in certain modes (e.g. LaTeX-mode provided by AucTeX). I could just rebind the key M-q, but I am also using evil-mode whose implementation of ...
9
votes
1answer
322 views

Make consistent syntax highlighting of LaTeX source blocks

Org manual's solution for syntax highlighting of org-babel code blocks is to turn on native fontification with (setq org-src-fontify-natively t) works well for LaTeX code enclosed in blocks with #+...
8
votes
3answers
759 views

How to make a shell command totally silent (preventing it to split window or to open a new frame/window etc)

Is it possible to run a shell command silently (in background)? When I use async-shell-command, emacs split the windows. I would like that an specific shell command to be totally in background (...
8
votes
2answers
2k views

How to reference source blocks in org text

I want to create source blocks (in any language including LaTeX), then refer to these in the text using internal links, with descriptions as shown below. This similar post is not working for me. I ...
8
votes
2answers
126 views

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

I use AUCTeX for type-setting mathematical texts. Often I have to type equations with sums, integrals etc. which all have the same sub- or superscripts. I'd like to autofill the current sub-/...
8
votes
1answer
774 views

Change figure environment options

It is possible to change the figure options for a latex figure in org-mode? Currently I'm using the following to insert a figure in my org document. #+CAPTION: awesome figure #+NAME: fig:my-figure [[...
8
votes
4answers
493 views

How to replace matching parentheses?

I write (and rewrite) a lot of mathematical formulas in LaTeX with Emacs. I frequently run into situations where I want to change a pair of matching parentheses, to improve readability. My Emacs is ...
8
votes
1answer
1k views

Long org export latex header

I need many lines in my org-export latex header. #+LATEX_HEADER: \usepackage[main=british,polutonikogreek]{babel} #+LATEX_HEADER: \usepackage{fontspec} #+LATEX_HEADER: \usepackage{hanging} #+...
8
votes
1answer
478 views

How to add annotation in PDF src block like in this screenshot?

How to write Org-mode, (maybe need use LaTeX) to archive this effect?
8
votes
3answers
1k views

Show math formula in emacs when coding

Is it possible that emacs shows real formulas in the editor if they are written in Latex or similiar? I am asking because it would be much more readable if you are coding (in lets say python or C++) ...
8
votes
1answer
223 views

Formulas in plain text export

I am trying to find a way to export an Org document with lots of formulas in plain text, but the results aren't great so far. What I tried: pandoc - basically keeps all math in LaTeX unchanged, ...
7
votes
4answers
2k views

org-mode ignore heading when exporting to latex

I have a problem where I want to structure my document visually with a heading but do not want it to actually execute a \section{Fake Heading} for the latex export. I imagine this would be ...
7
votes
3answers
599 views

How to make emacs align and indent a bibtex entry?

I want bibtex-mode to align and properly indent fields. I copied a bibtex entry for the following article into Emacs: (Article source here) But, with a simple paste, the alignment is lost in Emacs ...
7
votes
1answer
1k views

How to have wrapped text when exporting from org to Latex?

I have an org file which I export to LaTeX and then to a PDF document. The problem is I have some long text that exceeds the length of the page. How to wrap it so that it falls into the next line? ...
7
votes
1answer
707 views

Select images in auctex with preview

If I insert an image into a latex file (via \includegraphics) auctex lets me select the file and inserts the filename. However using this dialogue, I can only choose the filename and cannot see ...
7
votes
2answers
2k views

Change org-mode table style just for LaTeX export

I am trying to customize the style of my org-mode tables when exported to Latex. I need to change their font face, their font size, the background color of the header and the background color of every ...
7
votes
1answer
1k views

Emacs setup for LaTeX after (use-package) verse

How to make this configuration file work with use-package with regard to AucTeX, RefTeX and LaTeX. I usually write latex rahter than pure tex documents. Current Working Emacs Configuration (load "...
7
votes
1answer
610 views

Setting #+ATTR_LATEX for all images of a document

I am currently adding an #+ATTR_LATEX before every image in my org-file to center it in the produced LaTeX beamer slides. That is slightly annoying and clutters up the document. Is there a way to set ...
7
votes
0answers
595 views

Is it possible to preview TeX formulas automatically on auctex-mode?

In auctex mode, whenever I write a new formula I have to type C-c C-p C-p to render it as an inline image. I'm wondering if it's possible to automatically render the formula or equations as I write ...
6
votes
2answers
2k views

Font size control of LateX previews in Org files

I love the ability to preview LateX fragments in Org-mode. With two easy shortcuts one can turn them on and off on-demand: Turning previewing ON: C-c C-x, C-l Turning previewing OFF: C-c C-c One ...
6
votes
1answer
702 views

Org-mode export to Latex error with footnotes

Whenever I write, in my org-mode file, \footnote{bla bla bla $\whatever_{something}$} I get an error in the .tex file generated. What it exports to the tex file is \footnote\\{bla bla bla \whatever_{...
6
votes
1answer
1k views

Export org-mode tables to LaTeX mathematics matrices?

Does anyone have a good way to produce LaTeX mathematics matrices from org-mode tables? I found this thread but it doesn't seem to have a ready-made solution. This gets me close. #+LATEX: \begin{...