Explorar el Código

[ox-latex] add \phantomsection where appropriate.

* lisp/ox-latex.el (org-latex--wrap-label): Add \phantomsection.

Without this, links will jump to the nearest sectioning command
instead of to the exact spot of definition.
Aaron Ecay hace 11 años
padre
commit
9386b0c584
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      lisp/ox-latex.el

+ 2 - 1
lisp/ox-latex.el

@@ -1085,7 +1085,8 @@ This function shouldn't be used for floats.  See
 `org-latex--caption/label-string'."
   (let ((label (org-element-property :name element)))
     (if (not (and (org-string-nw-p output) (org-string-nw-p label))) output
-      (concat (format "\\label{%s}\n" (org-export-solidify-link-text label))
+      (concat (format "\\phantomsection\n\\label{%s}\n"
+		      (org-export-solidify-link-text label))
 	      output))))
 
 (defun org-latex--text-markup (text markup info)