What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Hot answers tagged

43

The simplest way to tweak the formatting of a LaTeX export is by using the geometry package. Try something like this: #+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}


26

What you want is called folding, and there are 2 ways you can do that. Outline-minor-mode This is a built-in minor mode that is exactly what org-mode uses to hide and display it's headlines. You can make sure it's always turned on in latex-mode with (add-hook 'LaTeX-mode-hook #'outline-minor-mode) The keybinds it defines are a little hard to use, so you ...


23

OK, thanks to @wvxvw putting me on the right track I figured it out. You can get rid of the author and date with: #+OPTIONS: author:nil date:nil The Org Manual says that you can also toggle title with title:nil (org-export-with-title). However, this option didn't get rid of the title, and I couldn't find a variable or command org-export-with-title. ...


19

I had to run some test, but I managed to run a small file that exports correctly to both latex and HTML, I tested only in org 8.2.10, but it should work on other versions. The answer is actually the same as in Org export to latex and HTML references Here I have a small example * This is a latex experiment so with the text... #+NAME: code:1 #+BEGIN_SRC ...


16

In the built-in latex-mode, C-c C-e runs latex-close-block, which closes the highest level open block. No need to type the \end first. If you're using AUCTex, C-c ] does the same thing, or you can use C-c C-e to insert a matched \begin, \end pair.


15

@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: \begin{abstract} This indents to the 4th column, which is way too far! \end{abstract} The following function builds off an old (and seemingly broken?) code ...


15

Another way to achieve the same effect more permanently is to modify org-latex-packages-alist to add the geometry package, as follows: (setq org-latex-packages-alist '(("margin=2cm" "geometry" nil)))


14

NB: much of this text came from an answer to a question that turned out to be a duplicate of this question. Some of the material is sufficiently different that it seemed worthwhile to add it to this question. 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 ...


14

You can make use of a #+SETUPFILE: Put all of these settings in a file, for example ./setup/setupfile.org, and then include them into your document with #+SETUPFILE: ./setup/setupfile.org In this file, you can also include #+OPTIONS:, #+AUTHOR, and similar in-buffer settings. What's even more useful, is that if you load the #+SETUPFILE: first, you can ...


13

For (1), I would use an enlarged margin, so that visual-line-mode wraps lines at the desired fill-column. This will affect both text lines and equations, though. As for (2), one can define a custom filling command to be bound to M-q and correctly fill paragraphs. I haven't yet managed to write a command with the correct behaviour for auto-filling. Wrapping ...


13

From a LaTeX point of view, these are different cases. In the first case, LaTeX isn't going to wrap -- and it shouldn't! A "verbatim" environment, which is what source-code is set in, respects lines precisely and doesn't break paragraphs, because LaTeX simply can't know where to break them. If you want to wrap the lines, you have to wrap them in the source-...


12

Also, it is good to know that the dollar syntax $...$ is not always recommended in LaTeX (and the double dollar syntax, $$...$$, for displayed equations, in strongly discouraged). For further info see this and this question on TeX.SE. Needless to say, Org-mode supports both \(...\) and \[...\]. Try exporting this to LaTeX: * Dollars hello $E=mc^2$ * ...


12

If you just want something like visual-line-mode but configurable, you can try longlines-mode which is what I use for most of my prose. longlines-mode wraps your text similarly to visual-line-mode with the width configured by fill-column. Here's a screenshot with fill-column set to 70 (the window actually extends even more to the right). Configuring fill-...


12

comment-add: comment-add is a variable defined in newcomment.el. Its value is 1 Local in buffer .emacs; global value is 0 Documentation: How many more comment chars should be inserted by comment-region. This determines the default value of the numeric argument of comment-region. The plain comment style doubles this value. This should ...


12

UPDATE As of ESS 19.04, the ess-noweb and ess-swv libraries are obsolete: Libraries for literate data analysis are obsolete and not loaded by default. This includes 'ess-noweb', 'ess-swv', and related functionality like 'Rnw-mode'. Users are encouraged to switch to one of several other packages that deal with these modes. For example, ...


12

Modify org-latex-default-figure-position to change the default, or use the following on the specific elements, #+attr_latex: :placement [!tbh]


12

You may try something like this: #+ATTR_LATEX: :environment longtable :align |l|p{10cm}|l| | | <30> | | | Column | Wide Column | Column | |------------+----------------------------------------------------+--------| | Some stuff | Lots and lots of ...


12

A possible solution is to write a file with the LaTeX preamble, like %% This is the file MyTeXHeader.tex \usepackage[main=british,polutonikogreek]{babel} \usepackage{fontspec} \usepackage{hanging} \setmainfont{ebgaramond}[Contextuals=Alternate] \newcount\instr \instr=1 % hide/show instructions \babelhyphenation[british]{philo-sophy} and then use a single ...


12

When the cursor is somewhere in the entry, run the command bibtex-fill-entry (bound to C-c C-q), which will align the fields. You may also want to set variable bibtex-align-at-equal-sign to a non nil value to change the details of alignment.


11

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 working as well (optioinal) without any confict. put this in your init.el or .emacs taking care of sequence: (require 'package) (package-initialize) ;; ...


11

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." (interactive "*p") (let (macro end) (when (dotimes (i arg macro) (goto-char (TeX-find-macro-start)) (setq macro (TeX-current-macro) ...


11

You can customize the variable org-format-latex-options to increase :scale. See the Org Manual, 11.7.4 Previewing LaTeX fragments.


11

Expanding Constantine's answer. You can use C-h v org-format-latex-options RET to understand what can be changed in this variable. One of the options is the scale. In the help page in Emacs you can click to change the value of the scale to 2.0, for example, so that the equations look bigger when you run C-c C-x C-l. Alternatively, you can add the following ...


11

You can also redefine LaTeX's \maketitle to do nothing: #+Title: Test title #+Author: Test Author #+Date: [2016-03-28 Mon] #+LATEX_HEADER: \renewcommand\maketitle{} * hello test text


11

For others who stumble upon this question, the following is available. As hinted to by yantar92, this is included in ox-extra which is included in the org-plus-contrib elpa package. Headers can take an :ignore: tag, which excludes the heading upon export while still including its contents. To make it work, add the following to your emacs setup (having ...


11

Add #+LATEX_HEADER: \usepackage{nopageno} to the top of the document.


10

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 the point is in a math construct. Used in elisp, it will be t if in math, nil otherwise. The additional pieces of informations are then stored in the variable ...


10

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-includegraphics-read-file (M-x customize-variable RET LaTeX-includegraphics-read-file RET) and select the relative option or add the following to your init file: (setq ...


10

Try using :mode math and :mode inline-math LaTeX attributes together with :environment array: #+ATTR_LaTeX: :mode math :environment array | Column 1 | Column 2 | |----------+----------| | \sin(x) | \tan(x) | #+ATTR_LaTeX: :mode inline-math :environment array | Column 1 | Column 2 | |----------+----------| | \sin(x) | \tan(x) | See section LaTeX ...


10

If you use org-ref (https://github.com/jkitchin/org-ref), you can do this: #+caption: test label:some-source-code #+BEGIN_SRC python for i in 1:10: print i #+END_SRC See Listing ref:some-source-code This exports to PDF and HTML with active links.


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