Files
proostenkrant.net/Proostenkrant.NET/LatexCompiler.cs
2023-12-26 14:31:53 +01:00

27 lines
693 B
C#

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();
}
}
}