From cfb578ad9f1ded9b6923838d5c003a1086e7d54c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 May 2013 13:22:52 -0400 Subject: [PATCH] apparatus/afm.tex: Use braces to link AFM and piezo subfloats 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 | 23 +++++++++++++++++++++-- src/packages.tex | 2 ++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/apparatus/afm.tex b/src/apparatus/afm.tex index 52e2b27..1940a8f 100644 --- a/src/apparatus/afm.tex +++ b/src/apparatus/afm.tex @@ -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. diff --git a/src/packages.tex b/src/packages.tex index fdb63cc..35a3a00 100644 --- a/src/packages.tex +++ b/src/packages.tex @@ -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 ;). -- 2.26.2