L'esportazione in latex ora è funzionante, ma ancora ignora le

Leonardo Robol [2009-05-15 16:10]
L'esportazione in latex ora è funzionante, ma ancora ignora le
opzioni che l'utente ha impostato
Filename
latex_manager.py
songbook-editor.py
diff --git a/latex_manager.py b/latex_manager.py
index 13ed9d8..b12418b 100644
--- a/latex_manager.py
+++ b/latex_manager.py
@@ -74,11 +74,35 @@ class latex_manager():
         buf = unicode()

         # TODO: Latex code to compile the songbook
+        # Document class
+        buf += "\documentclass[10pt,a5paper,twoside]{book}\n"
+
+        # Packages
+        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 += "\n\n"
+
+        # Document begins
+        buf += "\\begin{document}\n\n"

         for song in song_list:
             buf += "\n\n" # Put some space between songs
             buf += "% Canzone:" + song.title + "\n\n"
             buf += self.create_song(song)
+
+        # The Index
+        buf += "\printindex\n"
+
+        # Document ends
+        buf += "\end{document}\n\n"

         # Give buffer back to be printed
         return buf
diff --git a/songbook-editor.py b/songbook-editor.py
index 5624598..174f7de 100755
--- a/songbook-editor.py
+++ b/songbook-editor.py
@@ -251,7 +251,8 @@ class interface(QtGui.QMainWindow):
         self.opt["type"] = "tc" ## tc = text and chords, c = only chords, s = slide


-
+# This class manage the Dialog that prompt the user for
+# common options...
 class option_interface(QtGui.QWidget):
     def __init__(self, parent=None):
         super(option_interface,self).__init__(parent)
ViewGit