org-e-latex: Display nicer horizontal rules
* contrib/lisp/org-e-latex.el (org-e-latex-horizontal-rule): Display nicer horizontal rules. Support :width and :thickness attributes.
This commit is contained in:
parent
5d57364256
commit
043f2fcbbc
|
@ -1453,10 +1453,20 @@ holding contextual information."
|
||||||
(defun org-e-latex-horizontal-rule (horizontal-rule contents info)
|
(defun org-e-latex-horizontal-rule (horizontal-rule contents info)
|
||||||
"Transcode an HORIZONTAL-RULE object from Org to LaTeX.
|
"Transcode an HORIZONTAL-RULE object from Org to LaTeX.
|
||||||
CONTENTS is nil. INFO is a plist holding contextual information."
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
||||||
(let ((attr (mapconcat #'identity
|
(let ((attr (org-export-read-attribute :attr_latex horizontal-rule))
|
||||||
(org-element-property :attr_latex horizontal-rule)
|
(prev (org-export-get-previous-element horizontal-rule info)))
|
||||||
" ")))
|
(concat
|
||||||
(org-e-latex--wrap-label horizontal-rule (concat "\\hrule " attr))))
|
;; Make sure the rule doesn't start at the end of the current
|
||||||
|
;; line by separating it with a blank line from previous element.
|
||||||
|
(when (and prev
|
||||||
|
(let ((prev-blank (org-element-property :post-blank prev)))
|
||||||
|
(or (not prev-blank) (zerop prev-blank))))
|
||||||
|
"\n")
|
||||||
|
(org-e-latex--wrap-label
|
||||||
|
horizontal-rule
|
||||||
|
(format "\\rule{%s}{%s}"
|
||||||
|
(or (plist-get attr :width) "\\linewidth")
|
||||||
|
(or (plist-get attr :thickness) "0.5pt"))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Inline Babel Call
|
;;;; Inline Babel Call
|
||||||
|
|
Loading…
Reference in New Issue