File size: 575 Bytes
b16049c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { compileLaTeX } from "./dist/latex-compiler.js";
import fs from "fs/promises";
import path from "path";

async function test() {
  const baseDir = path.join(process.cwd(), "temp_projects", "test_mcp_1");
  await fs.mkdir(baseDir, { recursive: true });
  
  await fs.writeFile(path.join(baseDir, "main.tex"), `
\\documentclass{article}
\\begin{document}
Hello MCP Server! This is an automated LaTeX test compiled using XeLaTeX.
\\end{document}
  `);

  console.log("Compiling LaTeX to PDF...");
  const res = await compileLaTeX(baseDir);
  console.log(res);
}
test();