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{graphicx,xcolor} %
\RequirePackage{epstopdf} % \RequirePackage{epstopdf} %
\RequirePackage{fancybox} \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{xstring}
\RequirePackage{framed} \RequirePackage{framed}
\RequirePackage{currfile} \RequirePackage{currfile}
@ -75,6 +67,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management % Multilanguage management
\def\lang#1{\def\mainlanguage{#1}}
\AtBeginDocument{ \AtBeginDocument{
% Default names (english) % Default names (english)
\def\songlistname{Songs list} \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? % One song per page?

36
songbook_core/data/latex/crepbook.sty

@ -1,6 +1,7 @@
% Crepbook Package -- version 0.1 for LaTeX2e % 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. % It defines some layout for automatic songbook generation.
% See http://github.com/patacrep/songbook-core/ % See http://github.com/patacrep/songbook-core/
@ -19,6 +20,36 @@
\fancycapotrue \fancycapotrue
\fi \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 % Multilanguage management
@ -40,9 +71,6 @@
}{} }{}
} }
\def\lang#1{\def\mainlanguage{#1}}
% End of multilanguage management % End of multilanguage management
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

34
songbook_core/data/latex/tabs.sty

@ -77,40 +77,6 @@
{ {
\end{tikzpicture} \end{tikzpicture}
} }
\else%
\newenvironment{tab}{%
\newcommand{\single}[2]{}%
\renewcommand{\bar}{}%
}{}%
\fi% \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 \endinput

9
songbook_core/data/templates/default.tex

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

7
songbook_core/data/templates/layout.tex

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

21
songbook_core/data/templates/patacrep.tex

@ -43,6 +43,17 @@
(* extends "default.tex" *) (* 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 *) (* block songbookpreambule *)
\usepackage[ \usepackage[
a4paper % paper size a4paper % paper size
@ -64,4 +75,14 @@
\renewcommand{\snumbgcolor}{SongNumberBgColor} \renewcommand{\snumbgcolor}{SongNumberBgColor}
\renewcommand{\notebgcolor}{NoteBgColor} \renewcommand{\notebgcolor}{NoteBgColor}
\renewcommand{\idxbgcolor}{IndexBgColor} \renewcommand{\idxbgcolor}{IndexBgColor}
\subtitle{((subtitle))}
(* if version!="unknown" *)
\version{((version))}
(* endif *)
\mail{((mail))}
\web{((web))}
\picture{((picture))}
\picturecopyright{((picturecopyright))}
\footer{((footer))}
(* endblock *) (* endblock *)

17
songbook_core/data/templates/songs.tex

@ -21,16 +21,31 @@
(* extends "layout.tex" *) (* extends "layout.tex" *)
(* block songbookpreambule *) (* block songbookpackages *)
(( super() )) (( 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() *) (* for lang in content.languages() *)
\PassOptionsToPackage{((lang))}{babel} \PassOptionsToPackage{((lang))}{babel}
(* endfor *) (* endfor *)
\usepackage[((lang))]{babel} \usepackage[((lang))]{babel}
\lang{((lang))}
\usepackage{graphicx}
\graphicspath{{((datadir))/img/}} \graphicspath{{((datadir))/img/}}
\makeatletter
\@ifpackageloaded{hyperref}{}{\newcommand{\phantomsection}{}}
\makeatother
(* endblock *) (* endblock *)
(* block songs *) (* block songs *)

Loading…
Cancel
Save