apparatus/afm.tex: Use braces to link AFM and piezo subfloats
authorW. Trevor King <wking@tremily.us>
Sat, 11 May 2013 17:22:52 +0000 (13:22 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 11 May 2013 17:22:52 +0000 (13:22 -0400)
Prof. Cruz felt the relationship between the two subfloats should be
more obvious.  I use TikZ to draw an overlay line connecting saved
anchor points in the two subfloats.  PGF/TikZ is awesome!

The xshifts move the anchor points from the center of the brace
endpoint line (between the teeth) to the point of the brace (at the
back of the throat).

src/apparatus/afm.tex
src/packages.tex

index 52e2b27eebd6c9bdd3669de81b66726b6f0e6a34..1940a8f1b50e6c6f6f8dbd6b8d4321772547f041 100644 (file)
@@ -28,10 +28,29 @@ horizontal directions and a range of TODO in the vertical
 \begin{figure}
   \begin{center}
     \subfloat[][]{\label{fig:afm-schematic}
-      \asyinclude{figures/schematic/afm}}
+      \begin{tikzpicture}[remember picture]
+        \node[anchor=south west,inner sep=0] (image) at (0,0) {
+          \asyinclude{figures/schematic/afm}};
+        \begin{scope}[x={(image.south east)},y={(image.north west)}]
+          \draw [decorate,decoration={brace,raise=4pt,mirror}]
+              (0.715,0.05) -- (0.715,0.2)
+              node [midway,xshift=3pt] (afm-piezo-brace) {};
+        \end{scope}
+      \end{tikzpicture}
+    }
     \hspace{.25in}%
     \subfloat[][]{\label{fig:piezo-schematic}
-      \asyinclude{figures/schematic/piezo}}
+      \begin{tikzpicture}[remember picture]
+        \node[anchor=south west,inner sep=0] (image) at (0,0) {
+          \asyinclude{figures/schematic/piezo}};
+        \begin{scope}[x={(image.south east)},y={(image.north west)}]
+          \draw [decorate,decoration={brace,raise=4pt}]
+              (0,0.1) -- (0,0.9)
+              node [midway,xshift=-3pt] (piezo-brace) {};
+          \draw [overlay,out=0,in=180] (afm-piezo-brace) to (piezo-brace);
+        \end{scope}
+      \end{tikzpicture}
+    }
     \caption{\protect\subref{fig:afm-schematic} Operating principle
       for an Atomic Force Microscope\index{AFM}.  A sharp tip
       integrated at the end of a cantilever interacts with the sample.
index fdb63ccdb288d0bb02d7af55ce1219433f79e73e..35a3a00603a64fbde4402d354c53e5fb47fde968 100644 (file)
@@ -84,6 +84,8 @@
 \usepackage{tikz}         % a nice, inline PGF frontend
 \usetikzlibrary{automata} % graph-theory library
 \usetikzlibrary{calc}     % coordinate-calculation library
+\usetikzlibrary{decorations.pathreplacing}  % braces and other fancy paths
+\usetikzlibrary{topaths}      % 'curve to' style lines (in, out, etc.)
 \usetikzlibrary{shapes.misc}  % for 'rounded rectangle'
 
 \usepackage[inline]{asymptote}    % more fancy graphics ;).