This question doesn't entirely make sense because I know I don't need to call driver=dvips. But I would like to know whether anyone can explain what's happening.

A little background

I'm trying to learn tikz. So, I decided to take some old documents containing---what I thought were simple---graphics I created using pstricks and rewrite them using tikz.

Being a creature of habit, I was going the latex->dvips->ps2pdf (I have a shell script which handles this. So, this is usually very unconscious on my part.) But then I was trying things with tikz (such as using spy) which didn't seem to like this route. I remembered I should just being using pdflatex with tikz.

Also, I'd forgotten about some of the other bells-and-whistles I normally load to get pstricks to work correctly: one of which was to load the driver dvips.

So this is what I noticed:

If I compile (using pdflatex) this first MWE, everything works quite well---even though I'm calling the driver dvips. (The tikz code is from van Dongen's new book.)

There are no problems if I get rid of the driver=dvips call. So, please no explanations that I don't need that driver. But what I would like to know is: why there's only an apparent conflict with the driver if tikz is called before I call the driver?

2 Answers
2

If you load geometry with the faulty dvips driver then it doesn't set the lengths responsable for the "pdf-background" \pdfpagewidth and \pdfpageheight and so they keep their default value (set today normally in the format). In my case this is a4 portrait (even if I add some paper option like letterpaper).

If you additionally load tikz it will load graphicx which in turn will set \pdfpagewidth and \pdfpageheight to the current values of \paperwidth and paperheight – which are before geometry in your example "letterpaper portrait" and after geometry "letterpaper landscape".

The problem is that tikz most likely also specifies what driver it wants to use in a semi-automatic way. From what I can see, its probably selecting pdftex.

So what is happening is the following:

Fail: Load Tikz -> driver=pdftex -> Load Geometry -> driver=dvips

Success: Load Geometry -> driver=dvips -> Load Tikz -> driver=pdftex

Since the code works in the second case, it is likely that the dvips driver messes up a page setting in some way, which affects the end result. For instance, if you change in the second answer driver=dvips to driver=pdftex, it works fine.

In short, the main issue is that both packages specify the driver to use in some way, which is why the order matters for the result. This also depends on what processor you use (pdflatex, etc) since they expect different drivers to be used for correct results.