Running org-export-as-latex on: > #+STARTUP: beamer > #+LaTeX_CLASS: beamer > > #+BEGIN_SRC C > double tmp0 = yp[0]; > #+END_SRC
generates the following traceback. Adding a "* foo" line above the BEGIN_SRC avoids the problem. Using org-mode from git; SHA1 0c09a9e7683c79c8525f87ccd1b7ba0255a94b1c R Debugger entered--Lisp error: (error "unbalanced begin/end_src blocks with #(\"#+BEGIN_SRC C \" 0 11 (fontified nil font-lock-fontified t org-category \"bug\") 11 13 (fontified nil font-lock-fontified t org-category \"bug\") 13 14 (fontified nil font-lock-fontified t org-category \"bug\"))") signal(error ("unbalanced begin/end_src blocks with #(\"#+BEGIN_SRC C\n\" 0 11 (fontified nil font-lock-fontified t org-category \"bug\") 11 13 (fontified nil font-lock-fontified t org-category \"bug\") 13 14 (fontified nil font-lock-fontified t org-category \"bug\"))")) error("unbalanced begin/end_%s blocks with %S" src #("#+BEGIN_SRC C\n" 0 11 (fontified nil font-lock-fontified t org-category "bug") 11 13 (fontified nil font-lock-fontified t org-category "bug") 13 14 (fontified nil font-lock-fontified t org-category "bug"))) byte-code("\306\307\211\211\211\211\211\211\211\211\211\211+,-./0\310\311!\2111\205) \311K2\312\216\311\313M\210eb\210`\3143\3153\307\306#\203X\316\317\224!4\316\317\225!5\320\321!G-\322\323\324\320\325!\227!\"6\326\320\325!\227!,\327 7\330\216\331\320\332!\333\"*\32189\206\200 \334\n\235\307:\3358!\204\255 \3156\307\306#\203\255 \320\321!\227\336\230\203\245 8S8\202\204 8T8\202\204 \3358!\204\276 \337\340,4`{#\210\316\317\225!: \204\327 \327 7\341\216\3425\317\224{!*,/>\204\346 ,/B/\327 7\343\216\311 4\"\210*\344,;\"\211<A@)\211+\203?\327 7\345\216,=>\203\346\202\347+\n#*\211>\203>4:|\2104b\210>c\210 \204>\3504`-#\210)4\307\211\223\2105\307\211\223\210:\307\211\223\210. `\2029 )\311 d\"\210\351\352!.\207" [progress-marker preserve-indent headers body end start t nil fboundp interblock ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [--cl-letf-bound-- --cl-letf-save-- interblock fmakunbound] 2)) #[(start end) "\301\302\"\207" [org-export-interblocks mapcar #[(pair) "\211A@)\n\"\207" [pair x start end] 4]] 3] "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[ \n]" re-search-forward copy-marker 0 match-string 1 format "[ \n][ ]*#\\+\\(begin\\|end\\)_%s" regexp-quote 2 intern match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-split-string 3 "[ ]+" "-i" zerop "end" error "unbalanced begin/end_%s blocks with %S" ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-remove-indentation ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) assoc ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) "" apply indent-code-rigidly run-hooks org-export-blocks-postblock-hook func type indentation matched types case-fold-search --cl-letf-bound-- ...] 13) org-export-blocks-preprocess() org-export-preprocess-string(#("#+STARTUP: beamer\n#+LaTeX_CLASS: beamer\n\n#+BEGIN_SRC C\ndouble tmp0 = yp[0];\n#+END_SRC\n" 0 17 (fontified nil font-lock-fontified t org-category "bug") 17 18 (fontified nil font-lock-fontified t org-category "bug") 18 39 (fontified nil font-lock-fontified t org-category "bug") 39 40 (fontified nil font-lock-fontified t org-category "bug") 40 41 (fontified nil org-category "bug" :org-license-to-kill t) 41 52 (fontified nil font-lock-fontified t org-category "bug") 52 54 (fontified nil font-lock-fontified t org-category "bug") 54 55 (fontified nil font-lock-fontified t org-category "bug") 55 71 (fontified nil font-lock-fontified t org-category "bug" :org-license-to-kill t) 71 75 (fontified nil font-lock-fontified t org-category "bug" :org-license-to-kill t) 75 76 (fontified nil font-lock-fontified t org-category "bug" :org-license-to-kill t) 76 85 (fontified nil font-lock-fontified t org-category "bug") 85 86 (fontified nil org-category "bug")) :emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil) org-export-as-latex(nil) call-interactively(org-export-as-latex) org-export(nil) call-interactively(org-export nil nil)