Page Layoutminimum example to generate png's for web page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
L1127
Posts: 1
Joined: Wed May 24, 2017 1:44 pm

minimum example to generate png's for web page

Post by L1127 »

Hi, I want to generate PNG images of equations to go on a webpage. My idea is to use the 'latex' and 'dvipng' commands. The thing I'm having trouble with is how to set up the minimum standalone LaTeX document. You know, setting up a document that generates the equation at the smallest page size that fits it, without trying to lay out to a specific paper size. (I'm not sure I'm describing this right, but you probably get the idea.)

I tried this:

Code: Select all

\documentclass[12pt]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{array}
\begin{document}
\begin{align}
 x & = 3 \\
 y &= 4 
\end{align}
\end{document}
But I get an error, "missing \endgroup inserted"

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

minimum example to generate png's for web page

Post by Johannes_B »

To align equations, a fixed line with is needed. Try to put your align locks into a minipage.
Yes, that needs manual adjusting of the width.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply