108

As @kaushalmodi mentions in the comments you can use (org) Structure Templates to speed up insertion of different types of blocks. The general procedure is to insert < followed by a template selector (usually a single letter) on an otherwise empty line and press TAB. The template selector for a generic source block template is s, so typing <s ...


65

February 2020 update to this answer: From org version 9.2, the old easy templates referred to in this answer is no longer active by default, see this answer for more info: Why do easy templates, .e.g, "< s TAB" in org 9.2 not work? along with the new way to access easy templates which is C-c C-, Original answer: Yes, it's called easy ...


53

First of all: This is Emacs. It's not a bug, it's a setting! Secondly, @glucas is correct in saying that you need to modify org-emphasis-regexp-components to get what you want. However, I'd like to suggest two modifications to his (@Malabarba's) code and provide a bit more context: You don't need to copy the entire value of org-emphasis-regexp-components ...


46

Yes, you certainly can, you can use org-babel-load-file to do this. In your init.el, put the following: (require 'org) (org-babel-load-file (expand-file-name "settings.org" user-emacs-directory)) (I'm using ~/.emacs.d/settings.org but that is personal preference). In the settings.org file you can arrange it however you would like, ...


44

I think this problem is caused by the change of org-babel-check-confirm-evaluate from a macro to a function. If you have org-mode (and thus the old macro) loaded when you compile the new code, it sees the old macro instead of the new function. As others have pointed out uninstalling org-mode restarting Emacs (without loading org-mode) and reinstalling will ...


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}


38

Switching from docview to pdf-tools happens 'automatically' when you install pdf-tools. Once you've done this, any time Emacs tries to open a pdf in Emacs, it will use pdf-tools. However, some packages will call out to the operating system, or use different config within Emacs, to decide if they should use Emacs or another program to open a pdf. So there is ...


38

