mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-26 07:33:39 +00:00
lisp/ox-latex.el: put labels inside example blocks
* lisp/ox-latex.el (org-latex-example-block): Instead of `org-latex--wrap-label', manually add label after \begin{<environment>}. This produces proper label resolution in LaTeX. Labels before the environment begins can be interpreted as referring to the surrounding section.
This commit is contained in:
parent
97a780f0be
commit
304f18cb72
@ -2131,13 +2131,13 @@ information."
|
||||
(let ((environment (or (org-export-read-attribute
|
||||
:attr_latex example-block :environment)
|
||||
"verbatim")))
|
||||
(org-latex--wrap-label
|
||||
example-block
|
||||
(format "\\begin{%s}\n%s\\end{%s}"
|
||||
environment
|
||||
(org-export-format-code-default example-block info)
|
||||
environment)
|
||||
info))))
|
||||
(format "\\begin{%s}%s\n%s\\end{%s}"
|
||||
environment
|
||||
(if (org-element-property :name example-block)
|
||||
(org-latex--label example-block info nil 'full)
|
||||
"")
|
||||
(org-export-format-code-default example-block info)
|
||||
environment))))
|
||||
|
||||
|
||||
;;;; Export Block
|
||||
|
Loading…
Reference in New Issue
Block a user