1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-05 11:45:52 +00:00

ox-latex: Fix :options discrepancy between blocks and lists

* lisp/ox-latex.el (org-latex-plain-list): Do not automatically
  enclose value for :options attribute within square brackets.
  Instead, append them verbatim next to the block name, as special
  blocks do.
* doc/org.texi (@LaTeX{} specific attributes): Update manual.
This commit is contained in:
Nicolas Goaziou 2014-01-25 14:54:04 +01:00
parent a6b8bdecab
commit b2dce80601
2 changed files with 7 additions and 13 deletions

View File

@ -11768,13 +11768,12 @@ the @LaTeX{} @code{\includegraphics} macro will be commented out.
@cindex plain lists, in @LaTeX{} export
Plain lists accept two optional attributes: @code{:environment} and
@code{:options}. The first one allows the use of a non-standard
environment (e.g., @samp{inparaenum}). The second one specifies
optional arguments for that environment (square brackets may be
omitted).
@code{:options}. The first one allows the use of a non-standard environment
(e.g., @samp{inparaenum}). The second one specifies additional arguments for
that environment.
@example
#+ATTR_LATEX: :environment compactitem :options $\circ$
#+ATTR_LATEX: :environment compactitem :options [$\circ$]
- you need ``paralist'' package to reproduce this example.
@end example

View File

@ -1877,18 +1877,13 @@ contextual information."
(latex-type (let ((env (plist-get attr :environment)))
(cond (env (format "%s" env))
((eq type 'ordered) "enumerate")
((eq type 'unordered) "itemize")
((eq type 'descriptive) "description")))))
((eq type 'descriptive) "description")
(t "itemize")))))
(org-latex--wrap-label
plain-list
(format "\\begin{%s}%s\n%s\\end{%s}"
latex-type
;; Put optional arguments, if any inside square brackets
;; when necessary.
(let ((options (format "%s" (or (plist-get attr :options) ""))))
(cond ((equal options "") "")
((string-match "\\`\\[.*\\]\\'" options) options)
(t (format "[%s]" options))))
(or (plist-get attr :options) "")
contents
latex-type))))