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

Aspose.TeX for C++ 提供了一种易于使用的机制,用于将 TeX 和 LaTeX 文件转换为 PDF 和图像格式。转换过程可以配置为控制图像质量以及处理错误(如果开发人员正在处理批处理)。
该解决方案还提供各种转换,例如:

  

Support and Learning Resources

  
  

Aspose.TeX 为流行的开发环境提供单独的 API,如下所列: