From e78ee03ca101700ee5839f6a86037d3028d65ae3 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Thu, 18 Jan 2007 14:54:51 +0000 Subject: `lncs' package: Use a native LaTeX/BibTeX bibliography. * src/guile/skribilo/package/lncs.scm: Added LaTeX writers for `bib-ref', `bib-ref+', `&the-bibliography', `&bib-entry-body' and `&bib-entry'. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-5 --- src/guile/skribilo/package/lncs.scm | 59 ++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/src/guile/skribilo/package/lncs.scm b/src/guile/skribilo/package/lncs.scm index a5d06d3..abc87dd 100644 --- a/src/guile/skribilo/package/lncs.scm +++ b/src/guile/skribilo/package/lncs.scm @@ -27,16 +27,33 @@ :autoload (skribilo package base) (section font flush toc the-bibliography) :autoload (skribilo utils keywords) (the-options the-body) + :autoload (skribilo biblio template)(output-bib-entry-template + make-bib-entry-template/default) :use-module (skribilo lib) :use-module (skribilo utils syntax) :use-module (ice-9 optargs) + :use-module (srfi srfi-13) :export (abstract references)) (fluid-set! current-reader %skribilo-module-reader) +;;; Author: Manuel Serrano, Ludovic Courtès +;;; +;;; Commentary: +;;; +;;; This module provides support for writing articles for the ``Lecture Notes +;;; in Computer Science'' series (LNCS) published by Springer-Verlag. +;;; +;;; Since Springer provides a LaTeX class (called `llncs') and expects you to +;;; submit articles only in LaTeX, this module tries hard to use native LaTeX +;;; constructs when the LaTeX engine is being used, so that you can pass the +;;; generated TeX file to Springer-Verlag and make them happy. +;;; +;;; Code: + ;*---------------------------------------------------------------------*/ ;* LaTeX global customizations */ @@ -192,4 +209,44 @@ ;; Use the `abstract' command provided by the `llncs' class. (markup-writer 'lncs-abstract latex :before "\n\\begin{abstract}\n" - :after "\n\\end{abstract}\n")))) + :after "\n\\end{abstract}\n") + + + ;; 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) + :action (lambda (n e) + (let ((entries (map (lambda (bib-ref) + (handle-ast (markup-body bib-ref))) + (markup-body n)))) + (format #t "\\cite{~a}" + (string-join (map markup-ident entries) + ","))))) + + (markup-writer '&the-bibliography latex + :before "\\begin{thebibliography}{}\n" + :after "\\end{thebibliography}\n") + + (markup-writer '&bib-entry-body + :action (lambda (n e) + (let* ((kind (markup-option n 'kind)) + (template (make-bib-entry-template/default 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")))) + + +;;; lncs.scm ends here -- cgit v1.2.3