Browse Source

ox-texinfo: Allow cross-references to headlines excluded from TOC

* lisp/ox-texinfo.el (org-texinfo-headline): Use @anchor instead of
  @node for headlines outside TOC.
Nicolas Goaziou 7 years ago
parent
commit
f9c09b194f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/ox-texinfo.el

+ 4 - 2
lisp/ox-texinfo.el

@@ -885,8 +885,10 @@ holding contextual information."
 		      (format "@end %s" (if numbered? 'enumerate 'itemize))
 		    "\n"))
 	(concat
-	 (and (not notoc?)
-	      (format "@node %s\n" (org-texinfo--get-node headline info)))
+	 ;; Even if HEADLINE is using @subheading and al., leave an
+	 ;; anchor so cross-references in the Org document still work.
+	 (format (if notoc? "@anchor{%s}\n" "@node %s\n")
+		 (org-texinfo--get-node headline info))
 	 (format command full-text)
 	 contents))))))