using System.Diagnostics; using System.IO; namespace Proostenkrant.NET { internal static class LatexCompiler { internal static void Compile(string text) { File.WriteAllText(Program.c_articlePath, text); GeneratePdf(); } static void GeneratePdf() { var processInfo = new ProcessStartInfo("cmd.exe", "/c pdflatex " + Program.c_mainPath); processInfo.WorkingDirectory = Program.c_latexPath; processInfo.CreateNoWindow = true; processInfo.UseShellExecute = true; var process = Process.Start(processInfo); process.WaitForExit(); } } }