Source blocks with line number annotation (Goldmark)
tags:
src-block
annotations
goldmark
linenum
Description/Summary
Org reference Cases # Default new line number start # Org source # #+begin_src emacs-lisp -n ;; this will export with line number 1 (default) (message "This is line 2") #+end_src Output # 1 2 ;; this will export with line number 1 (default) (message "This is line 2") Specify new line number start # Org source # #+begin_src emacs-lisp -n 20 ;; this will export with line number 20 (message "This is line 21") #+end_src Output # 20 21 ;; this will export with line number 20 (message "This is line 21") Default continued line numbers # Org source # #+begin_src emacs-lisp +n ;; This will be listed as line 22 (message "This is line 23") #+end_src Output # 22 23 ;; This will be listed as line 22 (message "This is line 23") Specify continued line numbers jump # Org source # #+begin_src emacs-lisp +n 10 ;; This will be listed as line 33 (message "This is line 34") #+end_src Output # 33 34 ;; This will be listed as line 33 (message "This is line 34") Specifying linenos parameter # (message "This is line 1") (message "This is line 2") (message "This is line 3") 30(message "This is line 30") 31(message "This is line 31") 32(message "This is line 32")
Content
Cases
#
Default new line number start
#
Org source
#
#+begin_src emacs-lisp -n
;; this will export with line number 1 (default)
(message "This is line 2")
#+end_src
Output
#
1
2
|
;; this will export with line number 1 (default)
(message "This is line 2")
|
Specify new line number start
#
Org source
#
#+begin_src emacs-lisp -n 20
;; this will export with line number 20
(message "This is line 21")
#+end_src
Output
#
20
21
|
;; this will export with line number 20
(message "This is line 21")
|
Default continued line numbers
#
Org source
#
#+begin_src emacs-lisp +n
;; This will be listed as line 22
(message "This is line 23")
#+end_src
Output
#
22
23
|
;; This will be listed as line 22
(message "This is line 23")
|
Specify continued line numbers jump
#
Org source
#
#+begin_src emacs-lisp +n 10
;; This will be listed as line 33
(message "This is line 34")
#+end_src
Output
#
33
34
|
;; This will be listed as line 33
(message "This is line 34")
|
Specifying linenos
parameter
#
(message "This is line 1")
(message "This is line 2")
(message "This is line 3")
30(message "This is line 30")
31(message "This is line 31")
32(message "This is line 32")
Page (Debug)
Page Params (Debug)
Key | Type | Value |
aliases | []string |
"/posts/source-block-with-line-numbers-goldmark"
|
draft | bool |
false
|
iscjklanguage | bool |
false
|
lastmod | time.Time |
2022-03-08 20:49:23 -0500 -0500
|
tags | []string |
"src-block"
"annotations"
"goldmark"
"linenum"
|
title | string |
"Source blocks with line number annotation (Goldmark)"
|
File Object (Debug)
FileInfo Variable | Value |
UniqueID |
"7b78d4912277fad301b39ac0006807b4"
|
BaseFileName |
"source-block-with-line-numbers"
|
TranslationBaseName |
"source-block-with-line-numbers"
|
Lang |
"en"
|
Section |
"posts"
|
LogicalName |
"source-block-with-line-numbers.md"
|
Dir |
"posts/"
|
Ext |
"md"
|
Path |
"posts/source-block-with-line-numbers.md"
|