How to disable auto-include header in export in org-mode HTML?

I have an org-mode project with many small org files that I would like to export to HTML. I did not specify #+TITLE in many files, since they do not have corresponding names. When exporting, I find that the partial first sentence is exported as the title of the document.

For example, such an org document:

 This is a short file. Mary had a little lamb, etc. 

The following HTML will be exported:

 *snip* <div id="content"> <h1 class="title">This is a short file.</h1> <p>Mary had a little lamb, etc.</p> *snip* 

I would prefer that both sentences in the above file be marked as paragraphs. How to disable automatic prediction of headers?

+8
emacs org-mode
source share
2 answers

If you look at the code org-export-region-as-html , you will see the following snippet

 (title (or (and subtree-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) (and buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "UNTITLED")) 

The function org-export-grab-title-from-buffer is called if no title is specified. You can disable this feature by telling her

 (defadvice org-export-grab-title-from-buffer (around org-export-grab-title-from-buffer-disable activate)) 
+5
source share

To prevent the first line from becoming a heading, you can set an empty heading:

 #+Title: This is a short file. Mary had a little lamb, etc. 
+7
source share

All Articles