document.tex0 chars
PreviewReady
`); printWindow.document.close(); setTimeout(() => { printWindow.print(); }, 300); } function loadSample() { editor.value = `\\documentclass{article} \\usepackage{amsmath} \\title{Introduction to LaTeX} \\author{Solid Utils Tools} \\date{\\today} \\begin{document} \\maketitle \\begin{abstract} This sample document demonstrates sections, math equations, lists, and text formatting. \\end{abstract} \\section{Getting Started} LaTeX is widely used for scientific and technical documents. It excels at \\textbf{beautiful mathematics} and structured writing. \\section{Mathematics} Inline math works like $E = mc^2$ and display equations work too: \\begin{equation} \\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi} \\end{equation} \\section{Lists} \\begin{itemize} \\item Write LaTeX in the editor pane \\item Click \\textbf{Compile} \\item Download using your browser print dialog \\end{itemize} \\end{document}`; compile(); } document.getElementById('fileInput').addEventListener('change', event => { const file = event.target.files[0]; if (!file) return; file.text().then(text => { editor.value = text; compile(); }); }); editor.addEventListener('input', () => { charCount.textContent = `${editor.value.length} chars`; }); document.addEventListener('keydown', event => { if ((event.ctrlKey || event.metaKey) && event.key === 'Enter') { event.preventDefault(); compile(); } }); const divider = document.getElementById('divider'); let dragging = false; divider.addEventListener('mousedown', () => { dragging = true; document.body.style.cursor = 'col-resize'; }); document.addEventListener('mousemove', event => { if (!dragging) return; const pct = (event.clientX / window.innerWidth) * 100; if (pct > 20 && pct < 80) { document.querySelector('.editor-pane').style.width = `${pct}%`; document.querySelector('.preview-pane').style.width = `${100 - pct}%`; } }); document.addEventListener('mouseup', () => { dragging = false; document.body.style.cursor = ''; }); (function loadMathJax() { window.MathJax = { tex: { inlineMath: [['\\(','\\)']], displayMath: [['\\[','\\]']] }, startup: { typeset: false } }; const script = document.createElement('script'); script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'; script.async = true; document.head.appendChild(script); })(); const saved = localStorage.getItem('latex-to-pdf-content'); if (saved) { editor.value = saved; compile(); } else { loadSample(); }

About this tool

Write or paste LaTeX source, see a live rendered preview, and download the result as a PDF — without installing a multi-gigabyte TeX distribution. Compilation happens in your browser, so your document never leaves your machine.

It handles the constructs that cover most everyday documents: sections, mathematical notation, environments like itemize and enumerate, and standard text formatting.

When to use it

Worked example

Paste this minimal document: \documentclass{article}\begin{document}\section*{Quadratic formula} For $ax^2+bx+c=0$, the roots are $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$\end{document} The preview shows the section heading and the typeset displayed equation. Click download to save it as a PDF.

Frequently asked questions

Do I need LaTeX installed on my computer?

No. Everything compiles inside the browser page. That is the point of the tool — full TeX distributions like TeX Live run to several gigabytes, which is overkill for a quick document.

Which LaTeX packages are supported?

Core LaTeX plus standard math support covering the large majority of everyday documents. Very specialized packages (TikZ diagrams, bibliography tooling, custom class files) may not be available — for heavyweight projects, a full distribution or Overleaf remains the right tool.

Is my document uploaded to a server?

No. Compilation and preview happen locally in your browser session. Closing the tab discards everything, so download your PDF and copy your source before leaving.

Why does my document fail to compile?

The most common causes are a missing \end{document}, an unclosed brace, or math outside $ delimiters. Fix the first reported error and recompile — LaTeX errors cascade, so one typo can produce many messages.