27 Aug 2012 19:53
[dk-tug] Uønsket, tom side i starten af dokument
Poul Riis <Poul.Riis <at> skolekom.dk>
2012-08-27 17:53:16 GMT
2012-08-27 17:53:16 GMT
Hvordan undgår jeg at få en tom side i starten af nedenstående?
Ja, undskyld, det er ikke et minimalt eksempel (der er en lidt hidsig makro i starten - selve 'dokumentet' fylder ikke mange linjer), men når jeg laver et minimalt eksempel, forsvinder problemet, og så er jeg lige vidt....
Poul Riis
\documentclass[a4paper,landscape]{article}
\usepackage[x11names]{xcolor}
\usepackage{multido}
\usepackage{pstricks-add}
%\usepackage[landscape,left=5cm, right=2cm,top=-3cm]{geometry}
\makeatletter
\def\psWave{\pst <at> object{psWave}}
\def\psWave <at> i#1#2#3#4#5{% lambda, nb, At, Al, t
\begin <at> SpecialObj
\addto <at> pscode{%
/Times-Roman findfont 0.4 scalefont setfont %
% /Symbol findfont 0.1 scalefont setfont
/cminpt 72.27 2.54 div def
/scalefactor cminpt 1 mul def
scalefactor scalefactor scale
/sometext 20 string def
/lambda #1 def
/nb #2 def
/At #3 def
/Al #4 def
/np 40 def
/tt #5 def
/nptot np nb mul def
/xmax lambda nb mul def
/deltaphi 360 np div def
/phi0 360 tt mul def
/cosphi0 phi0 cos def
/Atst At cosphi0 mul def
/phiakt 0 def
0 3 translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%4.5 neg 0 moveto (Travelling transversal wave) show /AE glyphshow %AE, Oslach, Aring, ae, oslach, aring
4.5 neg 0.2 moveto (Fremadskridende) show
4.5 neg 0.2 neg moveto (transversalb) show /oslash glyphshow (lge) show
0.1 setlinewidth
1 0 0 setrgbcolor
newpath phiakt 360 div lambda mul phiakt phi0 sub cos At mul moveto 1 1 nptot {/phiakt phiakt deltaphi add def phiakt 360 div lambda mul phiakt phi0 sub cos At mul lineto } for stroke
%0 1 1 setcolor
0.5 1 0.5 setcolor
/nbakt 0 def
1 1 nb {newpath phi0 360 div nbakt add lambda mul At 0.1 0 360 arc closepath gsave fill grestore stroke /nbakt nbakt 1 add def} for
1 1 0 setcolor %Farven på bølgegiveren
newpath 0 phi0 cos At mul 0.05 0 360 arc closepath gsave fill grestore stroke
0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0 0 0 setrgbcolor
%4.5 neg 0 moveto (Standing transversal wave) show
4.5 neg 0.2 moveto (St) show /aring glyphshow (ende) show
4.5 neg 0.2 neg moveto (transversalb) show /oslash glyphshow (lge) show
1 0.5 0 setcolor %Farven på kurven for stående transversalbølge
0.1 setlinewidth
/phiakt 0 def
newpath phiakt 360 div lambda mul phiakt cos Atst mul moveto 1 1 nptot {/phiakt phiakt deltaphi add def phiakt 360 div lambda mul phiakt cos Atst mul lineto } for stroke
/nbakt 0 def
1 1 nb {0 1 0 setcolor newpath 0 360 div nbakt add lambda mul Atst 0.1 0 360 arc closepath gsave fill grestore stroke newpath 180 360 div nbakt add lambda mul Atst neg 0.1 0 360 arc closepath gsave fill grestore stroke 1 0 1 setcolor newpath 90 360 div nbakt add lambda mul 0 0.1 0 360 arc closepath gsave fill grestore stroke newpath 270 360 div nbakt add lambda mul 0 0.1 0 360 arc closepath gsave fill grestore stroke /nbakt nbakt 1 add def} for
0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0 0 0 setrgbcolor
%4.5 neg 0 moveto (Travelling longitudinal wave) show
4.5 neg 0.2 moveto (Fremadskridende) show
4.5 neg 0.2 neg moveto (longitudinalb) show /oslash glyphshow (lge) show
0 1 0 setrgbcolor
0.01 setlinewidth
/phiakt 0 def
0 1 nptot {/xakt phiakt 360 div lambda mul phiakt phi0 sub cos Al mul add def newpath xakt 0 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.01 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi add def} for
/phiakt 0 def
1 0 0 setrgbcolor
0 1 nb {/xakt phiakt 360 div lambda mul phiakt phi0 sub cos Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul add def} for
0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0 0 0 setrgbcolor
4.5 neg 0.2 moveto (St) show /aring glyphshow (ende) show
4.5 neg 0.2 neg moveto (longitudinalb) show /oslash glyphshow (lge) show
0 1 0 setrgbcolor
0.01 setlinewidth
/phiakt 0 def
0 1 nptot {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def newpath xakt 0 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.01 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi add def} for
/phiakt 0 def
1 0 0 setrgbcolor
0 1 nb 2 mul {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul 2 div add def} for
/phiakt 90 def
0 0 1 setrgbcolor
0 1 nb 2 mul 1 sub {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul 2 div add def} for
}
\end <at> SpecialObj}
\makeatother
\hoffset=-3cm
\topmargin=-4cm
\pagestyle{empty}
\begin{document}
\special{landscape}\special{! /landplus90 true store}
\psset{unit=1pt}%(1pt=0.351mm)
\multido{\nn=0+0.1}{11}{%
\begin{pspicture}(0,-300)(600,300)
\psaxes[Dx=20,Dy=20,ticksize=0 -3pt](0,0)(0,-200)(600,200)
\psWave{3.5}{6}{1}{0.2}{\nn}%lambda, nb, At, Al
\end{pspicture}
\newpage}
\end{document}
<div>
<div align="left">Hvordan undgår jeg at få en tom side i starten af nedenstående?</div>
<div align="left">Ja, undskyld, det er ikke et minimalt eksempel (der er en lidt hidsig makro i starten - selve 'dokumentet' fylder ikke mange linjer), men når jeg laver et minimalt eksempel, forsvinder problemet, og så er jeg lige vidt....</div>
<br><div align="left">Poul Riis</div>
<br><br><br><div align="left">\documentclass[a4paper,landscape]{article}</div>
<div align="left">\usepackage[x11names]{xcolor}</div>
<div align="left">\usepackage{multido}</div>
<div align="left">\usepackage{pstricks-add}</div>
<br><br><div align="left">%\usepackage[landscape,left=5cm, right=2cm,top=-3cm]{geometry}</div>
<div align="left">\makeatletter</div>
<div align="left">\def\psWave{\pst <at> object{psWave}}</div>
<div align="left">\def\psWave <at> i#1#2#3#4#5{% lambda, nb, At, Al, t</div>
<div align="left">\begin <at> SpecialObj</div>
<div align="left">\addto <at> pscode{%</div>
<div align="left">/Times-Roman findfont 0.4 scalefont setfont %</div>
<div align="left">% /Symbol findfont 0.1 scalefont setfont</div>
<div align="left">/cminpt 72.27 2.54 div def</div>
<div align="left">/scalefactor cminpt 1 mul def</div>
<div align="left">scalefactor scalefactor scale</div>
<div align="left">/sometext 20 string def</div>
<div align="left">/lambda #1 def</div>
<div align="left">/nb #2 def</div>
<div align="left">/At #3 def</div>
<div align="left">/Al #4 def</div>
<div align="left">/np 40 def</div>
<div align="left">/tt #5 def</div>
<div align="left">/nptot np nb mul def</div>
<div align="left">/xmax lambda nb mul def</div>
<div align="left">/deltaphi 360 np div def</div>
<div align="left">/phi0 360 tt mul def</div>
<div align="left">/cosphi0 phi0 cos def</div>
<div align="left">/Atst At cosphi0 mul def</div>
<div align="left">/phiakt 0 def</div>
<div align="left">0 3 translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
<div align="left">%4.5 neg 0 moveto (Travelling transversal wave) show /AE glyphshow %AE, Oslach, Aring, ae, oslach, aring</div>
<div align="left">4.5 neg 0.2 moveto (Fremadskridende) show</div>
<div align="left">4.5 neg 0.2 neg moveto (transversalb) show /oslash glyphshow (lge) show</div>
<div align="left">0.1 setlinewidth</div>
<div align="left">1 0 0 setrgbcolor</div>
<div align="left">newpath phiakt 360 div lambda mul phiakt phi0 sub cos At mul moveto 1 1 nptot {/phiakt phiakt deltaphi add def phiakt 360 div lambda mul phiakt phi0 sub cos At mul lineto } for stroke</div>
<div align="left">%0 1 1 setcolor</div>
<div align="left">0.5 1 0.5 setcolor</div>
<div align="left">/nbakt 0 def</div>
<div align="left">1 1 nb {newpath phi0 360 div nbakt add lambda mul At 0.1 0 360 arc closepath gsave fill grestore stroke /nbakt nbakt 1 add def} for</div>
<div align="left">1 1 0 setcolor %Farven på bølgegiveren</div>
<div align="left">newpath 0 phi0 cos At mul 0.05 0 360 arc closepath gsave fill grestore stroke</div>
<div align="left">0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
<div align="left">0 0 0 setrgbcolor</div>
<div align="left">%4.5 neg 0 moveto (Standing transversal wave) show</div>
<div align="left">4.5 neg 0.2 moveto (St) show /aring glyphshow (ende) show</div>
<div align="left">4.5 neg 0.2 neg moveto (transversalb) show /oslash glyphshow (lge) show</div>
<div align="left">1 0.5 0 setcolor %Farven på kurven for stående transversalbølge</div>
<div align="left">0.1 setlinewidth</div>
<div align="left">/phiakt 0 def</div>
<div align="left">newpath phiakt 360 div lambda mul phiakt cos Atst mul moveto 1 1 nptot {/phiakt phiakt deltaphi add def phiakt 360 div lambda mul phiakt cos Atst mul lineto } for stroke</div>
<div align="left">/nbakt 0 def</div>
<div align="left">1 1 nb {0 1 0 setcolor newpath 0 360 div nbakt add lambda mul Atst 0.1 0 360 arc closepath gsave fill grestore stroke newpath 180 360 div nbakt add lambda mul Atst neg 0.1 0 360 arc closepath gsave fill grestore stroke 1 0 1 setcolor newpath 90 360 div nbakt add lambda mul 0 0.1 0 360 arc closepath gsave fill grestore stroke newpath 270 360 div nbakt add lambda mul 0 0.1 0 360 arc closepath gsave fill grestore stroke /nbakt nbakt 1 add def} for</div>
<div align="left">0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
<div align="left">0 0 0 setrgbcolor</div>
<div align="left">%4.5 neg 0 moveto (Travelling longitudinal wave) show</div>
<div align="left">4.5 neg 0.2 moveto (Fremadskridende) show</div>
<div align="left">4.5 neg 0.2 neg moveto (longitudinalb) show /oslash glyphshow (lge) show</div>
<div align="left">0 1 0 setrgbcolor</div>
<div align="left">0.01 setlinewidth</div>
<div align="left">/phiakt 0 def</div>
<div align="left">0 1 nptot {/xakt phiakt 360 div lambda mul phiakt phi0 sub cos Al mul add def newpath xakt 0 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.01 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi add def} for</div>
<div align="left">/phiakt 0 def</div>
<div align="left">1 0 0 setrgbcolor</div>
<div align="left">0 1 nb {/xakt phiakt 360 div lambda mul phiakt phi0 sub cos Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul add def} for</div>
<div align="left">0 2 neg translate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div>
<div align="left">0 0 0 setrgbcolor</div>
<div align="left">4.5 neg 0.2 moveto (St) show /aring glyphshow (ende) show</div>
<div align="left">4.5 neg 0.2 neg moveto (longitudinalb) show /oslash glyphshow (lge) show</div>
<div align="left">0 1 0 setrgbcolor</div>
<div align="left">0.01 setlinewidth</div>
<div align="left">/phiakt 0 def</div>
<div align="left">0 1 nptot {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def newpath xakt 0 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 0.01 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.01 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi add def} for</div>
<div align="left">/phiakt 0 def</div>
<div align="left">1 0 0 setrgbcolor</div>
<div align="left">0 1 nb 2 mul {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul 2 div add def} for</div>
<div align="left">/phiakt 90 def</div>
<div align="left">0 0 1 setrgbcolor</div>
<div align="left">0 1 nb 2 mul 1 sub {/xakt phiakt 360 div lambda mul phiakt sin phi0 cos mul Al mul add def xakt 0 0.02 0 360 arc closepath gsave fill grestore stroke xakt .1 0.02 0 360 arc closepath gsave fill grestore stroke xakt 0.1 neg 0.02 0 360 arc closepath gsave fill grestore stroke /phiakt phiakt deltaphi np mul 2 div add def} for</div>
<div align="left"> }</div>
<div align="left"> \end <at> SpecialObj}</div>
<div align="left">\makeatother</div>
<br><br><div align="left">\hoffset=-3cm</div>
<div align="left">\topmargin=-4cm</div>
<div align="left">\pagestyle{empty}</div>
<br><div align="left">\begin{document}</div>
<div align="left">\special{landscape}\special{! /landplus90 true store}</div>
<div align="left">\psset{unit=1pt}%(1pt=0.351mm)</div>
<div align="left">\multido{\nn=0+0.1}{11}{% </div>
<div align="left">\begin{pspicture}(0,-300)(600,300)</div>
<div align="left">\psaxes[Dx=20,Dy=20,ticksize=0 -3pt](0,0)(0,-200)(600,200)</div>
<div align="left"> \psWave{3.5}{6}{1}{0.2}{\nn}%lambda, nb, At, Al</div>
<div align="left">\end{pspicture}</div>
<div align="left">\newpage}</div>
<div align="left">\end{document}</div>
<br><br><br><br><br><br>
</div>
RSS Feed