I use Emacs Org-Mode for writing all kinds of articles. The standard format for org-mode is to show the table of contents before all other content, but that requires people to scroll down to see whether the article is interesting for them. Therefore I want the abstract to be shown before the table of contents.
There is an old guide for showing the abstract before the TOC in org-mode<8, but since I use org-mode 8, that wasn’t applicable to me.
With a short C-h v org-toc TAB TAB (means: search all variables which start with org- and containt -toc) I found the following even simpler way. After I got that solution working, I found that this was still much too complex and that org-mode actually provides an even easier and very convenient way to add the TOC at any place.
At the beginning of your file (after the title) add
Then after the abstract add a TOC:
#+BEGIN_ABSTRACT Abstract #+END_ABSTRACT #+TOC: headlines 2
Done. Have fun with org-mode!
This is the complicated way I tried first. It only works with LaTeX, but there it works. Better use the simple way.
Set org-export-with-toc to nil as file-local variable. This means you just append the following to the file:
# Local Variables: # org-export-with-toc: nil # End:
(another nice local variable is org-confirm-babel-evaluate: nil, but don’t set that globally, otherwise you could run untrusted code when you export org-mode files from others. When this is set file-local, emacs will ask you for each file you open whether you want to accept the variable setting)
Then write the abstract before the first heading and add tableofcontents after it. Example:
#+BEGIN_ABSTRACT Abstract #+END_ABSTRACT #+LATEX: \tableofcontents
⚙ Babcom is trying to load the comments ⚙
This textbox will disappear when the comments have been loaded.
Note: To make a comment which isn’t a reply visible to others here, include a link to this site somewhere in the text of your comment. It will then show up here. To ensure that I get notified of your comment, also include my Sone-ID.
Link to this site and my Sone ID:
This spam-resistant comment-field is made with babcom.