TeX 是一種編程語言,您可能會發現它被稱為數據標記語言。同時,TeX 是一個理解這種語言的解釋器引擎,也是一個整體的排版系統。
它用於數學或技術文本寫作。許多不同的數據包都是在 ΤeX 的基礎上創建的。最著名的此類包是 LaTeX。它讓作者專注於文本,將排版過程留給程序。使用 LaTeX 結構化文檔很容易創建和管理。
Aspose.TeX for C++ 是一個靈活且易於使用的庫,用於排版 TeX 和 LaTeX 文件。 API 支持多種輸出格式,如 XPS、PDF、PNG、JPEG、TIFF、SVG、BMP。這意味著使用這個庫的功能,您可以將 TeX 和 LaTeX 文件轉換為任何輸出格式。使用該解決方案,如果您想創建和/或排版一堆統一設計的文檔,您可以創建自定義 TeX 格式。
高級 C++ TeX 文件排版 API 功能
TeX 到 XPS C++ 代碼示例
Aspose.TeX for C++ 可以輕鬆地將 TeX 文件排版為格式。
TeX 到 XPS 並將輸出寫入磁盤 - C++
using Aspose::TeX::IO;
using Aspose::TeX::Presentation::Xps;
// Create typesetting options for the default ObjectTeX format on ObjectTeX engine extension.
System::SharedPtr<TeXOptions> options = TeXOptions::ConsoleAppOptions(TeXConfig::ObjectTeX());
// Specify the job name. Otherwise, TeX.Typeset()'s method first argument will be taken as a job name.
options->set_JobName(u"overriden-job-name");
// Specify a file system working directory for the input.
options->set_InputWorkingDirectory(System::MakeObject<InputFileSystemDirectory>(RunExamples::InputDirectory));
// Specify a file system working directory for the output.
options->set_OutputWorkingDirectory(System::MakeObject<OutputFileSystemDirectory>(RunExamples::OutputDirectory));
// Specify that the terminal output must be written to a file in the output working directory.
// The file name is <job_name>.trm.
options->set_TerminalOut(System::MakeObject<OutputFileTerminal>(options->get_OutputWorkingDirectory()));
// Run the typesetting.
Aspose::TeX::TeX::Typeset(u"hello-world", System::MakeObject<XpsDevice>(), options);