Debian Codegraph @

texmf-dist/doc/latex/adjustbox/trim3.tex

raw
1
2 \def\text{\sffamily\scalebox{10}{Xy}}
3 \sbox\mybox{\sffamily\color{black!25}\scalebox{10}{Xy}}
4 \def\HEIGHT{\ht\mybox}
5 \def\WIDTH{\wd\mybox}
6 \def\DEPTH{\dp\mybox}
7 \def\LLX{.15\WIDTH}
8 \def\LLY{.4\DEPTH}
9 \def\URX{.15\WIDTH}
10 \def\URY{(\HEIGHT+.25\DEPTH)}
11 \begin{tikzpicture}[font=\sffamily,>=latex]
12 \draw [gray,thin]
13 (0,0) -- +(-3.5ex,0)
14 (0,\HEIGHT) -- +(-3.5ex,0)
15 (0,-\DEPTH) -- +(-3.5ex,0)
16 (\WIDTH,\HEIGHT) -- +(3.5ex,0)
17 (\WIDTH,-\DEPTH) -- +(3.5ex,0)
18 (0,-\DEPTH) -- +(0,-3.5ex)
19 (\WIDTH,-\DEPTH) -- +(0,-3.5ex)
20 ;
21 \node [inner sep=0pt,anchor=base west] {\usebox\mybox};
22 \draw (0,0) -- (\WIDTH,0);% node [above,midway] {baseline};
23 \draw [->] (-2.5ex,0) -- +(0,-\DEPTH) node [midway,left] {depth};
24 \draw [->] (-2.5ex,0) -- +(0, \HEIGHT) node [midway,left] {height};
25 \draw [<->] (\WIDTH,-\DEPTH) ++(2.5ex,0) -- +(0,\DEPTH+\HEIGHT) node [midway,right] {totalheight};
26 \draw [<->] (0,-\DEPTH) ++(0,-2.5ex) -- +(\WIDTH,0) node [midway,below] {width};
27 \fill (-2.5ex,0) circle (.5pt);
28 \begin{scope}[blue] %,every node/.append style={inner sep=2pt}]
29 \begin{scope}
30 \clip ([shift={(\LLX,\LLY)}]0,-\DEPTH) rectangle ([shift={(-\URX,-\URY)}]\WIDTH,\HEIGHT);
31 \node [inner sep=0pt,anchor=base west,color=blue!50!white] {\text};
32 \end{scope}
33 \draw ([shift={(\LLX,\LLY)}]0,-\DEPTH) rectangle ([shift={(-\URX,-\URY)}]\WIDTH,\HEIGHT);
34 \draw [->] (\LLX,-\DEPTH) -- ++(0,\LLY) node [right,midway] {\scriptsize lly};
35 \draw [->] (0,-\DEPTH+\LLY) -- ++(\LLX,0) node [above,midway] {\scriptsize llx};
36 \draw (\LLX,-\DEPTH+\LLY) -- ([shift={(-\URX,0)}]\WIDTH,-\DEPTH+\LLY);
37 \draw [->] (\LLX+.2\WIDTH,{\HEIGHT-\URY}) -- (\LLX+.2\WIDTH,0) node [pos=0.4,below right] {\scriptsize moves up};
38 \path [fill=white,draw] (\LLX,{\HEIGHT-\URY}) circle (1pt);
39 \draw [->]
40 ([shift={(-\URX,0)}]\WIDTH,\HEIGHT) --
41 ([shift={(-\URX,-\URY)}]\WIDTH,\HEIGHT)
42 node [left,midway] {\scriptsize ury}
43 ;
44 \draw [->]
45 ([shift={(0,-\URY)}]\WIDTH,\HEIGHT) --
46 ([shift={(-\URX,-\URY)}]\WIDTH,\HEIGHT)
47 node [below,midway] {\scriptsize urx}
48 ;
49 \end{scope}
50 \draw [thick] (0,-\DEPTH) rectangle (\WIDTH,\HEIGHT);
51 \path [fill=white,draw=black] (0,0) circle (1pt);
52 \path let
53 \p1 = (current bounding box.south west),
54 \p2 = (current bounding box.north east),
55 \p3 = (0,-\DEPTH),
56 \p4 = (\WIDTH,\HEIGHT)
57 in
58 (\x3-\x2+\x4,\y3) rectangle (\x4+\x3-\x1,\y4);
59 \end{tikzpicture}