                 (when (= retVal JFileChooser/APPROVE_OPTION)
                   (let [^File file (.getSelectedFile fc)]
                     (with-swing-error-msg frame "Error while saving"
-                      (save-image scn file (get-file-extension file)))))))))
+                      (if (= "tikz" (get-file-extension file))
+                        (write-layout :tikz (get-layout-from-scene scn) (.getAbsolutePath file))
+                          (save-image scn file (get-file-extension file))))))))))
   nil)
 
 ;;;

  (:require [conexp.gui.draw.control.util :refer :all]
            [conexp.gui.draw.scenes :refer :all]
            [conexp.gui.util :refer :all]
            [seesaw.core :refer [listen]])
  (:import java.io.File
           [javax.swing JButton JFileChooser]
           javax.swing.filechooser.FileNameExtensionFilter))

        ^JFileChooser fc (JFileChooser.),
        jpg-filter (FileNameExtensionFilter. "JPEG Files" (into-array ["jpg" "jpeg"])),
        gif-filter (FileNameExtensionFilter. "GIF Files"  (into-array ["gif"])),
        tikz-filter (FileNameExtensionFilter. "TIKZ Files" (into-array ["tikz"]))
        png-filter (FileNameExtensionFilter. "PNG Files"  (into-array ["png"]))]
    (doto fc
      (.addChoosableFileFilter jpg-filter)
      (.addChoosableFileFilter gif-filter)
      (.addChoosableFileFilter tikz-filter)
      (.addChoosableFileFilter png-filter))
    (listen save-button :action
            (fn [_]
