LaTeX export: Better handling of levels below the headline boundary

Outline levels below the headline boundary are now treated better, as
proper list.  The variable `org-export-latex-low-levels' can now also
be `itemize' or `enumerate', to get the corresponding list structure.
The new default is `itemize', to make it parallel with the behavior in
HTML.
This commit is contained in:
Carsten Dominik 2009-03-21 13:12:07 +01:00
parent cf6cdd5c44
commit 4f70034a94
2 changed files with 34 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2009-03-21 Carsten Dominik <carsten.dominik@gmail.com>
* org-export-latex.el (org-export-latex-low-levels): More options
for how to process lower levels in LaTeX.
(org-export-latex-subcontent): Better treatment for lists as a
means of publishing lower levels.
2009-03-20 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-set-font-lock-defaults): Use new checkbox face.

View File

@ -215,18 +215,20 @@ Each cell is of the forma \( \"option\" . \"package\" \)."
:group 'org-export-latex
:type 'alist)
(defcustom org-export-latex-low-levels 'description
(defcustom org-export-latex-low-levels 'itemize
"How to convert sections below the current level of sectioning.
This is specified by the `org-export-headline-levels' option or the
value of \"H:\" in Org's #+OPTION line.
This can be either nil (skip the sections), 'description (convert
the sections as descriptive lists) or a string to be used instead
of \\section{%s}. In this latter case, the %s stands here for the
inserted headline and is mandatory."
This can be either nil (skip the sections), `description', `itemize',
or `enumerate' (convert the sections as the corresponding list type), or
a string to be used instead of \\section{%s}. In this latter case,
the %s stands here for the inserted headline and is mandatory."
:group 'org-export-latex
:type '(choice (const :tag "Ignore" nil)
(symbol :tag "Convert as descriptive list" description)
(symbol :tag "Convert as descriptive list" itemize)
(symbol :tag "Convert as descriptive list" enumerate)
(string :tag "Use a section string" :value "\\subparagraph{%s}")))
(defcustom org-export-latex-list-parameters
@ -674,13 +676,31 @@ If NUM, export sections as numerical sections."
;; At a level under the hl option: we can drop this subsection
((> level org-export-latex-sectioning-depth)
(cond ((eq org-export-latex-low-levels 'description)
(insert (format "\\begin{description}\n\n\\item[%s]%s\n\n"
(if (string-match "% ends low level$"
(buffer-substring (point-at-bol 0) (point)))
(delete-region (point-at-bol 0) (point))
(insert "\\begin{description}\n"))
(insert (format "\n\\item[%s]%s~\n\n"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) (org-export-latex-sub subcontent)))
(insert "\\end{description}\n"))
(insert "\\end{description} % ends low level\n"))
((memq org-export-latex-low-levels '(itemize enumerate))
(if (string-match "% ends low level$"
(buffer-substring (point-at-bol 0) (point)))
(delete-region (point-at-bol 0) (point))
(insert (format "\\begin{%s}\n"
(symbol-name org-export-latex-low-levels))))
(insert (format "\n\\item %s\\\\\n%s\n"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) (org-export-latex-sub subcontent)))
(insert (format "\\end{%s} %% ends low level\n"
(symbol-name org-export-latex-low-levels))))
((stringp org-export-latex-low-levels)
(insert (format org-export-latex-low-levels heading) "\n")
(when label (insert (format "\\label{%s}\n" label)))