diff --git a/chordbook.tex b/chordbook.tex index 37793a34..df2a1519 100644 --- a/chordbook.tex +++ b/chordbook.tex @@ -30,16 +30,13 @@ \usepackage[english,french]{babel} \usepackage{fancybox} +\usepackage{songbook} + \newindex{titleidx}{cbtitle} \newauthorindex{authidx}{cbauth} -%Remove comment to include pictures in the songbook -\newcommand{\image}[2]{\begin{flushright} \includegraphics[width=#2cm]{#1}\end{flushright}} -%\newcommand{\image}[2]{} -%\renewcommand{\gtab}[2]{} - \graphicspath{ - {img/} + {img/}, } %\includeonlysongs{1} @@ -47,7 +44,9 @@ \renewcommand{\stitlefont}{\LARGE\bf} \renewcommand{\printchord}[1]{\small{\it#1}} \renewcommand{\chorusfont}{\it} -\renewcommand{\showauthors}{\normalsize\songauthors} +\renewcommand{\showauthors}{% + \hbox{\normalsize\songauthors}% +} \renewcommand{\idxtitlefont}{\sffamily\bfseries} \renewcommand{\idxauthfont}{\sffamily\bfseries} \renewcommand{\idxheadfont}{\sffamily\it\LARGE} diff --git a/lyricbook.tex b/lyricbook.tex index 1a66351d..36c348a6 100644 --- a/lyricbook.tex +++ b/lyricbook.tex @@ -32,6 +32,8 @@ \usepackage[english,french]{babel} \usepackage{fancybox} +\usepackage{songbook} + \setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in} \setlength{\textwidth}{6.5in} @@ -47,11 +49,6 @@ \newindex{titleidx}{lbtitle} \newauthorindex{authidx}{lbauth} -%Remove comment to include pictures in the songbook -\newcommand{\image}[2]{\begin{flushright} \includegraphics[width=#2cm]{#1}\end{flushright}} -%\newcommand{\image}[2]{} -\renewcommand{\gtab}[2]{} - \graphicspath{ {img/} } diff --git a/makefile b/makefile index 807121c7..df23e1ed 100644 --- a/makefile +++ b/makefile @@ -28,9 +28,11 @@ SONGS = songs.sbd SONGS_SRC = $(shell ls songs/*/*.sg) MAKE_INDEX=./make-index +PRINT=printf "%s\n" +PRINTTAB=printf "\t%s\n" ifeq ($(shell which ikiwiki),) -IKIWIKI=echo "** ikiwiki not found" >&2 ; echo ikiwiki +IKIWIKI=$(ECHO) "** ikiwiki not found" >&2 ; $(ECHO) ikiwiki else IKIWIKI=ikiwiki endif @@ -102,9 +104,9 @@ $(PDF): %.pdf: %.tex %.aux $(MAKE_INDEX) $< > $@ %.d: %.tex - @$(get_dependencies) ; echo $< $@: $$deps > $@ - @$(get_inclusions) ; echo $(patsubst %.tex,%.pdf,$<) : $$incl >> $@ ; echo "\t"$$\(LATEX\) $< >> $@ ; - @$(get_prereq) ; echo $$prep : $(patsubst %.tex,%.aux,$<) >> $@ ; + @$(get_dependencies) ; $(PRINT) "$< $@: $$deps" > $@ + @$(get_inclusions) ; $(PRINT) "$(patsubst %.tex,%.pdf,$<) : $$incl" >> $@ ; $(PRINTTAB) "\$$(LATEX) $<" >> $@ ; + @$(get_prereq) ; $(PRINT) "$$prep : $(patsubst %.tex,%.aux,$<)" >> $@ ; include $(SOURCES:%.tex=%.d) @@ -112,7 +114,7 @@ include $(SOURCES:%.tex=%.d) # that is not all but no other rules are easy to move around %.aux: $(SONGS) +COMMA=, $(SONGS): $(SONGS_SRC) - @cat $(SONGS_SRC) > $@ - - + @$(PRINT) "\graphicspath{{img/},$(patsubst %,{%}$(COMMA),$(dir $(SONGS_SRC)))}" > $@ + @cat $(SONGS_SRC) >> $@ diff --git a/songbook.sty b/songbook.sty new file mode 100644 index 00000000..3002fcb9 --- /dev/null +++ b/songbook.sty @@ -0,0 +1,34 @@ +\makeatletter + +\newlength{\coverheight} +\setlength{\coverheight}{2cm} +\newlength{\coverspace} +\setlength{\coverspace}{0.1cm} +\newcommand{\songcover}{} +\newsongkey{cov}{\let\songcover\@empty}{\def\songcover{#1}} +\newcommand\cover{% + \ifchorded% + \ifx\songcover\@empty\else% + \mbox{% + \includegraphics[height=\coverheight]{\songcover}% + \hspace{\coverspace}% + }% + \fi% + \fi% +} + +\iflyric% + \renewcommand{\gtab}[2]{}% +\fi% + +\newcommand{\image}[2]{% + \ifchorded% + \begin{flushright}% + \includegraphics[width=#2cm]{#1}% + \end{flushright}% + \fi% +} + +\makeatother + +