Cannot export tables to latex in org-mode - emacs

I am trying to do the following:
I have an .org file with the following table:
| 1 | 2 | 3 | 4 | 5 |
|---+---+---+---+---|
| a | b | c | d | e |
I get the following error on pressing C-c e d, the key binding to export to LaTeX and process the PDF:
Symbol's function definition is void: org-babel-exp-process-buffer
I am using Org-mode version 7.9.3f on Emacs 24.3.1.
Exporting .org files without tables works smoothly.
Here is a link to my .emacs if anyone needs to have a look.

You are running an outdated version of org-mode. You can upgrade to a newer version by doing
M-x package-install RET org RET
Note that if you are upgrading from the built-in version of org-mode, you need to do the installation
in a session where no .org file has been visited, i.e. where no org built-in functions have been loaded.
as explained here. To ensure that this is the case, start Emacs via emacs -Q and then install org as described above.
Taking into account your current configuration, the next step is to move this
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t))
from the bottom to the very top of your .emacs file, and comment out all org-related customizations for now. By moving the call to package-initialize to the top of your .emacs file you are making sure all packages installed via the package manager are loaded before your custom configuration is loaded.
When you restart Emacs (without the -Q option) and do M-x org-version RET, it should now give you something like 8.2.6, and exporting tables should work fine.
As a last step, re-enable your org-related customizations one by one by uncommenting them and evaluating them via C-x C-e. If you get any errors, this means the new org version introduced some changes that are incompatible with what your code is trying to do. In that case you might want to ask a separate question.

Related

emacs 27.1 for windows 10 org mode not working during first load (Shell command succeeded with no output)

In Windows 10, Emacs 26.3 with inbuilt org version 9.1.9 is working fine (Packaged binaries). Recently I tried Emacs 27.1. with inbuilt org version 9.3. While loading .org files for first time, I get the message (Shell command succeeded with no output) and org files are not rendered at all. To render it, I have to use M-x org-mode or reload the file in the buffer again. I tried to run without loading .emacs.d folder packages. The issue persists. It means, it has nothing to do with already installed other packages. I also tried with latest org version 9.3.7 and and also tried with emacs -Q. Still the issue persists. Any solutions?
I know I'm very late, but found in Jeffs words:
Evil remaps C-i to evil-jump-forward to emulate Vim’s jump lists feature2, which overwrites the default mapping for the TAB key in Org mode.
To fix the tab key’s functionality in Org mode, sacrifice Evil’s C-i backward jumping by turning it off in your configuration with the evil-want-C-i-jump option.
So to solve, just edit your init.el to look like this:
;; Install Evil and disable C-i to jump forward to restore TAB functionality in Org mode.
(use-package evil
:init (setq evil-want-C-i-jump nil)
:config (evil-mode))
source: https://jeffkreeftmeijer.com/emacs-evil-org-tab/

Is it possible to have nested "includes" in emacs org mode?

