Graphics, Figures & TablestikZ | Example with unexpected Page Geometry

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

tikZ | Example with unexpected Page Geometry

Post by thinkpadT »

hi everybody,

I copied an example code from the TeXample website. After compiling, I get a plot on the top of the PDF page but not a full page plot like in the example output.

Any ideas, how I can get a full page big plot like in the example :D

thanks
-Fawad

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikZ | Example with unexpected Page Geometry

Post by localghost »

There's no evidence in the code that the plot covers the complete page. If you want the page to be cropped to the actual plot, replace the article class with standalone.


Thorsten
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Re: tikZ | Example with unexpected Page Geometry

Post by thinkpadT »

Thanks alot that is, what i was looking for!
cheerz :D
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

tikZ | Example with unexpected Page Geometry

Post by Stefan Kottwitz »

Many of the examples in the TikZ gallery use this code:

Code: Select all

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{10pt}%
You can see this code, if you download the example as a .tex file. It's not displayed on the web site, because it's not required to understand and to run the code. It's just for cropping for displaying on the web site.

Using the standalone class would be easier and would save a few lines, but not everybody has this class installed, and it's pretty new. The visible code doesn't require standalone or preview to be compilable.

Stefan
LaTeX.org admin
Post Reply