LaTeX is widely used to create mathematical and scientific documents. On the other hand, XPS file format deals with a fixed layout documents. Aspose.TeX for Python via .NET provides a solution to convert LaTeX to XPS in Python programmatically. This conversion becomes fully automated with the help of this TeX SDK. Moreover, this SDK ensures accurate rendering of layout, math equations and figures. This guide is for Python developers who are looking to develop a LaTeX to XPS converter to automate the conversion tasks. So, we will implement the functionality to demonstrate the capabilities of Aspose.TeX for Python via .NET.
Aspose.TeX for Python via .NET - Installation
Running the following single command in the terminal/CMD will set up Aspose.TeX for Python via .NET on your machine:
pip install aspose-tex-net
If you do not want to opt for the above option, you may download the SDK files.
Convert LaTeX to XPS in Python - Code Snippet
Let us see how to achieve LaTeX to XPS conversion efficiently by writing a few lines of Python code. This TeX SDK is developer-friendly and supports various output formats such as XPS, PDF, PNG, JPEG, TIFF, SVG and more.
Steps:
- Create conversion options for Object LaTeX format upon Object TeX engine extension.
- Set interaction mode.
- Specify the address for the working directory.
- Initialize an instance of the XpsSaveOptions class.
- Run LaTeX to XPS conversion by calling the run method.
The following code sample shows how to convert LaTeX to XPS in Python:
Output:
Have a Question?
You can ask your questions on our forum.
Get a Free License
You may avail a free temporary license to try Aspose.TeX for Python via .NET.
Conclusion
We have seen that Aspose.TeX for Python via .NET has made it super easy to work with LaTeX/TeX files and export them into XPS format. Once you have set up this SDK, you don’t need any external software to deal with LaTeX/TeX files. Further, you may visit the GitHub repo to see the code examples. It will surely help you extend the features of your LaTeX to XPS converter tool. In addition, you may also visi the documentation and API refs.
