Skip to content
This repository was archived by the owner on Sep 23, 2018. It is now read-only.
This repository was archived by the owner on Sep 23, 2018. It is now read-only.

Factor out repeated graphics parameters #47

@zackw

Description

@zackw

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions