Question
I am trying to design a template for my Canon iP7250 printer. I would like to draw it using TikZ. I'd like to compile both pdf files and svg files. The middle should be transparent just like anything outside the outer rim of the disk.
Attempt
My solution is probably to clip any extraneous shapes that extend beyond the DVD's printable area (the outer edge and the inner space)
I tried using information from the following:
- https://tex.stackexchange.com/a/12033/13552
- Tikz clip shapes with another (built in) shape
- Draw arc in tikz when center of circle is specified
- How is the interior of a path determined when reverse clipping?
but I can't seem to get it to work.
\documentclass{article}
\usepackage{fontspec}
\setmainfont[%
% Path= /usr/local/texlive/2014/texmf-dist/fonts/opentype/adobe/sourcesanspro/ ,
Extension = .otf ,
UprightFont = *-Regular ,
ItalicFont = *-RegularIt ,
BoldFont = *-Bold ,
BoldItalicFont = *-BoldIt ]{SourceSansPro}
\usepackage{xltxtra}% adds functionality to fontspec (superior glyphs with \textsuperscript)
\usepackage[%
paperheight=224mm,
paperwidth=130mm,
top=0cm, % distance of the text block from the top of the page
bottom=0cm,
left=0cm,
right=0cm,
% showframe, % show the main blocks
% verbose, % show the values of the parameters in the log file
]{geometry}
%% #### Additional Packages
%SET MARGINS (AND PAGE DIMENSIONS)
\usepackage{tikz}
\usetikzlibrary{calc,spy}
\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\tikzstyle{reverseclip}=[insert path={(current page.north east) --
(current page.south east) --
(current page.south west) --
(current page.north west) --
(current page.north east)}
]
\node [yshift=-119.98mm,draw,shape=circle,minimum width=120mm,fill=red!10] (physicalDVD) at (current page.north) {};
\node [draw,color=green,fill=green!10,shape=circle,minimum width=119mm] (printableArea) at (physicalDVD) {};
\node [minimum width=28mm,shape=circle,draw,color=red,fill=yellow!50] (physicalDVDmiddlespace) at (physicalDVD) {};
\begin{pgfinterruptboundingbox} % To make sure our clipping path does not mess up the placement of the picture
\path [clip] (physicalDVDmiddlespace) [reverseclip];
\end{pgfinterruptboundingbox}
\end{tikzpicture}
\end{document}