Issues Compiling LaTeX Document with BibTeX Using Aspose.TeX

Hi everyone,

I’m having trouble compiling a LaTeX document with BibTeX using Aspose.TeX. Here are the details of my setup and the issues I’m encountering:

Setup:

  • LaTeX Document: My LaTeX document includes the biblatex package and references a .bib file for citations.
  • BibTeX File: The .bib file is named sample.bib and is located in the same directory as my .tex file.
  • Aspose.TeX Configuration: I’m using Aspose.TeX to compile the document and generate a PDF.

LaTeX Document:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\title{hello\_world}
\author{}
\date{May 2025}
\begin{document}
\maketitle
\section{Introduction}
This is a sample citation \cite{doe2025}\\
Update to handle bibtex\\
\input{input1}
\bibliographystyle{IEEEtran}
\bibliography{sample}
\end{document}

Aspose.TeX Code:

I use the default example code on the Document

// Create conversion options for Object LaTeX format upon Object TeX engine extension.
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
// Specify a file system working directory for the output.
options.OutputWorkingDirectory = new OutputFileSystemDirectory(RunExamples.OutputDirectory);
// Initialize the options for saving in PDF format.
options.SaveOptions = new PdfSaveOptions();
// Run LaTeX to PDF conversion.
new TeXJob(Path.Combine(RunExamples.InputDirectory, "hello-world.ltx"), new PdfDevice(), options).Run();

Any help or suggestions would be greatly appreciated!

@dunghnguyen

It seems you are encountering issues while compiling a LaTeX document with BibTeX using Aspose.TeX. Here are some steps and considerations that might help you resolve the problems:

Common Issues and Solutions

  1. Missing Packages: Ensure that all required LaTeX packages are available. Since you are using the biblatex package, make sure it is included in your LaTeX document. If Aspose.TeX does not support it natively, you may need to provide the package files manually.

  2. Correct File Paths: Verify that the .bib file is correctly referenced in your LaTeX document. The path should be relative to the location of your .tex file. Ensure that the file name is correct and that it is in the same directory as your .tex file.

  3. Compilation Order: When using BibTeX, you typically need to compile your document multiple times to ensure that all references are resolved correctly. The usual order is:

    • Compile the .tex file to generate an auxiliary file.
    • Run BibTeX on the generated auxiliary file.
    • Compile the .tex file again to incorporate the bibliography.
  4. Aspose.TeX Configuration: Make sure your Aspose.TeX configuration is set up correctly. Here’s a sample code snippet that shows how to set the options for your TeX job:

    // Create conversion options for Object LaTeX format
    TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
    options.OutputWorkingDirectory = new OutputFileSystemDirectory("path-to-output-directory");
    options.SaveOptions = new PdfSaveOptions();
    
    // Run LaTeX to PDF conversion
    new TeXJob("path-to-your-latex-file.tex", new PdfDevice(), options).Run();
    
  5. Check for Compilation Errors: Review the compilation log for any specific error messages. Common issues include syntax errors, missing braces, or unrecognized commands.

  6. External Packages: If your document requires external packages that are not included with Aspose.TeX, you can specify a directory containing these packages using the RequiredInputDirectory option in your TeXOptions.

Additional Tips

  • If you continue to face issues, consider creating a minimal working example (MWE) that isolates the problem. This can help in identifying whether the issue lies with your document or the configuration.
  • Consult the Aspose documentation for any specific requirements or limitations regarding the use of BibTeX and external packages.

If you follow these steps and still encounter issues, please provide any error messages or logs you receive during the compilation process for further assistance.

I have try but no improvement yet.

@dunghnguyen

Unfortunately, the “biblatex” package is not supported yet in Aspose.TeX. The full list of currently supported packages are here: Aspose.TeX embedded LaTeX packages. We created the task in Redmine for this issue - Saltov Redmine.

1 Like