Uwe Brauer <o...@mat.ucm.es> writes: > I am not following you. You insert a header as in
> * Intro > Now you want to refer to it with a link > As we have seen in section ... > So what precisely are you typing? I type "As we have seen in section [[*Intro]]" (literally, I tend to not use any keybindings or function to insert the link). This (the "*Intro" inside double square brackets) is called an internal link to headlines and they are a default feature of Org: https://orgmode.org/manual/Internal-Links.html#Internal-Links BTW: I mostly export to PDF via LaTeX and usually use the combination of cleveref with varioref. Therefore I prefer to type "As we have seen in [[*Intro]]" (leaving out "section") and let Org generate a "\vref{...}" reference. To achive this, I need little bit of extra setup (and do not forget to add the necessary usepackage commands either locally in the Org file or add it to org-latex-default-packages-alist): #+begin_src emacs-lisp (defun sn/ox-latex-filter-special-ref-vref (text backend info) (when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string "\\\\ref{" "\\\\vref{" text))) (add-to-list 'org-export-filter-link-functions #'sn/ox-latex-filter-special-ref-vref) #+end_src If you need internal links to headings more often and do not want to type the whole heading text manually, you can use functions like this (inspired by `worf-goto' and `counsel-outline'; if you do not use ivy/swiper/counsel, the code should at least give the basic idea): #+begin_src emacs-lisp (defun sn/org-insert-internal-link () "Use ivy to insert a link to a heading in the current `org-mode' document." (interactive) (let ((settings (cdr (assq major-mode counsel-outline-settings)))) (ivy-read "Heading: " (counsel-outline-candidates settings) :action 'sn/org-insert-internal-link-action))) (defun sn/org-insert-internal-link-action (x) "Insert link for `sn/worf-insert-internal-link'" (save-excursion (goto-char (cdr x)) (call-interactively 'org-store-link)) (org-insert-last-stored-link 1) (delete-char -1)) #+end_src -- Until the next mail..., Stefan.