From 93c5157e92dc3506aa2b8fd1ab7c611a5f14eb6d Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Mon, 29 Jan 2007 14:27:34 +0000 Subject: `latex' engine: Fixed `ref' with both `:handle' and `:text'. * src/guile/skribilo/engine/latex.scm (ref): Fixed output of `:handle' refs with a `:text' option. Use `hyperref' to produce cross-references with hyperlinks. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-10 --- src/guile/skribilo/engine/latex.scm | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/guile/skribilo/engine/latex.scm b/src/guile/skribilo/engine/latex.scm index e62155a..183c822 100644 --- a/src/guile/skribilo/engine/latex.scm +++ b/src/guile/skribilo/engine/latex.scm @@ -1494,17 +1494,26 @@ :action (lambda (n e) (let ((t (markup-option n :text))) (if t - (begin - (output t e) - (output "~" e (markup-writer-get '~ e)))))) + (let* ((c (handle-ast (markup-body n))) + (i (markup-ident c)) + (hyper? (engine-custom e 'hyperref))) + (if (and hyper? i) + (printf "\\hyperref[~a]{" i)) + (output t e) + (if (and hyper? i) + (printf "}")))))) :after (lambda (n e) (let* ((c (handle-ast (markup-body n))) - (id (markup-ident c))) - (if (markup-option n :page) - (printf "\\begin{math}{\\pageref{~a}}\\end{math}" - (string-canonicalize id)) - (printf "\\ref{~a}" - (string-canonicalize id)))))) + (id (markup-ident c)) + (t (markup-option n :text))) + (cond ((markup-option n :page) + (printf "~\\begin{math}{\\pageref{~a}}\\end{math}" + (string-canonicalize id))) + ((markup-option n :text) + #t) + (else + (printf "\\ref{~a}" + (string-canonicalize id))))))) ;*---------------------------------------------------------------------*/ ;* bib-ref ... */ -- cgit v1.2.3