3

What is wrong with this code?

\documentclass{article}
\usepackage[active,tightpage]{preview}
\begin{document}
\(1 + 1 = 2\)
\end{document}

I get this error.

$ pdflatex bar.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./bar.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 2 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/preview/preview.sty
(/usr/share/texmf/tex/latex/preview/prtightpage.def)) (./bar.aux)
Preview: Fontsize 10pt
Preview: PDFoutput 1
(./bar.aux) )
No pages of output.
Transcript written on bar.log.

Can you please help me to fix this?

I want the behavior of \documentclass[preview]{standalone}. Both text and math should be rendered, however the page size should be cropped so that is large enough to fit all content, but no larger than that.

Lone Learner
  • 3,226
  • 24
  • 44

1 Answers1

3

You probably want to extract math formula(s), so

\documentclass{article}
%\usepackage[active,tightpage]{preview}
\usepackage[active,tightpage,textmath]{preview}

\begin{document}
\(1 + 1 = 2\)
\end{document}

enter image description here

  • 1
    I want the behavior of \documentclass[preview]{standalone}. Both text and math should be rendered, however the page size should be cropped so that is large enough to fit all content, but no larger than that. – Lone Learner Nov 23 '13 at 09:57
  • @LoneLearner So why not using standalone? – egreg Nov 23 '13 at 11:04
  • @LoneLearner Well,this is completely different question. – Przemysław Scherwentke Nov 23 '13 at 14:51
  • 2
    @greg I see the standalone class missing many features. For example, \setlength{\parskip}{\baselineskip} does not produce the gap I need between paragraphs while using standalone. – Lone Learner Nov 24 '13 at 11:33