Add optional image caption taken from <section>/image.md.

This commit is contained in:
Jim Hague 2019-03-26 11:00:35 +00:00
parent 935693b587
commit a087c28ecf
5 changed files with 14 additions and 8 deletions

1
Morris/image.md Normal file
View File

@ -0,0 +1 @@
Barbara Payne, _Havoc Musicians_

1
Session/image.md Normal file
View File

@ -0,0 +1 @@
Barbara Payne, _The Harlequin_

View File

@ -1,6 +1,7 @@
\input{docclass.tex}
\usepackage{array}
\usepackage{caption}
\usepackage{color}
\usepackage{fontspec}
\usepackage{graphicx}
@ -77,10 +78,13 @@
% Show the section graphic.
% Args are the graphic filename.
\newcommand{\showsectiongraphic}[1]{%
\newcommand{\showsectiongraphic}[2]{%
\begin{figure}[h!]
\begin{center}
\includegraphics[height=0.60\textheight,keepaspectratio]{#1}
\end{center}
\ifemptyarg{#2}{}{\caption*{#2}}
\end{figure}
}
% ----- Paper size document setup

View File

@ -15,7 +15,7 @@
\ifdim \paperheight<200mm \newpage \fi
\showsectiongraphic{@SECTION@-image.jpg}
\showsectiongraphic{@SECTION@-image.jpg}{\input{@SECTION@-image.tex}}
\vspace*{\fill}

View File

@ -74,7 +74,7 @@ do
touch $builddir/$1-$item
fi
done
for item in intro
for item in intro image
do
rm -f $builddir/$1-$item.tex
if [ -r $section/$item.md ]; then
@ -84,8 +84,8 @@ do
fi
done
sed -e "s/@SECTION@/$1/" -e "s/@SECTIONNAME@/$sectionname/" dottes.tex.section-tunes >> $builddir/tunes.tex
sed -e "s/@SECTION@/$1/" -e "s/@SECTIONNAME@/$sectionname/" dottes.tex.section-firstlines >> $builddir/firstlines.tex
sed -e "s/@SECTION@/$1/g" -e "s/@SECTIONNAME@/$sectionname/g" dottes.tex.section-tunes >> $builddir/tunes.tex
sed -e "s/@SECTION@/$1/g" -e "s/@SECTIONNAME@/$sectionname/g" dottes.tex.section-firstlines >> $builddir/firstlines.tex
shift
done