[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
54/66: programming-2022: Use BibTeX for bibliography; include DOI.
From: |
Ludovic Courtès |
Subject: |
54/66: programming-2022: Use BibTeX for bibliography; include DOI. |
Date: |
Wed, 29 Jun 2022 11:32:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit c0651347d20a5f9b3a3abf189646b366ec3accca
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Apr 28 15:27:49 2022 +0200
programming-2022: Use BibTeX for bibliography; include DOI.
* doc/programming-2022/bibliography.scm: New file.
* doc/programming-2022/supply-chain.skb: Include it, and remove use of
'references' from (skribilo packages acmproc).
---
doc/programming-2022/bibliography.scm | 68 +++++++++++++++++++++++++++++++++++
doc/programming-2022/supply-chain.skb | 7 +++-
2 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/doc/programming-2022/bibliography.scm
b/doc/programming-2022/bibliography.scm
new file mode 100644
index 0000000..28d570c
--- /dev/null
+++ b/doc/programming-2022/bibliography.scm
@@ -0,0 +1,68 @@
+;; Bibliography via BibTeX. Taken from (skribilo packages lncs).
+
+(define (bib-entry-template kind)
+ ;; Return a template for KIND that includes a DOI.
+ ;; Note: This uses the API of Skribilo 0.9.5 and earlier.
+ (let ((template (make-bib-entry-template/default kind)))
+ `(,@template (" DOI: " doi))))
+
+(when-engine-is-loaded 'latex
+ (lambda ()
+ (let ((latex (find-engine 'latex)))
+
+ ;; Use the native bibliography system (BibTeX).
+
+ (markup-writer 'bib-ref latex
+ :options '(:text :bib)
+ :action (lambda (n e)
+ (let ((entry (handle-ast (markup-body n))))
+ (format #t "\\cite{~a}" (markup-ident entry)))))
+
+ (markup-writer 'bib-ref+ latex
+ :options '(:text :bib :sort-bib-refs)
+ :action (lambda (n e)
+ (let ((entries (map (lambda (bib-ref)
+ (handle-ast (markup-body bib-ref)))
+ (markup-body n)))
+ (sort-proc (markup-option n :sort-bib-refs)))
+ (format #t "\\cite{~a}"
+ (string-join (map markup-ident
+ (if (procedure? sort-proc)
+ (sort entries sort-proc)
+ entries))
+ ",")))))
+
+ (markup-writer '&the-bibliography latex
+ :before (lambda (n e)
+ (let ((count (length (markup-body n))))
+ (format #t "\\begin{thebibliography}{~a}\n"
+ count)))
+ :after "\\end{thebibliography}\n")
+
+ (markup-writer '&bib-entry-body
+ :action (lambda (n e)
+ (let* ((kind (markup-option n 'kind))
+ (template (bib-entry-template kind)))
+ (output-bib-entry-template n e template))))
+
+ (markup-writer '&bib-entry latex
+ :action (lambda (n e)
+ (display "%\n\\bibitem[")
+ (output (markup-option n :title) e)
+ (format #t "]{~a}\n" (markup-ident n))
+ (output n e (markup-writer-get '&bib-entry-body e)))
+ :after "\n%\n")
+
+ ;; Journal and book titles must not be italicized.
+ (markup-writer '&bib-entry-booktitle latex
+ :action (lambda (n e)
+ (let ((title (markup-body n)))
+ (evaluate-document title e))))
+
+ (markup-writer '&bib-entry-journal latex
+ :action (lambda (n e)
+ (evaluate-document (markup-body n) e))))))
+
+;;; Local Variables:
+;;; eval: (put 'markup-writer 'scheme-indent-function 2)
+;;; End:
diff --git a/doc/programming-2022/supply-chain.skb
b/doc/programming-2022/supply-chain.skb
index 7259359..91b5486 100644
--- a/doc/programming-2022/supply-chain.skb
+++ b/doc/programming-2022/supply-chain.skb
@@ -8,6 +8,7 @@
(skribilo lib)
(skribilo evaluator)
(skribilo biblio author)
+ (skribilo biblio template)
(skribilo source)
(skribilo source lisp)
(skribilo source parameters)
@@ -145,6 +146,8 @@
(define (acmart-abstract . body)
(!latex "\\begin{abstract}\n$1\n\\end{abstract}\n" body))
+(include "bibliography.scm")
+
(bibliography "../els-2013/guix.sbib")
(bibliography "../reppar-2015/reppar.sbib")
(bibliography "security.sbib")
@@ -1420,7 +1423,9 @@ possibly allowing users to register those when they first
pull from the
channel. All this requires more thought, but it looks like there are
new opportunities here.]))
- (references))
+ (flush :side 'left
+ (the-bibliography
+ :sort bib-sort/first-author-last-name)))
;;; Local Variables:
;;; coding: utf-8
- 24/66: icse-2022: Mention SLSA and Git{Lab,Hub}., (continued)
- 24/66: icse-2022: Mention SLSA and Git{Lab,Hub}., Ludovic Courtès, 2022/06/29
- 27/66: icse-2022: Add reviews and response., Ludovic Courtès, 2022/06/29
- 28/66: icse-2022: Repurpose for <Programming> 2022., Ludovic Courtès, 2022/06/29
- 37/66: programming-2022: Improve rendering of in-line 'prog'., Ludovic Courtès, 2022/06/29
- 39/66: programming-2022: Add illustrations., Ludovic Courtès, 2022/06/29
- 40/66: programming-2022: Tweak., Ludovic Courtès, 2022/06/29
- 41/66: doc: Add CiSE article., Ludovic Courtès, 2022/06/29
- 34/66: programming-2022: Clarify bits., Ludovic Courtès, 2022/06/29
- 46/66: programming-2022: Fix typos and wording issues reported by reviewers., Ludovic Courtès, 2022/06/29
- 50/66: programming-2022: Address comments from Reviewer A., Ludovic Courtès, 2022/06/29
- 54/66: programming-2022: Use BibTeX for bibliography; include DOI.,
Ludovic Courtès <=
- 55/66: programming-2022: Clean up bibliography entries., Ludovic Courtès, 2022/06/29
- 56/66: programming-2022: Mention SSH signatures., Ludovic Courtès, 2022/06/29
- 57/66: programming-2022: Add channels and manifest., Ludovic Courtès, 2022/06/29
- 59/66: programming-2022: Cite actual full-source bootstrap., Ludovic Courtès, 2022/06/29
- 60/66: programming-2022: Add acknowledgments., Ludovic Courtès, 2022/06/29
- 61/66: programming-2022: Add \paperdetails for publication., Ludovic Courtès, 2022/06/29
- 64/66: programming-2022: Reference the artifact as requested., Ludovic Courtès, 2022/06/29
- 66/66: Merge branch 'wip-programming-paper', Ludovic Courtès, 2022/06/29