m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2021-09-12 21:19:42 +0200
committerMarcin Chrzanowski <m@m-chrzan.xyz>2021-09-12 21:19:42 +0200
commit236cbc380efbf1e36f8b31511b59298747acc0b1 (patch)
treebab73bb05120dca5a3351e02753b3f04b0853cba /templates
parent04768d5433f3fdade45b18dacf1159177f2f8fa8 (diff)
Add songbook generation
Diffstat (limited to 'templates')
-rw-r--r--templates/song-partial.tex.erb9
-rw-r--r--templates/song.tex.erb18
-rw-r--r--templates/songbook.tex.erb44
3 files changed, 57 insertions, 14 deletions
diff --git a/templates/song-partial.tex.erb b/templates/song-partial.tex.erb
new file mode 100644
index 0000000..7811c22
--- /dev/null
+++ b/templates/song-partial.tex.erb
@@ -0,0 +1,9 @@
+\tyt{<%= song.title %>}
+
+\begin{alltt} \rmfamily
+<%= song.lyrics %>
+\end{alltt}
+
+<%- if File.file? tmp(song_sheet_pdf song.id) -%>
+\includegraphics[width=\textwidth]{<%= tmp(song_sheet_pdf song.id) %>}
+<%- end -%>
diff --git a/templates/song.tex.erb b/templates/song.tex.erb
index 1e98547..7cf5fe6 100644
--- a/templates/song.tex.erb
+++ b/templates/song.tex.erb
@@ -2,23 +2,13 @@
\usepackage{graphicx}
\usepackage{alltt}
-\title{<%= song.title %>}
-\date{}
+\newcommand{\tyt}[1]{\section{#1}}
+\setcounter{secnumdepth}{0}
\begin{document}
-\maketitle
+\pagenumbering{gobble}
-\begin{alltt} \rmfamily
-<%= song.lyrics %>
-\end{alltt}
-
-<%- p "tmp sheet file: #{tmp(song_sheet_pdf song.id)}" -%>
-<%- if File.file? tmp(song_sheet_pdf song.id) -%>
-\begin{figure}
- \centering
- \includegraphics[width=\textwidth]{<%= tmp(song_sheet_pdf song.id) %>}
-\end{figure}
-<%- end -%>
+\input{<%= tmp(song_partial_tex song.id) %>}
\end{document}
diff --git a/templates/songbook.tex.erb b/templates/songbook.tex.erb
new file mode 100644
index 0000000..7a496c6
--- /dev/null
+++ b/templates/songbook.tex.erb
@@ -0,0 +1,44 @@
+\documentclass[12pt,a4paper,titlepage,openany]{book}
+\usepackage{fontenc}
+\usepackage{polski}
+\usepackage[utf8]{inputenc}
+\usepackage{graphicx}
+\usepackage{hyperref}
+\usepackage{alltt}
+\usepackage{makeidx}
+\usepackage{titlesec}
+
+\newcommand{\tyt}[1]{\phantomsection \section{#1} }
+\setcounter{secnumdepth}{0}
+
+\begin{document}
+
+\begin{titlepage}
+ \raggedleft
+
+ \rule{1pt}{\textheight}
+ \hspace{0.05\textwidth}
+ \parbox[b]{0.75\textwidth}{
+ {\textsc{Marcin Chrzanowski} przedstawia}
+ \\[2\baselineskip]
+ {\Huge\bfseries Ĺšpiewnik \\[0.5\baselineskip] Chmielowy}
+ \\[14\baselineskip]
+ \begin{flushright}
+ Wersja~~\fbox{$0.1$}
+ \end{flushright}
+ }
+\end{titlepage}
+\raggedbottom
+\pagestyle{plain}
+
+\tableofcontents
+\clearpage
+
+\phantomsection
+\begin{flushleft}
+<%- songs.keys.sort.each do |song_id| -%>
+ \input{<%= tmp (song_partial_tex song_id) %>}\clearpage
+<%- end -%>
+\end{flushleft}
+
+\end{document}