aliquote.org

August 23, 2020

TIL that we can use references and labels in Org babel!

You can also add a ‘-r’ switch which removes the labels from the source code. With the ‘-n’ switch, links to these references are labeled by the line numbers from the code listing. Otherwise links use the labels with no parentheses. Here is an example:

    #+BEGIN_SRC emacs-lisp -n -r
    (save-excursion                 (ref:sc)
        (goto-char (point-min))      (ref:jump)
    #+END_SRC
    In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
    jumps to point-min.