diff options
author | Ludovic Court`es | 2007-01-29 18:21:45 +0000 |
---|---|---|
committer | Ludovic Court`es | 2007-01-29 18:21:45 +0000 |
commit | f64342046c558768f42f409c938d427b925a2332 (patch) | |
tree | fa8eeea008acba6097292c3849cc00f48b42d045 /src/guile | |
parent | efbdc3a3660be32ab943e268ac812cd72c5fc230 (diff) | |
parent | 93c5157e92dc3506aa2b8fd1ab7c611a5f14eb6d (diff) | |
download | skribilo-f64342046c558768f42f409c938d427b925a2332.tar.gz skribilo-f64342046c558768f42f409c938d427b925a2332.tar.lz skribilo-f64342046c558768f42f409c938d427b925a2332.zip |
`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: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-47
Diffstat (limited to 'src/guile')
-rw-r--r-- | src/guile/skribilo/engine/latex.scm | 27 |
1 files 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 ... */ |