private static void writeTeXFile(final File file, final String problem, final String solution) {
        BufferedWriter writer = null;
        try {
            writer = new BufferedWriter(new FileWriter(file));
            writer.write("\\documentclass[12pt,a4paper,oneside]{article}");
            writer.newLine();
            writer.write("\\usepackage[utf8]{inputenc}");
            writer.newLine();
            writer.write("\\usepackage[czech]{babel}");
            writer.newLine();
            writer.write("\\usepackage[T1]{fontenc}");
            writer.newLine();
            writer.write("\\usepackage{amsmath, amsfonts, amssymb}");
            writer.newLine();
            writer.write("\\begin{document}");
            writer.newLine();
            writer.write(prepareUnicodeForLaTeX("\\noindent Zadání:"));
            writer.newLine();
            writer.write(prepareForExport(problem));
            writer.newLine();
            writer.write("\\vfill");
            writer.newLine();
            writer.write(prepareUnicodeForLaTeX("\\noindent Řešení:"));
            writer.newLine();
            writer.write(prepareForExport(solution));
            writer.newLine();
            writer.write("\\end{document}");
        } catch(IOException ex) {
            System.err.println(ex.getMessage());
        } finally {
            try {
                if (writer != null)
                    writer.close();
            } catch (IOException ex) {
                System.err.println(ex.getMessage());
            }
        }
    }