LXCONFIG => { dbcharset              => $::dbcharset,
                                webdav                 => $::webdav,
                                lizenzen               => $::lizenzen,
-                               latex_templates        => $::latex,
-                               opendocument_templates => $::opendocument_templates,
+                               latex_templates        => $::lx_office_conf{print_templates}->{latex},
+                               opendocument_templates => $::lx_office_conf{print_templates}->{opendocument},
                                vertreter              => $::vertreter,
                                show_best_before       => $::show_best_before,
                              },
 
   $additional_params->{"conf_dbcharset"}              = $::dbcharset;
   $additional_params->{"conf_webdav"}                 = $::webdav;
   $additional_params->{"conf_lizenzen"}               = $::lizenzen;
-  $additional_params->{"conf_latex_templates"}        = $::latex;
-  $additional_params->{"conf_opendocument_templates"} = $::opendocument_templates;
+  $additional_params->{"conf_latex_templates"}        = $::lx_office_conf{print_templates}->{latex};
+  $additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument};
   $additional_params->{"conf_vertreter"}              = $::vertreter;
   $additional_params->{"conf_show_best_before"}       = $::show_best_before;
   $additional_params->{"conf_parts_image_css"}        = $::parts_image_css;
 
 sub is_openoffice_running {
   $main::lxdebug->enter_sub();
 
-  my $output = `./scripts/oo-uno-test-conn.py $main::openofficeorg_daemon_port 2> /dev/null`;
+  my $cmd    = "./scripts/oo-uno-test-conn.py " . $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . " 2> /dev/null";
+  my $output = `$cmd`;
   chomp $output;
 
   my $res = ($? == 0) || $output;
                        "-minimized", "-norestore", "-nologo", "-nolockcheck",
                        "-headless",
                        "-accept=socket,host=localhost,port=" .
-                       $main::openofficeorg_daemon_port . ";urp;");
+                       $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . ";urp;");
         exec(@cmdline);
       }
 
   }
 
   my @cmdline;
-  if (!$main::openofficeorg_daemon) {
+  if (!$::lx_office_conf{print_templates}->{openofficeorg_daemon}) {
     @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
                 "-minimized", "-norestore", "-nologo", "-nolockcheck",
                 "-headless",
     }
 
     @cmdline = ("./scripts/oo-uno-convert-pdf.py",
-                $main::openofficeorg_daemon_port,
+                $::lx_office_conf{print_templates}->{openofficeorg_daemon_port},
                 "${filename}.odt");
   }
 
 
   _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00'));
 
   my @formats = ();
-  if ($main::opendocument_templates
+  if ($::lx_office_conf{print_templates}->{opendocument}
       && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer})
       && $::lx_office_conf{applications}->{xvfb}                 && (-x $::lx_office_conf{applications}->{xvfb})) {
     push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
                      "value" => "opendocument_pdf" });
   }
-  if ($main::latex_templates) {
+  if ($::lx_office_conf{print_templates}->{latex}) {
     push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" });
   }
   push(@formats, { "name" => "HTML", "value" => "html" });
-  if ($main::latex_templates) {
+  if ($::lx_office_conf{print_templates}->{latex}) {
     push(@formats, { "name" => $locale->text("Postscript"),
                      "value" => "postscript" });
   }
-  if ($main::opendocument_templates) {
+  if ($::lx_office_conf{print_templates}->{opendocument}) {
     push(@formats, { "name" => $locale->text("OpenDocument/OASIS"),
                      "value" => "opendocument" });
   }
 
 
   push @MEDIA, grep $_,
       opthash("screen",              $form->{OP}{screen},              $locale->text('Screen')),
-    ($form->{printers} && scalar @{ $form->{printers} } && $main::latex_templates) ?
+    ($form->{printers} && scalar @{ $form->{printers} } && $::lx_office_conf{print_templates}->{latex}) ?
       opthash("printer",             $form->{OP}{printer},             $locale->text('Printer')) : undef,
-    ($main::latex_templates && !$options{no_queue}) ?
+    ($::lx_office_conf{print_templates}->{latex} && !$options{no_queue}) ?
       opthash("queue",               $form->{OP}{queue},               $locale->text('Queue')) : undef
         if ($form->{media} ne 'email');
 
   push @FORMAT, grep $_,
-    ($main::opendocument_templates &&     $::lx_office_conf{applications}->{openofficeorg_writer}  &&     $::lx_office_conf{applications}->{xvfb}
-                                   && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb})
+    ($::lx_office_conf{print_templates}->{opendocument} &&     $::lx_office_conf{applications}->{openofficeorg_writer}  &&     $::lx_office_conf{applications}->{xvfb}
+                                                        && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb})
      && !$options{no_opendocument_pdf}) ?
       opthash("opendocument_pdf",    $form->{DF}{"opendocument_pdf"},  $locale->text("PDF (OpenDocument/OASIS)")) : undef,
-    ($main::latex_templates) ?
+    ($::lx_office_conf{print_templates}->{latex}) ?
       opthash("pdf",                 $form->{DF}{pdf},                 $locale->text('PDF')) : undef,
-    ($main::latex_templates && !$options{no_postscript}) ?
+    ($::lx_office_conf{print_templates}->{latex} && !$options{no_postscript}) ?
       opthash("postscript",          $form->{DF}{postscript},          $locale->text('Postscript')) : undef,
     (!$options{no_html}) ?
       opthash("html", $form->{DF}{html}, "HTML") : undef,
