2

Possible Duplicate:
How can I avoid compiling twice?

I am shading first page using following code.

\begin{tikzpicture}[remember picture,overlay]
\shade[left color=white,right color=orange!60]
(current page.south) rectangle (current page.north east); 
\end{tikzpicture}

But I found sometime shading is there on whole page and sometime it is partial (just one strip). I don't know what is reason behind it.How can I fix my problem?

manish
  • 9,111
  • There is no problem. You need to compile twice when you use remember picture,overlay. The partial result arrives only on the first complation. – Alain Matthes Jul 03 '12 at 07:33
  • Thanks it works but i don't want to compile it 2 times. What changes should i made in my code to avoid compilation 2 times. – manish Jul 03 '12 at 07:36
  • 3
    Impossible, two compilations are necessary with the options remember picture,overlay. – Alain Matthes Jul 03 '12 at 07:38
  • I am C programmer but now generating report. This is first time in my life that i need to compile code 2 times. Thanks – manish Jul 03 '12 at 07:40
  • 1
    @manish: Just wait... This is where the fun begins. :-) There are cases where more than two compiles are required. You can use a make type program like latexmk so you don't have to think about it. – Peter Grill Jul 03 '12 at 07:42
  • myscript.sh R -e "Sweave('Report.Rnw')" R CMD pdflatex Report.tex R CMD pdflatex Report.tex Should i use command latexmk Report.tex? – manish Jul 03 '12 at 07:54
  • To be more accurate : 1) you have to use a backend driver that supports position tracking like pdfTeX. 2) You have to run TEX twice since the position information typically gets written into an external file on the first run and is available only on the second run. The predefined node current page is inside a virtual remembered picture, the size of the node is the size of the current page and the position of this node is an absolute position on the page. The exact informations are known only on the second run. – Alain Matthes Jul 03 '12 at 07:55
  • I think the term "compile" used in (La)TeX world is misleading. – kiss my armpit Jul 03 '12 at 07:57
  • @Forgiver Perhaps "run TEX" or "typeset" are better ? – Alain Matthes Jul 03 '12 at 08:41
  • @Altermundus: Theys sounds better. TeXing or typesetting. I prefer the former. – kiss my armpit Jul 03 '12 at 08:44
  • @manish: Use latexmk -pdf Report.tex. – Paul Gaborit Jul 03 '12 at 17:12

0 Answers0