Index: src/defaults.h
===================================================================
--- src/defaults.h	(revision d97db6d321923b024598f131891e52ec5ebaffb2)
+++ src/defaults.h	(revision a885c3d9d2f8df1d77c48806a91e7d09d2f59f84)
@@ -103,3 +103,12 @@
 #define DEF_ALTERNATE_COLOR QColor(0xA00000)
 
+#ifndef QT_NO_PRINTER
+#   define DEF_PAGE_SIZE QPrinter::A4
+#   define DEF_PAGE_ORIENTATION QPrinter::Portrait
+#   define DEF_MARGIN_LEFT 25
+#   define DEF_MARGIN_TOP 15
+#   define DEF_MARGIN_RIGHT DEF_MARGIN_TOP
+#   define DEF_MARGIN_BOTTOM DEF_MARGIN_TOP
+#endif
+
 #endif // DEFAULTS_H
Index: src/globals.h
===================================================================
--- src/globals.h	(revision d97db6d321923b024598f131891e52ec5ebaffb2)
+++ src/globals.h	(revision a885c3d9d2f8df1d77c48806a91e7d09d2f59f84)
@@ -142,4 +142,9 @@
 #ifndef DOXYGEN_EXCLUDE
 
+#ifndef QT_NO_PRINTER
+    Q_DECLARE_METATYPE(QPrinter::PageSize)
+    Q_DECLARE_METATYPE(QPrinter::Orientation)
+#endif
+
 #ifdef HANDHELD
 #   define ICON_SIZE "48x48"
Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision d97db6d321923b024598f131891e52ec5ebaffb2)
+++ src/mainwindow.cpp	(revision a885c3d9d2f8df1d77c48806a91e7d09d2f59f84)
@@ -61,4 +61,14 @@
 #ifndef QT_NO_PRINTER
     printer = new QPrinter(QPrinter::HighResolution);
+    settings->beginGroup("Printer");
+    printer->setPageSize(qvariant_cast<QPrinter::PageSize>(settings->value("PageSize", DEF_PAGE_SIZE)));
+    printer->setOrientation(qvariant_cast<QPrinter::Orientation>(settings->value("PageOrientation", DEF_PAGE_ORIENTATION)));
+    printer->setPageMargins(
+        settings->value("MarginLeft", DEF_MARGIN_LEFT).toDouble(),
+        settings->value("MarginTop", DEF_MARGIN_TOP).toDouble(),
+        settings->value("MarginRight", DEF_MARGIN_RIGHT).toDouble(),
+        settings->value("MarginBottom", DEF_MARGIN_BOTTOM).toDouble(),
+        QPrinter::Millimeter);
+    settings->endGroup();
 #endif // QT_NO_PRINTER
 
@@ -347,4 +357,10 @@
     connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
     ppd.exec();
+    settings->beginGroup("Printer");
+    settings->setValue("PageSize", printer->pageSize());
+    settings->setValue("PageOrientation", printer->orientation());
+    /*! \todo TODO: There's no way to get printer margins set with QPrinter::setPageMargins()
+         for now. Have to figure out a workaround for this (calculate it from other metrics?). */
+    settings->endGroup();
 }
 
@@ -783,5 +799,5 @@
     cur.insertText(tr("Variant #%1 Task").arg(spinVariant->value()), fmt_default);
     cur.insertBlock(fmt_paragraph);
-    cur.insertText(tr("Task:"));
+    cur.insertText(tr("Task:"), fmt_default);
     outputMatrix(cur, matrix);
     if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) {
@@ -838,5 +854,5 @@
         cur.beginEditBlock();
         cur.insertBlock(fmt_paragraph);
-        cur.insertText(tr("Step #%1").arg(n));
+        cur.insertText(tr("Step #%1").arg(n), fmt_default);
         if (settings->value("Output/ShowMatrix", DEF_SHOW_MATRIX).toBool() && (!settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() || (settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() && (spinCities->value() <= settings->value("Output/ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt())))) {
             outputMatrix(cur, *step);
@@ -1173,5 +1189,5 @@
     solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))));
 
-    fmt_paragraph.setTopMargin(0);
+    fmt_paragraph.setTopMargin(5);
     fmt_paragraph.setRightMargin(10);
     fmt_paragraph.setBottomMargin(0);
@@ -1180,5 +1196,5 @@
     fmt_table.setTopMargin(5);
     fmt_table.setRightMargin(10);
-    fmt_table.setBottomMargin(5);
+    fmt_table.setBottomMargin(0);
     fmt_table.setLeftMargin(10);
     fmt_table.setBorder(0);
