Questions tagged [latex]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
4k views

How to install Auctex

This is how I attempted to install the package: I ran the command list-packages and then tried to install the auctex package in package mode. This was the line showing auctex entry in package mode: ...
4
votes
2answers
108 views

Optional argument in AuCTeX definition of environment

I want to create a style file for the tcolorbox environment. I have the following: (add-hook 'LaTeX-mode-hook (lambda () (LaTeX-add-environments '("tcolorbox") )) ...
4
votes
1answer
840 views

Math autocompletion in org mode

What is the easiest way to get autocompletion for math symbols when I write latex formulas between \(..\) or \[...\] in org-mode? Could packages like company-math or ac-math be used in org-mode, for ...
4
votes
1answer
126 views

Use command other than \item to render lists in LaTeX export

I am trying to come up with a template for moderncv package. I would like to be able to render org-mode lists using \cvitem for example. Better yet, if I could choose the LaTeX command for rendering ...
4
votes
2answers
445 views

apostrophe in org-babel export to latex and beamer

How can I get org-babel to properly render ' and not ’ when exporting to LaTeX and to Beamer? I didn't find any good solution yet, and I would like the code to be copy-pasteable.
4
votes
1answer
83 views

AUCTeX command for Make and View

I sometimes use Makefiles with LaTeX documents, and so I'd like to define a command that does something similar to AUCTeX's C-c C-a (TeX-command-run-all) but using make. I tried creating a function ...
4
votes
1answer
546 views

How to define LaTeX document class for org-mode export (other than default)?

