4

bigequation.tex

I'm desperately trying to type this huge equation in an A4 page.

Any reasonable solution would be ok (including splitting the equation). The problem is that the total width is 800cm. Hence this would require more than 20 lines for a single equation (considering A4 width is 29.7cm).

percusse
  • 157,807
Marcex
  • 43

2 Answers2

11

enter image description here

The hardest part is getting rid of the spurious {} groups, without that you would just need simple inline definitions as in

Suggestion for automatic alignment of large equations

Use $\z ... \zstop $ not begin{equation}...\end{equation} otherwise the math is unchanged.

\documentclass[a4paper]{article}
%\usepackage[paperwidth=500cm,paperheight=21cm,margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\addtolength\textwidth{6cm}
\addtolength\oddsidemargin{-3cm}
\showboxbreadth10000
\showboxdepth10000
\begin{document}
\let\left\relax
\let\right\relax
\def\sqrt#1{(#1)^{{1\over2}}% image uses bad version: \def\sqrt#1{1/(#1)}
\def\frac#1#2{(#1)/(#2)}
\def\mathrm#1{\begingroup\fam0 #1\endgroup}
\let\!\relax% they should never have been there
\def\z#1{%
\ifx\frac#1\let\next\ztwo
\else\ifx\sqrt#1\let\next\zone
\else\ifx\mathrm#1\let\next\zone
\else\ifx^#1\let\next\zone
\else\ifx_#1\let\next\zone
\else\ifx\dot#1\let\next\zone
\else\let\next\znone
\fi\fi\fi\fi\fi\fi
\next{#1}}
\def\ztwo#1#2#3{#1{\z#2\zstop}{\z#3\zstop}\z}
\def\zone#1#2{#1{\z#2\zstop}\z}
\def\znone#1{\zonex#1}
\def\zonex#1{#1\z}
\def\zstop#1{}
\begin{center}
$\z
 \frac{...}{...}
....
\frac{...}170}
\zstop$
\end{center}


\end{document}
David Carlisle
  • 757,742
4

The following (technically) works with your dropbox-file. I just excluded your formula from the example. As https://tex.stackexchange.com/users/9057/schweinebacke mentioned your formula is bigger than the maximum width so you need to introduce line breaks. It is quite easy to find the spots with syntax highlighting.

\documentclass{scrartcl}
\usepackage[paperwidth=16383.99999pt,paperheight=100cm,margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\begin{align*}
1=1\forall 1 \\\textup{Your formula here}
\end{align*}

\end{document}

Your might try gather instead of align in case you prefer a centered alignment.

Here is an image of the beauty: enter image description here

So if anyone knows how to extend \maxdimen, this would be welcomed. Compare What's the absolute largest paper size permissible with pdflatex?. Note 16383.99999pt*2.54/72.27*cm/pt≈5.75831741726858m.

CampanIgnis
  • 4,624