[OS X TeX] Several page layouts in the same document

Alan Munn amunn at gmx.com
Thu Jun 10 16:28:28 CEST 2010


----- Original Message -----
From: Alain Matthes
Sent: 06/09/10 07:11 AM
To: TeX on Mac OS X Mailing List
Subject: Re: Re : [OS X TeX] Several page layouts in the same document

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 ? 
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 ?__ 

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.))

 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) 

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.)

Alan

 \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}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20100610/31a80b40/attachment.html>


More information about the macostex-archives mailing list