From c1e2823db96c9d7ab43373fd5d7a29fd24379e1e Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 10 May 2009 00:41:55 +0200 Subject: Support for optional hyperref and hyperref options. --- noweb.mk | 6 ++++-- sample/Makefile.sample | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/noweb.mk b/noweb.mk index 4abf01a..f620752 100644 --- a/noweb.mk +++ b/noweb.mk @@ -29,6 +29,8 @@ NW_LINEFORMAT ?= -L"\# %L \"%F\" %N" NW_MAIN ?= main NW_DOCUMENT_CLASS ?= report NW_CONTENTS ?= contents.tex +NW_HYPER ?= yes +NW_HYPER_OPTIONS ?= "colorlinks=true,linkcolor=blue" f_notangle = $(NOTANGLE) $(NW_LINEFORMAT) -R$(2) $(1) | $(CPIF) $(2); f_latex = $(1) '\scrollmode \input '"$(2)";\ @@ -62,7 +64,6 @@ code_files = $(foreach f, $(NW_FILES), $(call f_roots, $(f).nw)) code_dirs = $(sort $(filter-out ./, \ $(foreach src, $(code_files), $(dir $(src))))) - %.tex : %.nw ; $(NOWEAVE) -n -indexfrom $(main_defs) $< > $@ %.defs : %.nw ; $(NODEFS) $< > $@ @@ -78,7 +79,8 @@ $(main_tex): $(nw_contents_files) $(main_defs) $(tex_files) \ @echo "\usepackage[utf8]{inputenc}" >> $(main_tex) @for f in $(NW_PACKAGES); do echo "\usepackage{$$f}" >> $(main_tex); \ done - @echo "\usepackage{hyperref}" >> $(main_tex) + @if [ "x$(HW_HYPER)" != "xno" ]; \ + then echo "\usepackage[$(NW_HYPER_OPTIONS)]{hyperref}" >> $(main_tex); fi @echo "\begin{document}" >> $(main_tex) @for f in $(NW_PRE_TEX); do echo "\input{$$f}" >> $(main_tex); done @for f in $(nw_contents_files); do \ diff --git a/sample/Makefile.sample b/sample/Makefile.sample index a18a985..95e7719 100644 --- a/sample/Makefile.sample +++ b/sample/Makefile.sample @@ -43,6 +43,10 @@ NW_SUBDIRS = . # NW_LINEFORMAT = -L"\# %L \"%F\" %N" NW_LINEFORMAT = +# Options for the hyperref package +# HW_HYPER = yes +# NW_HYPER_OPTIONS = "colorlinks=true,linkcolor=blue" + # Location of noweb.mk NW_MAKEFILE = ../noweb.mk -- cgit v1.2.3