<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title></title><meta http-equiv="Content-type" content="text/html; charset=UTF-8" /><style type="text/css">p { margin:0px; padding:0px; }</style></head><body style='background-color:rgb(255, 255, 255);background-image:none;background-repeat:repeat;background-position:0% 0%;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:12px;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;padding-top:5px;padding-bottom:5px;padding-left:5px;padding-right:5px;'><p><span style="font-family:Verdana;"><font size="1"><br /><p></p><blockquote type="cite" class="quote"><p>----- Original Message -----</p><p>From: Alain Matthes</p><p>Sent: 06/09/10 07:11 AM</p><p>To: TeX on Mac OS X Mailing List</p><p>Subject: Re: Re : [OS X TeX] Several page layouts in the same document</p><br /><div><div><pre>Le 9 juin 2010 à 09:03, Ewan Delanoy a écrit :  >  >   Thanks Alan and Alain ... your solution almost works, > although for some reason the new geometry package > behaves slightly differently from the old one : with > the old one I got an exact paving of the page, with > the new one the paving overlaps and is too far left. >  >   the natural fix to this would be to change the coordinates > of the rectangle, e.g.  >    > \draw[xstep=1.75cm,ystep=2.47,gray!50] (a,b) grid (21,29.65); >  > instead of >  > \draw[xstep=1.75cm,ystep=2.47,gray!50] (0,0) grid (21,29.65); >  > where a and b are ad hoc values. > Not surprisingly, the paving's location in the page stays the same whatever  > values I put for a and b. Any ideas on how to fix this ? <br />hi  This is normal. (0,0) or (a,b) are used inside the picture and not  with the coordinates of the page.  I have not your problem with the new geometry __ I work only with pdflatex but perhaps  you work with dvi-ps-pdf  ?__ <br /><br /></pre></div></div></blockquote><div><div><p>I too, don't have Ewan's new problem with the example I posted (and Alain's cleaned up one.) I think the problem you are seeing, Ewan, is a symptom of different paper sizes being set in your document, somehow.  (For example, I can replicate your problem if I pass the option 'letterpaper' to the documentclass, but 'a4paper' to geometry.)  Since it's unlikely that you actually did this, it's more likely that the default papersize for two different parts of the tool chain are set differently.  (Alain's question is definitely on the right track, since it could be a difference between the setting for pdftex and dvips (although if you're using tikz, that shouldn't be the case.))<br /></p></div></div><blockquote type="cite" class="quote"><div><div><pre> A better solution is to use the size of a4paper 21 cm and 29.7 cm.  I think you want 144 rectangles so (29.7/12=2.475) <br /><br /></pre></div></div></blockquote><div><div><p>I would call this a workaround rather than a better solution. :-)  Since the minimal documents that we played with work perfectly, there is really something else going on (alternative solutions notwithstanding.)</p><p><br /></p><p>Alan</p><p><br /></p></div></div><blockquote type="cite" class="quote"><div><div><pre> \draw[xstep=\paperwidth/12,ystep=\paperheight/12,gray!50] (0,0) grid (\paperwidth,\paperheight);    you don't need [x=1cm,y=1cm] by default, you have x=1cm,y=1cm !    Another possibility is  to avoid geometry and to use absolute position with tikz. In this case, you need to compile twice !!  This solution is interesting because the picture is on the first page but  there is a BUT : I have a problem with "grid" .   I don't get the good result and I don't know why. The grid is misplaced. I make a grid but with the use of current page nodes.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper]{article}   \usepackage{lipsum} \usepackage{tikz} \usetikzlibrary{calc} \def\maketitle{% \null% \thispagestyle{empty}% \noindent% \begin{tikzpicture}[overlay,remember picture] \draw[red] (current page.south west) -- (current page.north east);  \foreach \x in {0,1,...,11} {\draw[gray!50] ($(current page.south west) +(0,\x*\paperheight/12)$)%        -- ($(current page.south east) +(0,\x*\paperheight/12)$);  \draw[gray!50] ($(current page.south west) +(\x*\paperwidth/12,0)$)%        -- ($(current page.north west) +(\x*\paperwidth/12,0)$);  } \end{tikzpicture}% \clearpage% }  \begin{document} \maketitle    \lipsum[1-2] \end{document}   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   Best Regards   Alain Matthes  PS :  I give you two other examples to see  how to make a picture  with or without geometry.    %%%%%%%%%%% Annexe one %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper]{book} \usepackage{tikz} \usetikzlibrary{calc,fadings} \usepackage{geometry} \usepackage{lipsum}   \def\maketitle{%   \thispagestyle{empty}%   \noindent\begin{tikzpicture} \shade[top color=blue!50!black, bottom color=blue!50]%  (current page.south west) rectangle (current page.north east); \draw[red] (current page.south west) -- (current page.north east); \end{tikzpicture}   \clearpage }   \begin{document}  \newgeometry{hmargin=0cm,vmargin=0cm} \maketitle \restoregeometry  \lipsum  \end{document}      %%%%%%%%%% Annexe two %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[10pt,a4paper,openany]{book} \usepackage{tikz} \usetikzlibrary{calc,fadings} \usepackage{geometry} \usepackage{lipsum}  \def\maketitle{%   \null   \thispagestyle{empty}%   \noindent\begin{tikzpicture}[overlay,remember picture]  \shade[top color=blue!50!black, bottom color=blue!50]%  (current page.north west) rectangle (current page.south east); \draw[red] (current page.south west) -- (current page.north east);   \end{tikzpicture} \clearpage }  \begin{document}  \maketitle  \lipsum  \end{document}</pre></div></div></blockquote></font></span></p><font size="1"><br /></font><p></p></body></html>