Browse Source

[WIP] Application des discussions sur les packages

Discussions :

- http://github.com/patacrep/songbook-core/pull/32#issuecomment-43410215
- ba15ad1093 (commitcomment-6359206)
pull/32/head
Louis 11 years ago
parent
commit
fb4095fa77
  1. 28
      songbook_core/data/latex/SongbookUtils.sty
  2. 36
      songbook_core/data/latex/crepbook.sty
  3. 34
      songbook_core/data/latex/tabs.sty
  4. 9
      songbook_core/data/templates/default.tex
  5. 7
      songbook_core/data/templates/layout.tex
  6. 21
      songbook_core/data/templates/patacrep.tex
  7. 17
      songbook_core/data/templates/songs.tex

28
songbook_core/data/latex/SongbookUtils.sty

@ -9,14 +9,6 @@
\RequirePackage{graphicx,xcolor} %
\RequirePackage{epstopdf} %
\RequirePackage{fancybox}
\definecolor{tango-green-3}{HTML}{4e9a06}
\definecolor{tango-blue-3}{HTML}{204a87}
\RequirePackage[bookmarks,
bookmarksopen,
hyperfigures=true,
colorlinks=true,
linkcolor=tango-green-3,
urlcolor=tango-blue-3]{hyperref}
\RequirePackage{xstring}
\RequirePackage{framed}
\RequirePackage{currfile}
@ -75,6 +67,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management
\def\lang#1{\def\mainlanguage{#1}}
\AtBeginDocument{
% Default names (english)
\def\songlistname{Songs list}
@ -350,24 +344,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout tweaks
% Configuration of the songs package
% Horizontal space reserved to verse number
\setlength{\versenumwidth}{1em}
% Modifier to the space between consecutive lines of lyrics
\baselineadj=-6pt plus 0pt minus 2pt
% Space between verses and chorus
\versesep=6pt plus 2pt minus 2pt
% Paragraph indentation space
\setlength{\parindent}{0.3cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% One song per page?

36
songbook_core/data/latex/crepbook.sty

@ -1,6 +1,7 @@
% Crepbook Package -- version 0.1 for LaTeX2e
%
% This package is intended to be used with the songbook package.
% This package is intended to be used with the songbook Python program (and its
% interfaces).
% It defines some layout for automatic songbook generation.
% See http://github.com/patacrep/songbook-core/
@ -19,6 +20,36 @@
\fancycapotrue
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Custom hyperref options
\definecolor{tango-green-3}{HTML}{4e9a06}
\definecolor{tango-blue-3}{HTML}{204a87}
\RequirePackage[bookmarks,
bookmarksopen,
hyperfigures=true,
colorlinks=true,
linkcolor=tango-green-3,
urlcolor=tango-blue-3]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Layout tweaks
% Configuration of the songs package
% Horizontal space reserved to verse number
\setlength{\versenumwidth}{1em}
% Modifier to the space between consecutive lines of lyrics
\baselineadj=-6pt plus 0pt minus 2pt
% Space between verses and chorus
\versesep=6pt plus 2pt minus 2pt
% Paragraph indentation space
\setlength{\parindent}{0.3cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management
@ -40,9 +71,6 @@
}{}
}
\def\lang#1{\def\mainlanguage{#1}}
% End of multilanguage management
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

34
songbook_core/data/latex/tabs.sty

@ -77,40 +77,6 @@
{
\end{tikzpicture}
}
\else%
\newenvironment{tab}{%
\newcommand{\single}[2]{}%
\renewcommand{\bar}{}%
}{}%
\fi%
\let\musicnoteORIG\musicnote
\renewcommand{\musicnote}[2][]{%
\vspace{.1cm}
\IfStrEq{}{#1}{\musicnoteORIG{#2}}{
\iflanguage{#1}{\musicnoteORIG{#2}}{}
}
}
\let\textnoteORIG\textnote
\renewcommand{\textnote}[2][]{%
\vspace{.1cm}
\IfStrEq{}{#1}{\textnoteORIG{#2}}{
\iflanguage{#1}{\textnoteORIG{#2}}{}
}
}
\renewcommand{\FrameCommand}[1]{
\begin{tikzpicture}
\node[rectangle] (rect) {
\begin{minipage}{.8\textwidth}
#1
\end{minipage}
};
\draw[very thick, dashed] (rect.north west) -- (rect.south west);
\end{tikzpicture}
}
\endinput

9
songbook_core/data/templates/default.tex

@ -80,15 +80,6 @@
\title{((title))}
\author{((author))}
\subtitle{((subtitle))}
(* if version!="unknown" *)
\version{((version))}
(* endif *)
\mail{((mail))}
\web{((web))}
\picture{((picture))}
\picturecopyright{((picturecopyright))}
\footer{((footer))}
\newindex{titleidx}{((filename))_title}
\newauthorindex{authidx}{((filename))_auth}

7
songbook_core/data/templates/layout.tex

@ -74,19 +74,12 @@
(* endblock *)
(* block songbookpackages *)
\usepackage[((booktype)),
(* for option in bookoptions *)((option)),
(* endfor *)
(* for instrument in instruments *)((instrument)),
(* endfor *)]{crepbook}
(* endblock *)
(* block songbookpreambule *)
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\lang{((lang))}
(* endblock songbookpreambule *)
(* block preambule *)

21
songbook_core/data/templates/patacrep.tex

@ -43,6 +43,17 @@
(* extends "default.tex" *)
(* block songbookpackages *)
(( super() ))
\usepackage[((booktype)),
(* for option in bookoptions *)((option)),
(* endfor *)
(* for instrument in instruments *)((instrument)),
(* endfor *)]{crepbook}
\usepackage{chords}
(* endblock *)
(* block songbookpreambule *)
\usepackage[
a4paper % paper size
@ -64,4 +75,14 @@
\renewcommand{\snumbgcolor}{SongNumberBgColor}
\renewcommand{\notebgcolor}{NoteBgColor}
\renewcommand{\idxbgcolor}{IndexBgColor}
\subtitle{((subtitle))}
(* if version!="unknown" *)
\version{((version))}
(* endif *)
\mail{((mail))}
\web{((web))}
\picture{((picture))}
\picturecopyright{((picturecopyright))}
\footer{((footer))}
(* endblock *)

17
songbook_core/data/templates/songs.tex

@ -21,16 +21,31 @@
(* extends "layout.tex" *)
(* block songbookpreambule *)
(* block songbookpackages *)
(( super() ))
\usepackage[((booktype)),
(* for option in bookoptions *)((option)),
(* endfor *)
(* for instrument in instruments *)((instrument)),
(* endfor *)]{SongbookUtils}
(* endblock *)
(* block songbookpreambule *)
(( super() ))
(* for lang in content.languages() *)
\PassOptionsToPackage{((lang))}{babel}
(* endfor *)
\usepackage[((lang))]{babel}
\lang{((lang))}
\usepackage{graphicx}
\graphicspath{{((datadir))/img/}}
\makeatletter
\@ifpackageloaded{hyperref}{}{\newcommand{\phantomsection}{}}
\makeatother
(* endblock *)
(* block songs *)

Loading…
Cancel
Save