I want to add to org-latex-classes new class, namely "exam" (as described here: https://www.sharelatex.com/templates/exams/exam), here's a preview of an example document beginning: \documentclass[...
4
votes
1answer
978 views

how to style block quotes in org-mode LaTeX export?

I am trying to change the style of block quote formatting in org-mode export to PDF via LaTeX. Using this answer, I defined a new LaTeX environment called fancyquotes. I am successfully able to ...
4
votes
1answer
493 views

org-mode doesn't display image when LaTeX Image Attributes are included

I'm facing this problem that when I include some LaTeX specific attributes for my image, then the image doesn't display inside org-mode (although it is displayed fine in my exported LaTeX PDF). For ...
4
votes
2answers
148 views

Yet another request for Emacs templates

I'd like to find a way to organize and access my (Latex) templates within Emacs and so far, I didn't find a satisfying solution. (This post is related, but doesn't solve my question.) Let's say that ...
4
votes
1answer
86 views

AUCTeX - removing an environment from auto-complete list

I use the auto-complete feature of LaTeX-environment often. I'd like to be able to remove entries from the auto-complete list. I usually need to use the packages amsmath and amsthm, which introduce ...
4
votes
2answers
617 views

Org-mode: How to render latex inside ~code~

This seems a catch-22: I want to render code in an org-mode export (html or latex pdf) where the snippet below done as a ~code block > (cons 1 nil) \to (1) actually renders \to as a proper right ...
4
votes
1answer
77 views

Query-replace with some context checking?

(query-replace "foo" "bar") shows you all occurrences of foo and offers to replace them by bar. I would love to have a version of query-replace that only picks the occurrences of foo that are "in ...
4
votes
0answers
188 views

new lines in org mode export to LaTeX

This is similar to (this question). I would like to export the following org-mode document to LaTeX: * Test text 1 text 2 text 3 - list 1 - list 2 - list 3 #+BEGIN_definition ...
4
votes
0answers
557 views

orgmode image export side by side to both latex and html

In org export, I want to place two images side by side. I want them to be side by side in both LaTeX export and HTML export. In the example below, the first pair works for LaTeX and the second pair ...
4
votes
0answers
100 views

how to include remote images in org-mode export to LaTeX?

When I paste the URL of an image into an org-mode file and then export it to HTML, the remote image URL gets turned into an img tag and displayed in my HTML file without the need for me to save the ...
4
votes
1answer
738 views

How to set PDF export in polymode-mode to use xelatex engine?

Consider the below MWE of .Rmd file containing Arabic text which needs xelatex engine to be rendered by pandoc. As the documentation of the latter says putting this option would make it: --latex-...
4
votes
0answers
183 views

Prevent :EXPORT_LATEX_HEADER: in a subtree from overriding all buffer #+LATEX_ lines

Possibly a bug: When using :EXPORT_LATEX_HEADER: in a subtree's :PROPERTIES: it overrides all the buffer-level #+LATEX_HEADER: commands as well as everything given in an external file with #+SETUPFILE:...
4
votes
0answers
92 views

using global-linum-mode with ess with a latex/R knit file

When using global-linum-mode with a latex file that has blocks of R code (*.rnw file) moving in and out of the R code blocks cause the line numbers to disappear until the cursor is moved again. Is ...
4
votes
0answers
130 views

LaTeX-aware sentence endings?

Q: how do I define sentence endings to be LaTeX macro-aware? I'd like backward-sentence and forward-sentence to be smarter about LaTeX macros -- particularly \footnote -- when working in LaTeX ...
3
votes
2answers
204 views

How does AUCTeX determine the documentclass?

It's clear that AUCTeX has some way of determining the documentclass, since some functions behave differently depending on which documentclass is selected. For example, LaTeX-insert-item behaves ...
3
votes
2answers
2k views

Working with LaTeX in Spacemacs: can PDFs be seen in a buffer, rather than via external PDF reader?

I have been using the latest version of Spacemacs, with AUCTeX. However, when I compile the .tex file into a .pdf file, it opens in my default external PDF viewer software. Is there a way to make ...
3
votes
2answers
634 views

org-mode Beamer export: can't change format of title page and TOC

I have an org file that I use to create a pdf with org-beamer-export-to-pdf. The file has things like this at the top: #+TITLE: Training #+OPTIONS: H:2 toc:1 num:t #+LATEX_CLASS: beamer #+...
3
votes
1answer
1k views

latex-mode-hook or LaTeX-mode-hook?

When I did some clean up of my Emacs init file, I discovered that I had used both (add-hook 'LaTeX-mode-hook ...) and (add-hook 'latex-mode-hook ...) What is the difference between LaTeX-mode-...
3
votes
2answers
90 views

Make siunitx.el automatically recognize values and unit of unformatted text

I use siunitx to typeset units in LaTeX. This is quite painless when typesetting it directly because of Emacs's siunitx.el (see below). However, sometimes I copy exercises or solutions containing ...
3
votes
1answer
606 views

how to include gif images in org-export to LaTeX?

When I export from org-mode to PDF via LaTeX, my jpg images export successfully, but my gif images do not appear. The gif images do export when I export to HTML. I found a variable called org-export-...
3
votes
1answer
175 views

Fixed width font in Latex

I can't figure out how to have every character have the same fixed width in Latex. In this example: I would like the characters {i \in \math to have the same width as the others.
3
votes
4answers
813 views

Autocomplete environments like in TeXStudio

TeXStudio autocompletes environments. How can I get AUCTeX to do the same? I can begin typing an environment name (say myenvironment) and, after entering a part of it (my, myenv, etc.), I hit ...
3
votes
1answer
88 views

Org Mode. Set separation length between elements of a list

I have noticed there is a big gap between the elements of a list when exporting to PDF. Is there a way to modify it?
3
votes
1answer
601 views

org Images in LaTeX export set default width

By default these org lines: my image: [[./figure1.png]] are exported into these ones in latex: \includegraphics[width=.9\linewidth]{./figure1.png} How can I change the default value of width \...
3
votes
1answer
802 views

How to force the indentation of the first paragraph on org-mode export?

I have a simple Org file with this: #+STARTUP: showall align #+OPTIONS: todo:nil tasks:all tags:nil #+AUTHOR: Manoel Vilela #+TITLE: Super title @@latex:\\@@ Title to be write #+DATE: <2017-08-24 ...
3
votes
1answer
659 views

How to get rid of the auto folder with .el files?

I'm using Emacs 25.1, and I use it primarily for LaTeX with AucTeX. Some time ago in the directories of my .tex files, there started to appear a folder named "auto" with .el files in it. The .el files ...
3
votes
2answers
104 views

Ignoring line when exporting with latex backend

I have an org file that I want to export to both latex and html. The file contains a bibliography, so I want to make sure that my org-exporter processes it correctly for both export backends. For ...
3
votes
1answer
724 views

Blank lines after org-mode code block results in LaTeX export

Context I am embedding org-mode source code blocks and their results into my document and am exporting it to LaTeX. I usually wrap the output of my code into helper functions that generate formatted ...
3
votes
1answer
285 views

Yasnippet prompt when using commands interactively?

How can I use yasnippet to invoke LaTeX commands interactively? If I use auctex to insert \usepackage it starts a minibuffer which lets me select the desired package (including tab completion). ...
3
votes
1answer
570 views

Exporting Org in Landsacpe

I have an org document I'd like to export to PDF - with several wide tables columns in it - so much so that it makes sense to export the whole document in A4 landscape to keep the orientation ...
3
votes
1answer
821 views

Unnumbered section among numbered ones in Org-mode

It is known that the option num:nil drops the numeration of sections (when exporting from org-mode), but How could I include a unnumbered section among numbered ones in Org-mode?
3
votes
1answer
266 views

Export org-mode to LaTeX without preamble and document environment

I have recently started using org-mode as an electronic lab notebook for my work, and would like to combine these files with the files that I have set up in my old lab notebook, which was done in ...
3
votes
1answer
278 views

Prompt for inserting label when using theorem style environments in latex

When inserting the environment equation (by C-c C-e equation) in latex-mode, emacs shows a prompt to insert a label. It is desirable to have the same prompt for a theorem-style environment like lem ...
3
votes
1answer
1k views

How to control newline and indent when export to LaTeX from org-mode file?

I have a test org-mode file as below: #+OPTIONS: ':nil *:t -:nil ::nil <:nil H:3 \n:nil ^:{} arch:headline #+OPTIONS: author:nil c:nil creator:nil d:(not "LOGBOOK") date:t e:t #+OPTIONS: email:nil ...
3
votes
1answer
426 views

Polymode appears in minibuffer but does not weave into a file on Windows, why?

This is a follow-up post to Polymode installation on Windows machine. Accordingly I installed polymode using this code in the init.el file after ESS code: (require 'poly-R) (require 'poly-markdown)...
3
votes
1answer
464 views

Org headlines are never exported to \paragraph in LaTeX

I want to export an Org file into PDF, with any depth titles showed in TOC; however, cannot works. Even though adding \setcounter{tocdepth}{5}, TOC still only contains the title of 3rd depth (\...
3
votes
1answer
2k views

Org-mode doesn't seem to be exporting listings/minted correctly

Emacs is exporting listings blocks (i.e. #+BEGIN_SRC <lang>) in a strange, incorrect way. Here's an example of what I mean with a simple org file: #+AUTHOR: #+BEGIN_SRC js var dog = "dog!" #+...
3
votes
1answer
69 views

Check latex \left \right balance

I've found a function for checking parenthesis/brackets balance. Full code is in the bottom. I wanted to use it to check LaTeX commands like \left(/\right), \[/\] etc. How can I modify this function ...
3
votes
1answer
29 views

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 ...
3
votes
1answer
56 views

How to display a marked-up string without the markup?

Q: how can I display a marked-up string without the markup? I have a string with LaTeX markup, such as the following name with an umlaut: Tezc\"ur I want to display the string in a buffer without ...
3
votes
2answers
223 views

Greek (Unicode) in Org mode export to PDF

I am working on a project that deals with polytonic Greek, and wish to write everything in Org mode, and export to a PDF with one of the compilers (like XeLaTeX). I have spent hours today reading ...
3
votes
1answer
108 views

disable strange comment behavior in AUCTeX

When I have a commented line in my TeX file, eg some text that is not commented |%% here is a comment followed by more uncommented text (the | represents point), and I hit RET, point is moved past ...
3
votes
1answer
362 views

How to change the appearance of list bullets in LaTeX/beamer exports?

It's very neat that simple org-mode lists get exported to itemize (or enumerate) environments in LaTeX. Yet I would like also to be able to change the face of an \item bullet using square brackets, as ...
3
votes
1answer
107 views

How to tell Emacs to keep indentation in algorithmic environment?

I frequently find myself typesetting algorithms, and I choose the algorithmicx/algpseudocode package for that. I like the package, it is simple to use and has everything I typically need. The problem ...