Engine for LaTeX songbooks http://www.patacrep.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

166 lines
4.1 KiB

% Crepbook Package -- version 0.1 for LaTeX2e
%
% This package is intend to use with the songbook package.
% It defines some layout for automatic songbook generation.
% See http://github.com/patacrep/songbook-core/
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{crepbook}[2014/04/13 Crepbook Package, version 0.1]
\newif{\iffancycapo}
\DeclareOption{fancy-capo}{\fancycapotrue}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{SongbookUtils}}
\ProcessOptions\relax
\RequirePackage{SongbookUtils}
\ifpictures
\fancycapotrue
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management
\AtBeginDocument{
% Default names (english)
\def\labelversionname{Version:}
\def\labeldatename{Date:}
\def\labelauthorname{Authors:}
\def\labelwebname{Web:}
\def\labelmailname{Email:}
\IfStrEq{\mainlanguage}{french}{
% French names
\def\labelversionname{Version~:}
\def\labeldatename{Date~:}
\def\labelauthorname{Auteurs~:}
\def\labelwebname{Web~:}
\def\labelmailname{Mail~:}
}{}
}
\def\lang#1{\def\mainlanguage{#1}}
% End of multilanguage management
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
\long\def\subtitle#1{\long\def\@subtitle{#1}}
\def\version#1{\def\@version{#1}}
\def\web#1{\def\@web{#1}}
\def\mail#1{\def\@mail{#1}}
\def\email#1{\def\@email{#1}}
\def\picture#1{\def\@picture{#1}}
\def\picturecopyright#1{\def\@picturecopyright{#1}}
\def\footer#1{\def\@footer{#1}}
\def\clearheadinfo{
\author{}%
\title{No title}%
\subtitle{}%
\version{}%
\web{}%
\mail{}%
\email{}%
\picture{}%
\picturecopyright{}%
}
\clearheadinfo
\def\maketitle{
\@maketitle
\clearheadinfo
}
\newcounter{@inst}
\newcounter{@auth}
\newcounter{auco}
\def\@titlefont{\Huge\bfseries\boldmath}
\def\@subtitlefont{\large\bfseries\boldmath}
\def\@getelement#1{\csname @#1\endcsname}
\def\@labelelement#1{\csname label#1name\endcsname}
\def\@insertelement#1{\if!\@getelement{#1}!
\else %
\@labelelement{#1}& %
\@getelement{#1} \cr %
\fi %
}
\def\@maketitle{
\def\and{\unskip,\cr&}
\begin{titlepage}
\thispagestyle{empty}
\begin{center}
{\rule{\textwidth}{1mm}}
{\@titlefont\@title\par}
\if!\@subtitle!\else
{\hfil\@subtitlefont\@subtitle\par}
\fi
{\rule{\textwidth}{1mm}}
\end{center}
\vfil
\ialign{
\bf{##} \hfil & ## \hfil \cr % Lines definition
\@insertelement{version} %
\@insertelement{date} %
\@insertelement{author} %
\@insertelement{web} %
\@insertelement{mail} %
}
\vfil
\begin{center}
\includegraphics[keepaspectratio=true, width=12cm, height=12cm]{\@picture}
\vskip1em
{\hfil\hbox{\small \@picturecopyright}}
\end{center}
\begin{flushright}
\vfil
{\hfil\rule{.4\textwidth}{.75pt}\par}
\@footer
\end{flushright}
\end{titlepage}
}
% Fancy capo
\iffancycapo %
\newlength{\capoheight}
\setlength{\capoheight}{1.5cm}
\renewcommand\capo[1]{%
\iftranscapos%
\transpose{#1}%
\fi%
\mbox{%
\includegraphics[height=\capoheight]{capodastre}%
\put(-22,8){\Large #1}
}%
}
\fi
% Fonts definitions
\def\chordfont#1{\gdef\@chordfont{#1}}
\def\@chordfont{\small\it}
\renewcommand{\idxtitlefont}{\sffamily\bfseries}
\renewcommand{\idxauthfont}{\sffamily\bfseries}
\renewcommand{\idxheadfont}{\sffamily\it\LARGE}
\renewcommand{\idxrefsfont}{\bfseries}
% Configuration of the songs package
\titleprefixword{}
\renewcommand{\stitlefont}{\LARGE\bf}
\renewcommand{\printchord}[1]{\@chordfont #1}
\renewcommand{\chorusfont}{\it}
\renewcommand{\lyricfont}{\normalfont\normalsize}
\renewcommand{\showauthors}{%
\hbox{\normalsize\songauthors}%
}
\endinput