I'm writing documentation and one of my documents has started getting really bulky. I decided to break it up into sections and include them all in a main section, but I realized that it's not possible for me to correctly export an html file when I do that.
Example:
I have a main org file:
#+TITLE: SO Example
#+LaTeX_CLASS: memoir
#+OPTIONS: ^:nil LaTeX:nil TeX:nil
* 1st Level
This is the first level.
#+INCLUDE: "nested_includes.org"
nested_includes.org looks like:
** 2nd Level
This is the second level
#+INCLUDE: "single_include.org"
single_include.org looks like:
*** 3rd Level
This is the third level
I build my HTML file using the following command:
C:\...\emacs\bin\emacs.exe parent.org --batch -q --no-site-file --load C:\...\site-lisp\org-html-so.el -f org-export-as-html --kill
This is what my org-html-so.el looks like:
(setq org-export-author-info nil)
(setq org-export-creator-info nil)
(setq org-export-time-stamp-file nil)
(setq org-export-with-timestamps nil)
When I build, I end up getting something like this:
Meanwhile, I'm expecting something like this:
Is this a known issue/limitation with emacs org mode?
Is there a way for me to increase include depth?
Thank you!
I suspect from the function you are using for export that you have an older version of org-mode. In version 8 of org-mode the export functionality was rewritten. I've had a quick look at how I can get this working with the version of org I have installed with my emacs. So for me:
M-x org-version
gives:
Org-mode version 8.2.10 (release_8.2.10 # c:/dev/emacs/share/emacs/24.5/lisp/org/)
Which is shipped with my version of emacs 24.5. Given the same files you created. I changed org-html-so.el to read:
(require 'org)
(require 'ox)
(require 'ox-html)
(setq org-export-author-info nil)
(setq org-export-creator-info nil)
(setq org-export-time-stamp-file nil)
(setq org-export-with-timestamps nil)
Then the emacs invocation was:
emacs.exe parent.org --batch -q --no-site-file --load org-html-so.el -f org-html-export-to-html --kill
Include Depth
This version of include does not seem to limit depth, it does though remember files previously included regions to ensure includes are not recursive.
Upgrading
If you have an earlier version of emacs: you can either upgrade your version of emacs, or you can install a newer version of org, into your existing installation.
To install the newer version through the package manager or install it locally from github. See the page in installation in the Org Manual.
It's worth upgrading, in the least because the later versions are more actively you can take advantage of the latest features. For example you might like the support for html themes org-html-themes.

How to make multiple formula lines work in org-mode tables

I have an org-mode document with a table and several formulas. For better readability I'd like to have one line per formula. According to org-mode documentation this should be possible. However, the example "using multiple #+TBLFM" lines from this site
http://orgmode.org/manual/Editing-and-debugging-formulas.html
doesn't work for me. When I C-c C-c on the second formula line of the example table (see below) nothing happens.
| x | y |
|---+---|
| 1 | 1 |
| 2 | 2 |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2
Can anybody point me to a solution (other than having the formulas in one line separated by double colons)? I'm using Emacs 24.3.1 on Ubuntu 12.04 LTS.
The documentation that you linked to is for the latest release of org-mode, which is currently version 8.2.5.
Documentation for table formulas in version 7.9.3f, which is shipped with Emacs, does not mention support for multiple #+TBLFM lines.
It is possible to upgrade org-mode to a version that supports multiple #+TBLFM lines. I recommend using the official org-mode ELPA repository, which you'll have to add to your package-archives list (see the link for details).
I have the following in my init file to install the latest org-mode. I keep it earlier in my init file so that it is executed before the org-mode shipped with emacs is loaded
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(unless (package-installed-p 'org-plus-contrib)
(package-refresh-contents)
(package-install 'org-plus-contrib))
The package org-plus-contrib installs the latest org-mode plus some additional addons for org-mode. I guess the statement
contains the same set of files that are included in GNU Emacs
Refers to the fact that org package does not include the contrib packages.

cannot open load dired-details

I just installed the emacs package dired-details from inside emacs via
M-x package-list-packages
clicked on the package name and then install in the newly opened buffer.
Then I put those lines into my .emacs:
(require 'dired-details)
(setq-default dired-details-hidden-string ">---< ")
(dired-details-install)
When I restart emacs, I get the following error:
File error: Cannot open load file, dired-details
The interesting thing is, that when I mark the code region above and apply
M-x eval-region
everything works as expected.
emacs --version
>> GNU Emacs 24.3.1
package version:
dired-details-20130328.1119
Packages you installed with package.el need to be initialized if you want to access them during emacs initialization.
Add the line
(package-initialize)
to the very beginning of your .emacs .
Also follow phil's recommendation and see the variable
package-enable-at-startup

Loading packages installed through 'package.el' in Emacs24 [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Emacs 24 Package System Initialization Problems
I am using Emacs 24. I have the ELPA and Marmalade repos added. Using 'package' I installed 'auto-complete'. I have the following lines added to my init.el:
(require 'auto-complete-config)
(ac-config-default)
When I start Emacs, I get the error
File error: Cannot open load file, auto-complete-config
But then I use
M-x load-file
and load the same ~/.emacs.d/init.el file, it then works fine with the prompt saying
Loading /home/user/.emacs.d/init.el (source)...done
How is the usual loading different from the 'M-x load-file' command? In the start of the init.el file I do the following, is this somehow effecting the package from loading.
(add-to-list 'load-path "~/.emacs.d")
(load "custom_code")
As mentioned in the comment below: The answer by phils to the duplicate question is probably more helpful than this one
This almost certainly means that your init.el file is getting run before the code that sorts out the packages for package.el. The latter code adds the directory with the auto-complete library to your load path.
I'm still using ELPA, rather than package.el. With elpa, there's a snippet that looks like this that gets installed at the bottom of your .emacs.
;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize))
As the comment suggests, you probably want to put your equivalent package.el initialization code before the stuff that loads init.el.
Finally: I notice you mention adding .emacs.d to your load-path. The Emacs load path is not recursive, so that probably won't do what you need (assuming that your libraries live in subdirectories). Years ago, I wrote this snippet to load up various libraries of elisp code that I'd written. You might find it useful. (Obviously, it'll only work on unixy systems with a shell and a find command. It's reasonably slow, but this seems to be shell-command-to-string, which takes several milliseconds even running "echo hello" or the like)
(defun find-elisp-dirs (dir)
"Find all directories below DIR containing elisp sources, ignoring those"
(split-string
(shell-command-to-string
(format "find %s -iname '*.el' -printf '%%h\\n' | sort -u"
(expand-file-name dir t)))))