Sharpie/RTikZDevice — Issue #47: Factor out repeated graphics parameters
Author: zackw
Created: 2011-12-04 21:15:03+00:00
State: open

Constructs such as

\begin{tikzpicture}[x=1pt,y=1pt]
\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (144.54,144.54);
\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
\fill[color=fillColor] ( 0.00, 0.00) rectangle (144.54,144.54);
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (144.54,144.54);
\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20] at ( 73.39, 9.03) {1};
\end{scope}
\begin{scope}
\path[clip] ( 0.00, 0.00) rectangle (144.54,144.54);
\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
\node[rotate= 90.00,color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20] at ( 17.30, 76.40) {1};
\end{scope}
\end{tikzpicture}

contain a great deal of repetitive clipping and color specification. It would be better to emit

\begin{tikzpicture}[x=1pt,y=1pt]
\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
\path[clip] ( 0.00, 0.00) rectangle (144.54,144.54);
\fill[color=fillColor] ( 0.00, 0.00) rectangle (144.54,144.54);
\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20] at ( 73.39, 9.03) {1};
\node[rotate= 90.00,color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20] at ( 17.30, 76.40) {1};
\end{tikzpicture}

or, even better, noticing that the colors used are black and white,

\begin{tikzpicture}[x=1pt,y=1pt]
\path[clip] ( 0.00, 0.00) rectangle (144.54,144.54);
\fill[color=white] ( 0.00, 0.00) rectangle (144.54,144.54);
\node[anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20]
at ( 73.39, 9.03) {1};
\node[rotate= 90.00,anchor=base,inner sep=0pt, outer sep=0pt, scale= 1.20]
at ( 17.30, 76.40) {1};
\end{tikzpicture}