-    ($main::opendocument_templates && !$options{no_opendocument}) ?
+    ($::lx_office_conf{print_templates}->{opendocument} && !$options{no_opendocument}) ?
       opthash("opendocument",        $form->{DF}{opendocument},        $locale->text("OpenDocument/OASIS")) : undef,
-    ($main::excel_templates && !$options{no_excel}) ?
+    ($::lx_office_conf{print_templates}->{excel} && !$options{no_excel}) ?
       opthash("excel",               $form->{DF}{excel},               $locale->text("Excel")) : undef;
 
   push @LANGUAGE_ID,
     );
 
   my %template_vars = (
-    display_copies       => scalar @{ $form->{printers} || [] } && $main::latex_templates && $form->{media} ne 'email',
+    display_copies       => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email',
     display_remove_draft => (!$form->{id} && $form->{draft_id}),
     display_groupitems   => !$dont_display_groupitems{$form->{type}},
     groupitems_checked   => $form->{groupitems} ? "checked" : '',
 
   } else {
     $media = qq|
             <option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
-    if ($myconfig{printer} && $main::latex_templates) {
+    if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex}) {
       $media .= qq|
             <option value=printer $form->{OP}{printer}>| . $locale->text('Printer');
     }
   }
 
   my $format;
-  if ($main::latex_templates) {
+  if ($::lx_office_conf{print_templates}->{latex}) {
     $format .= qq|
             <option value=html $form->{DF}{html}>| . $locale->text('HTML')
       . qq| <option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF')
     <td><select name=media>$media</select></td>
 |;
 
-  if ($myconfig{printer} && $main::latex_templates && $form->{media} ne 'email') {
+  if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email') {
     $output .= qq|
       <td>| . $locale->text('Copies') . qq|
       <input name=copies size=2 value=$form->{copies}></td>
 
 
 our (
   $dbcharset, $eur, $language,
-  $latex_templates, $lizenzen, $opendocument_templates,
-  $openofficeorg_daemon, $openofficeorg_daemon_port,
+  $lizenzen,
   $parts_image_css, $parts_listing_images, $parts_show_image,
   $show_best_before, $vertreter, $webdav
 );
 # currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
 $language = "de";
 
-# if you have latex installed set to 1
-$latex_templates = 1;
-
 # Aktivierung der verschiedenen Spezialmodule
 $webdav = 0;
 $lizenzen = 1;
 $vertreter = 0;
-$excel_templates = 0; # Minimalunterstützung für Excel-Druckvorlagen
 
 # Zeige Felder für Mindesthaltbarkeitsdatum
 $show_best_before = 0;
 # Artikelbilder per default in den Suchergebnissen anzeigen
 $parts_listing_images = 0; # [0|1]
 
-## Support fuer OpenDocument-Vorlagen
-# Diese Option legt fest, ob OpenDocument-Vorlagen generell verfuegbar sind.
-$opendocument_templates = 1;
-
-# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
-# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-
-# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
-# Dokumente geht dann schneller. Allerdings wird auf dem System ein
-# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
-# von OpenOffice sind.
-$openofficeorg_daemon = 1;
-$openofficeorg_daemon_port = 2002;
-
 # Das charset, in dem die Daten in der Datenbank abgelegt sind.
 $dbcharset = 'UTF-8'; # Für UNICODE UTF-8
 # $dbcharset = "ISO-8859-15";
 
 
 our (
   $dbcharset, $eur, $language,
-  $latex_templates, $lizenzen, $opendocument_templates,
-  $openofficeorg_daemon, $openofficeorg_daemon_port,
+  $lizenzen,
   $parts_image_css, $parts_listing_images, $parts_show_image,
   $show_best_before, $vertreter, $webdav
 );
 # currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
 $language = "de";
 
-# if you have latex installed set to 1
-$latex_templates = 1;
-
 # Aktivierung der verschiedenen Spezialmodule
 $webdav = 0;
 $lizenzen = 1;
 $vertreter = 0;
-$excel_templates = 0; # Minimalunterstützung für Excel-Druckvorlagen
 
 # Zeige Felder für Mindesthaltbarkeitsdatum
 $show_best_before = 0;
 # Artikelbilder per default in den Suchergebnissen anzeigen
 $parts_listing_images = 0; # [0|1]
 
-## Support fuer OpenDocument-Vorlagen
-# Diese Option legt fest, ob OpenDocument-Vorlagen generell verfuegbar sind.
-$opendocument_templates = 1;
-
-# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
-# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-
-# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
-# Dokumente geht dann schneller. Allerdings wird auf dem System ein
-# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
-# von OpenOffice sind.
-$openofficeorg_daemon = 1;
-$openofficeorg_daemon_port = 2002;
-
 # Das charset, in dem die Daten in der Datenbank abgelegt sind.
 $dbcharset = 'UTF-8'; # Für UNICODE UTF-8
 # $dbcharset = "ISO-8859-15";
 
 # "/sw/lib/perl5" is for Mac OS X with Fink's Perl.
 lib = /sw/lib/perl5
 
+[print_templates]
+# If you have LaTeX installed set to 1
+latex = 1
+# Minimal support for Excel print templates
+excel = 0
+# Enable or disable support for OpenDocument print templates
+opendocument = 1
+# Chose whether or not OpenOffice should remain running after a
+# conversion. If yes then the conversion of subsequent documents will
+# be a lot faster. You need to have Python and the Python UNO bindings
+# (part of OpenOffice) installed.
+openofficeorg_daemon = 1
+openofficeorg_daemon_port = 2002
+
 [task_server]
 # User name to use for database access
 login = mb