TeX 命令行转换器 | Aspose.TeX CLI 工具

Overview

Aspose.TeX Convert 工具是一款功能强大的 CLI 应用程序,可帮助将 TeX 和 LaTeX 文档转换为多种格式。该工具让开发者和设计师能够创建在不同平台和设备上无缝工作的文档。

Key Features

Benefits

使用 Aspose.TeX Convert 工具可获得以下优势:

Licensing

虽然 Aspose.TeX Convert 应用本身免费使用,但转换文档需要有效的 Aspose.TeX 许可证。您可以购买许可证或在试用模式下评估 Aspose.TeX。

How to install TeX Command-Line Converter?

Aspose.TeX Convert 工具可以全局或本地安装,取决于您的项目需求。建议使用本地安装以避免版本冲突,适用于项目特定使用。

Global Installation

在机器上全局安装 Aspose.TeX Convert,请使用以下命令:

1dotnet tool install --global Aspose.TeX.Convert

如果需要特定版本,可添加 --version 参数。

Local Installation

在特定项目内部进行本地安装,首先导航到项目根目录,然后执行以下命令:

  1. 若尚未存在 tool‑manifest,创建它:

    1dotnet new tool-manifest
  2. 本地安装 Aspose.TeX Convert:

    1dotnet tool install Aspose.TeX.Convert --local

同样,您可以使用 --version 参数指定特定版本。

Updating the TeX CLI Converter

要将 Aspose.TeX Convert 工具更新到最新版本,请使用 dotnet tool update 命令,并根据您的安装类型添加 --global--local

Uninstalling the TeX CLI Converter

如果需要卸载该工具,请使用 dotnet tool uninstall 命令,同样根据安装方式添加 --global--local

Usage

Command Line

通过命令行参数转换文档。以下是可用参数:

示例命令行用法:

1Aspose.TeX.Convert --input input.tex --output output.pdf --format pdf

How to integrate CLI LaTeX Converter into C# Projects?

Aspose.TeX Convert 应用还可以直接集成到 .NET 项目中,通过命令行实现对 TeX 转换功能的编程访问。

Adding the LaTeX Command Line Converter to Your Project:

将 Aspose.TeX Convert 工具添加到 Visual Studio 项目中,进入项目根目录并执行以下命令:

1dotnet Aspose.TeX.Convert add

此命令将在项目中直接加入 Aspose.TeX Convert 功能,使您能够在代码中使用库的方法和属性,这对需要在应用程序内部实现自定义 TeX 转换流程的开发者特别有用。

Use from Code

下面示例展示了如何在 C# 代码中以编程方式使用 Aspose.TeX CLI 工具:

 1using Aspose.TeX.MicroApps.Convert;
 2using System.Threading.Tasks;
 3
 4class Program
 5{
 6    static async Task Main(string[] args)
 7    {
 8        // Initialize convert options
 9        var options = new ConvertOptions
10        {
11            // Required: Specify the input document path
12            InputDocument = "input.tex",
13            
14            // Required: Specify the output document path
15            OutputFilePath = "output.pdf",
16            
17            // Optional: Specify the output format
18            ToFormat = "pdf"
19        };
20
21        // Conditional: Apply license if you have one
22        if (isLicensed)
23        {
24            options.LicenseFile = "path_to_license.lic";
25        }
26
27        // Execute the conversion task
28        await ConvertTasks.Create(options).Execute();
29    }
30}

有关详细信息和使用示例,请访问 Aspose.TeX for .NET 文档.

Have any questions about Aspose.TeX?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.