To elaborate on @erikstokes: rm ~/.emacs.d/elpa/ORGDIRNAME/*.elc where ORGDIRNAME is the name of the core ogrmode directory. Restart emacs and you can now run org-babel code blocks.


37

Pandoc can convert between multiple document formats. To convert a bunch of Markdown files to org-mode: for f in `ls *.md`; do pandoc -f markdown -t org -o ${f}.org ${f}; done


37

Building on @kaushalmodi's answer a bit futher, there are three ways to attach a date to an Org entry: A plain timestamp, C-c .: This is used for things like appointments where the entry occurs at a specific date/time. Such an entry will show up in the agenda on the specified day, and will not show up after that day has passed. Note that an appointment in ...


36

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title: #+TITLE: Foo @@latex:\\@@ Bar I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this: #+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar Source: https://lists.gnu.org/archive/...


32

org-table-blank-field, bound to C-c SPC and present in the “Tbl” menu. It's been around at least since version 6.01 in 2008, but for some reason it was only added to the manual as a consequence of this question.


32

When quoting a passage from another document, it is customary to format this as a paragraph that is indented on both the left and the right margin. You can include quotations in Org mode documents like this: #+BEGIN_QUOTE Everything should be made as simple as possible, but not any simpler -- Albert Einstein #+END_QUOTE This information in available in ...


31

I just found a nice function in the org source code: M-x org-toggle-link-display. Here is the source code, just for fun: (defun org-toggle-link-display () "Toggle the literal or descriptive display of links." (interactive) (if org-descriptive-links (progn (org-remove-from-invisibility-spec '(org-link)) (org-restart-font-lock) (...


30

As rvf0068 suggested, ispell can be configured to skip over regions that match regexes. For example, to skip over :PROPERTIES: and :LOGBOOK: drawers as well as SRC blocks, you could put this in your .emacs file: (add-to-list 'ispell-skip-region-alist '(":\\(PROPERTIES\\|LOGBOOK\\):" . ":END:")) (add-to-list 'ispell-skip-region-alist '("#\\+BEGIN_SRC" . "#\\...


29

As @wvxvw points out, you can use table.el by Takaaki Ota. There is some built-in support for this in org-mode (see manual). Your example can be easily translated to table.el syntax by replacing some | with +: +------------+-----------+----------+----------+-------------+ | | Singular | Plural | | +--------...


29

In org-mode, it is very easy to turn heading into item. A command called org-toggle-item can do that, and it is binded a default key with C-c -. Additionally, you can also use org-toggle-heading to turn an item to heading, which is binded with C-c *.


28

The following command lets you choose a back-end and then exports each top-level subtree to a separate file: (defun org-export-all (backend) "Export all subtrees that are *not* tagged with :noexport: to separate files. Note that subtrees must have the :EXPORT_FILE_NAME: property set to a unique value for this to work properly." (interactive "sEnter ...


28

You should have every header argument in one line: #+PROPERTY: header-args :session *my_python_session* :results silent :tangle yes Having several #+PROPERTY lines is accepted, but not in the way you're trying to do it. From the Org manual (7.1 Property syntax): If you want to add to the value of an existing property, append a ‘+’ to the property ...


28

This may be a preferred way (due to it's simplicity) of accomplishing your goal -- it seems to have gotten buried in the comments of another answer: Add the following to your .emacs file: (require 'ox-extra) (ox-extras-activate '(ignore-headlines)) Use the ignore tag on headlines you'd like to have ignored (while not ignoring their content) NOTE: if you ...


27

Simplest way I could think of: Select the list. Move the point to the first column. C-x r t- [ ]RET You are done.


27

If org-agenda-start-on-weekday is set to an integer (by default it's set to 1, corresponding to Monday), and org-agenda-span is set to either 'week or 7, org will always start the agenda on the day specified by org-agenda-start-on-weekday. So to always start yesterday, you must set org-agenda-start-day to "-1d" and do one of the following: Set org-agenda-...


27

I have done something similar. It's in French, but the code should speak for itself. I use ‰ for the marker (I use a bepo layout), and when I do, the marked text as a pressed-button style. I am not fluent in lisp, so there may be room for improvement. What I have done is that, when using ‰ for marker, the marked text has a pressed-button style, and when ...


27

You can look for the table, and use org-table-export to export it. You can put the function in a file, load it, and batch export. Something like this maybe: setup.el: (require 'org) (defun my-tbl-export (name) "Search for table named `NAME` and export." (interactive "s") (show-all) (let ((case-fold-search t)) (if (search-forward-regexp (...


27

They changed the template system in orgmode 9.2. The new mechanism is called structured template. The command org-insert-structure-template bound to C-c C-, gives you a list of #+begin_-#+end_ pairs that narrows down while you type and you can use completion. But, you can also get the old easy template system back, either by adding (require 'org-tempo) to ...


26

Not sure if you want to have UML conversion from/to source code etc., but if you want to create and maintain them by hand, plantuml rocks! Simple plantuml example of a sequence diagram: Bob -> Alice : hello I am successfully using org-babel with plantuml (and gnuplot and ditaa and ...) diagrams etc. Works like a charm, once set up, and html output too ...


26

This is a bug, IMO. Someone complained that the old indentation markers upset table layout in latex output so someone replaced them with these latex instruction. Now of course it is a mess on screen. I thought the new prettify-symbols-mode might be a handy way to switch out the \emsp for something else, but that can only replace with a single character and ...


25

From the fine Org Manual -- 2.3.3 Catching Invisible Edits: Sometimes you may inadvertently edit an invisible part of the buffer and be confused on what has been edited and how to undo the mistake. Setting org-catch-invisible-edits to non-nil will help prevent this. See the docstring of this option on how Org should catch invisible edits and process them. ...


25

You can change what face is used to display bold (or any other) markup by adding a new entry to org-emphasis-alist. For example, to make *bold* display in red, use (add-to-list 'org-emphasis-alist '("*" (:foreground "red") )) You will have to restart org-mode (with org-mode-restart) for this to take effect. Trying to add new ...


25

The full sequence of steps that worked for me: From the command line: Run emacs without loading the init file: emacs -q In emacs: run C-u M-x org-reload Use package-list-packages to uninstall org: select it then d x Use package-list-packages to reinstall org: select it then i x After restarting emacs, everything worked.


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