From 631ca3fcc40f8aa12ea8cc1c1b15566727c7493e Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Sat, 13 Jun 2009 17:42:18 +0200 Subject: [PATCH] =?UTF-8?q?Ora=20l'esportazione=20in=20latex=20=C3=A8=20co?= =?UTF-8?q?nscia=20del=20titolo=20impostato=20nelle=20preferenze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/latex_manager.py | 21 ++++++++++++--------- songbook-editor.py | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/libs/latex_manager.py b/libs/latex_manager.py index b12418b..fe93725 100644 --- a/libs/latex_manager.py +++ b/libs/latex_manager.py @@ -66,7 +66,7 @@ class latex_manager(): j += 1 return m - def export_songbook(self,song_list): + def export_songbook(self,song_list, opt): # Assume that song list is an array of songs and # create a songbook with them @@ -75,23 +75,26 @@ class latex_manager(): # TODO: Latex code to compile the songbook # Document class - buf += "\documentclass[10pt,a5paper,twoside]{book}\n" + buf += "\\documentclass[10pt,a5paper,twoside]{book}\n" # Packages - buf += "\usepackage[a5paper,chordbk]{songbook}\n" - buf += "\usepackage[utf8x]{inputenc}\n" - buf += "\usepackage{makeidx}\n" + buf += "\\usepackage[a5paper,chordbk]{songbook}\n" + buf += "\\usepackage[utf8x]{inputenc}\n" + buf += "\\usepackage{makeidx}\n" buf += "\n\n" # Index generation - buf += "\MakeTitleIndex\n" - buf += "\MakeTitleContents\n" - buf += "\MakeKeyIndex\n" - buf += "\makeindex\n" + buf += "\\MakeTitleIndex\n" + buf += "\\MakeTitleContents\n" + buf += "\\MakeKeyIndex\n" + buf += "\\makeindex\n" buf += "\n\n" # Document begins buf += "\\begin{document}\n\n" + + # Main title + buf += "\\title{" + opt["title"] + "}" for song in song_list: buf += "\n\n" # Put some space between songs diff --git a/songbook-editor.py b/songbook-editor.py index 634335a..461e4df 100755 --- a/songbook-editor.py +++ b/songbook-editor.py @@ -233,7 +233,7 @@ class interface(QtGui.QMainWindow): def export_songbook(self): # Chiedo al latex manager di farlo.. :) - sbk = lm.export_songbook(self.song_db) + sbk = lm.export_songbook(self.song_db, widget.opt) # Apriamo un file filename = QtGui.QFileDialog.getSaveFileName(self, "Salva file latex", "/home/leonardo", "LaTeX Source File (*.tex)") -- 2.1.4