npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-pdf-latex

v0.1.2

Published

n8n community node for converting LaTeX to PDF using node-latex

Readme

LaTeX to PDF - n8n Community Node

npm version License

A powerful n8n community node that converts LaTeX documents to PDF files with support for multiple engines, custom packages, and advanced features.

Features

  • ✅ Convert LaTeX text to PDF
  • ✅ Convert LaTeX files to PDF
  • ✅ Multiple LaTeX engines (pdflatex, xelatex, lualatex)
  • ✅ Multiple compilation passes for complex documents
  • ✅ Custom fonts and input directories support
  • ✅ Comprehensive error handling with helpful suggestions
  • ✅ Support for bibliographies, cross-references, and complex formatting
  • ✅ Binary data handling for inputs and outputs

Prerequisites

⚠️ LaTeX must be installed on your system before using this node.

Installation by Platform

macOS:

# Option 1: MacTeX (recommended - full installation)
brew install --cask mactex-no-gui

# Option 2: BasicTeX (minimal installation)
brew install --cask basictex
sudo tlmgr update --self
sudo tlmgr install collection-fontsrecommended

Linux (Ubuntu/Debian):

sudo apt-get update
sudo apt-get install texlive-full

Linux (CentOS/RHEL):

sudo yum install texlive-scheme-full

Windows:

Verify Installation

pdflatex --version
tlmgr --version  # Package manager

Installation

Option 1: Community Nodes (Recommended)

  1. Open your n8n instance
  2. Go to SettingsCommunity Nodes
  3. Install package: n8n-nodes-pdf-latex
  4. Restart n8n

Option 2: Manual Installation

cd ~/.n8n/nodes
npm install n8n-nodes-pdf-latex

Usage

Basic Usage

  1. Add LaTeX to PDF node to your workflow
  2. Configure input:
    • Input Type: "Text" for direct LaTeX or "Binary Property" for files
    • LaTeX Content: Your LaTeX document content
    • Output Property Name: Name for generated PDF (default: "data")
  3. Execute workflow

Input Types

Text Input (Direct LaTeX)

Paste your LaTeX content directly into the node:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{graphicx}

\title{My Document}
\author{Your Name}
\date{\today}

\begin{document}
\maketitle

\section{Introduction}
Hello World! This is my LaTeX document with \textbf{bold text} and \textit{italic text}.

\subsection{Features}
\begin{itemize}
    \item Easy LaTeX to PDF conversion
    \item Multiple engine support
    \item Custom fonts and directories
\end{itemize}

\end{document}

Binary Input (LaTeX Files)

Use LaTeX files from previous nodes (File Trigger, HTTP Request, etc.)

Advanced Examples

Document with Images

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\title{Document with Images}
\maketitle

\section{Logo}
\includegraphics[width=5cm]{logo.png}

\section{Chart}
\includegraphics[width=\textwidth]{chart.pdf}

\end{document}

Note: Set "Inputs Directory" to folder containing images

Bibliography Example

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}

\begin{document}
\title{Research Paper}
\maketitle

\section{Introduction}
According to recent studies \cite{smith2023}.

\printbibliography
\end{document}

Note: Set "Number of Passes" to 2 or 3 for bibliographies

Configuration Options

LaTeX Engines

| Engine | Best For | Features | |--------|----------|----------| | pdflatex | Standard documents | Fast, reliable, good package support | | xelatex | Unicode, custom fonts | Modern fonts, Unicode support | | lualatex | Advanced typography | Lua scripting, advanced features |

Compilation Passes

  • 1 Pass: Simple documents without cross-references
  • 2 Passes: Documents with table of contents, cross-references
  • 3 Passes: Documents with bibliographies, complex references

Directory Options

  • Inputs Directory: Path to folder containing:
    • Images (PNG, JPG, PDF)
    • Include files (.tex)
    • Custom class files (.cls)
    • Style files (.sty)
  • Fonts Directory: Path to custom font files (TTF, OTF)

Output

The node provides:

  • JSON Data: Success status, filename, file size, MIME type
  • Binary Data: Generated PDF file ready for download or further processing

Example output:

{
  "success": true,
  "filename": "document-20240120-143022.pdf",
  "mimeType": "application/pdf",
  "fileSize": 156789
}

Common Use Cases

1. Report Generation

Generate PDF reports from data:

// Previous node processes data
const data = $input.all();
const latexContent = `
\\documentclass{article}
\\begin{document}
\\title{Sales Report}
\\maketitle
\\section{Summary}
Total Sales: $${data.totalSales}
\\end{document}
`;

2. Invoice Generation

Create professional invoices:

\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{margin=1in}

\begin{document}
\begin{center}
{\LARGE Invoice \#12345}
\end{center}

\section*{Bill To:}
Customer Name\\
Address

\section*{Items:}
\begin{tabular}{|l|r|r|}
\hline
Description & Quantity & Price \\
\hline
Service A & 2 & \$50.00 \\
Service B & 1 & \$75.00 \\
\hline
\textbf{Total} & & \textbf{\$175.00} \\
\hline
\end{tabular}
\end{document}

3. Academic Papers

Research documents with citations:

\documentclass{article}
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{references.bib}

\begin{document}
\title{Research Title}
\author{Author Name}
\maketitle

\section{Literature Review}
Previous work by \textcite{author2023} shows...

\printbibliography
\end{document}

Troubleshooting

LaTeX Installation Issues

Error: spawn pdflatex ENOENT

  • Install LaTeX on your system
  • Ensure LaTeX is in your system PATH
  • Restart n8n after installing LaTeX

Package not found errors:

# Install missing packages
sudo tlmgr install package-name

# Update package database
sudo tlmgr update --self --all

Compilation Errors

Undefined control sequence:

  • Check LaTeX syntax
  • Ensure required packages are loaded with \usepackage{}
  • Verify command spelling

File not found:

  • Use "Inputs Directory" parameter
  • Ensure file paths are relative to inputs directory
  • Check file permissions

TeX capacity exceeded:

  • Usually indicates infinite loops in LaTeX code
  • Check \newcommand definitions
  • Simplify complex nested structures

Common Package Issues

Missing adjustwidth: Use \usepackage{changepage} instead of \usepackage{adjustwidth}

Font issues with xelatex/lualatex:

  • Specify fonts directory
  • Use system fonts: \setmainfont{Arial}
  • Install additional font packages

Bibliography not showing:

  • Set "Number of Passes" to 2-3
  • Ensure .bib file is in inputs directory
  • Use correct citation commands

Performance Tips

  • Use pdflatex for fastest compilation
  • Minimize the number of passes when possible
  • Keep images optimized (reasonable file sizes)
  • Use relative paths in LaTeX documents
  • Cache compiled documents when possible

License

MIT License


Made with ❤️ for the n8n community