| 1 |
% Copyright 2006 by Till Tantau |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Free Documentation License. |
| 7 |
% |
| 8 |
% See the file doc/generic/pgf/licenses/LICENSE for more details. |
| 9 |
|
| 10 |
% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.45 2009/11/15 13:13:24 ludewich Exp $ |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
\providecommand\href[2]{\texttt{#1}} |
| 15 |
\providecommand\hypertarget[2]{\texttt{#1}} |
| 16 |
\providecommand\hyperlink[2]{\texttt{#1}} |
| 17 |
|
| 18 |
|
| 19 |
\colorlet{examplefill}{yellow!80!black} |
| 20 |
\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8} |
| 21 |
\definecolor{codebackground}{rgb}{0.8,0.8,1} |
| 22 |
|
| 23 |
\newenvironment{pgfmanualentry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist} |
| 24 |
\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt\item\strut{#1}\par\topsep=0pt} |
| 25 |
\newcommand\pgfmanualbody{\parskip3pt} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
\newenvironment{pgflayout}[1]{ |
| 30 |
\begin{pgfmanualentry} |
| 31 |
\pgfmanualentryheadline{\texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}} |
| 32 |
\index{#1@\protect\texttt{#1} layout}% |
| 33 |
\index{Page layouts!#1@\protect\texttt{#1}}% |
| 34 |
\pgfmanualpdflabel{#1}{}% |
| 35 |
\pgfmanualbody |
| 36 |
} |
| 37 |
{ |
| 38 |
\end{pgfmanualentry} |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
\newenvironment{command}[1]{ |
| 43 |
\begin{pgfmanualentry} |
| 44 |
\extractcommand#1\@@ |
| 45 |
\pgfmanualbody |
| 46 |
} |
| 47 |
{ |
| 48 |
\end{pgfmanualentry} |
| 49 |
} |
| 50 |
|
| 51 |
\newenvironment{commandlist}[1]{% |
| 52 |
\begin{pgfmanualentry} |
| 53 |
\foreach \xx in {#1} {% |
| 54 |
\expandafter\extractcommand\xx\@@ |
| 55 |
}% |
| 56 |
\pgfmanualbody |
| 57 |
}{% |
| 58 |
\end{pgfmanualentry} |
| 59 |
}% |
| 60 |
|
| 61 |
% \begin{internallist}[register]{\pgf@xa} |
| 62 |
% \end{internallist} |
| 63 |
% |
| 64 |
% \begin{internallist}[register]{\pgf@xa,\pgf@xb} |
| 65 |
% \end{internallist} |
| 66 |
\newenvironment{internallist}[2][register]{% |
| 67 |
\begin{pgfmanualentry} |
| 68 |
\foreach \xx in {#2} {% |
| 69 |
\expandafter\extractinternalcommand\expandafter{\xx}{#1}% |
| 70 |
}% |
| 71 |
\pgfmanualbody |
| 72 |
}{% |
| 73 |
\end{pgfmanualentry} |
| 74 |
}% |
| 75 |
\def\extractinternalcommand#1#2{% |
| 76 |
\pgfmanualentryheadline{Internal #2 \declare{\texttt{\string#1}}}% |
| 77 |
\removeats{#1}% |
| 78 |
\index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}% |
| 79 |
\index{\strippedat @\protect\myprintocmmand{\strippedat}}% |
| 80 |
\pgfmanualpdflabel{\textbackslash\strippedat}{}% |
| 81 |
} |
| 82 |
|
| 83 |
%% MW: START MATH MACROS |
| 84 |
\def\mvar#1{{\ifmmode\textrm{\textit{#1}}\else\rmfamily\textit{#1}\fi}} |
| 85 |
|
| 86 |
\makeatletter |
| 87 |
|
| 88 |
\def\extractmathfunctionname#1{\extractmathfunctionname@#1(,)\tmpa\tmpb} |
| 89 |
\def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}} |
| 90 |
|
| 91 |
\makeatother |
| 92 |
|
| 93 |
\newenvironment{math-function}[1]{ |
| 94 |
\def\mathdefaultname{#1} |
| 95 |
\extractmathfunctionname{#1} |
| 96 |
\edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}% |
| 97 |
\begin{pgfmanualentry} |
| 98 |
\pgfmanualentryheadline{\texttt{#1}}% |
| 99 |
\index{\mathname @\protect\texttt{\mathname} math function}% |
| 100 |
\index{Math functions!\mathname @\protect\texttt{\mathname}}% |
| 101 |
\pgfmanualbody |
| 102 |
} |
| 103 |
{ |
| 104 |
\end{pgfmanualentry} |
| 105 |
} |
| 106 |
|
| 107 |
\def\pgfmanualemptytext{} |
| 108 |
\def\pgfmanualvbarvbar{\char`\|\char`\|} |
| 109 |
|
| 110 |
\newenvironment{math-operator}[4][]{% |
| 111 |
\begin{pgfmanualentry} |
| 112 |
\csname math#3operator\endcsname{#2}{#4} |
| 113 |
\def\mathtest{#4}% |
| 114 |
\ifx\mathtest\pgfmanualemptytext% |
| 115 |
\def\mathtype{(#3 operator)} |
| 116 |
\else% |
| 117 |
\def\mathtype{(#3 operator; uses the \texttt{#4} function)} |
| 118 |
\fi% |
| 119 |
\pgfmanualentryheadline{\mathexample\hfill\mathtype}% |
| 120 |
\def\mathtest{#1}% |
| 121 |
\ifx\mathtest\pgfmanualemptytext% |
| 122 |
\index{#2@\protect\texttt{#2} #3 math operator}% |
| 123 |
\index{Math operators!#2@\protect\texttt{#2}}% |
| 124 |
\fi% |
| 125 |
\pgfmanualbody |
| 126 |
} |
| 127 |
{\end{pgfmanualentry}} |
| 128 |
|
| 129 |
\newenvironment{math-operators}[5][]{% |
| 130 |
\begin{pgfmanualentry} |
| 131 |
\csname math#4operator\endcsname{#2}{#3} |
| 132 |
\def\mathtest{#5}% |
| 133 |
\ifx\mathtest\pgfmanualemptytext% |
| 134 |
\def\mathtype{(#4 operators)} |
| 135 |
\else% |
| 136 |
\def\mathtype{(#4 operators; use the \texttt{#5} function)} |
| 137 |
\fi% |
| 138 |
\pgfmanualentryheadline{\mathexample\hfill\mathtype}% |
| 139 |
\def\mathtest{#1}% |
| 140 |
\ifx\mathtest\pgfmanualemptytext% |
| 141 |
\index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}% |
| 142 |
\index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}% |
| 143 |
\fi% |
| 144 |
\pgfmanualbody |
| 145 |
} |
| 146 |
{\end{pgfmanualentry}} |
| 147 |
|
| 148 |
\def\mathinfixoperator#1#2{% |
| 149 |
\def\mathoperator{\texttt{#1}}% |
| 150 |
\def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}% |
| 151 |
} |
| 152 |
|
| 153 |
\def\mathprefixoperator#1#2{% |
| 154 |
\def\mathoperator{\texttt{#1}}% |
| 155 |
\def\mathexample{\texttt{#1}\mvar{x}}% |
| 156 |
} |
| 157 |
|
| 158 |
\def\mathpostfixoperator#1#2{% |
| 159 |
\def\mathoperator{\texttt{#1}} |
| 160 |
\def\mathexample{\mvar{x}\texttt{#1}}% |
| 161 |
} |
| 162 |
|
| 163 |
\def\mathgroupoperator#1#2{% |
| 164 |
\def\mathoperator{\texttt{#1\ #2}}% |
| 165 |
\def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}% |
| 166 |
} |
| 167 |
|
| 168 |
\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator |
| 169 |
\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator |
| 170 |
|
| 171 |
\def\mathconditionaloperator#1#2{% |
| 172 |
\def\mathoperator{#1\space#2} |
| 173 |
\def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}} |
| 174 |
} |
| 175 |
|
| 176 |
\newcommand\mathcommand[1][\mathdefaultname]{% |
| 177 |
\expandafter\makemathcommand#1(\empty)\stop% |
| 178 |
\expandafter\extractcommand\mathcommandname\@@% |
| 179 |
\medskip |
| 180 |
} |
| 181 |
\makeatletter |
| 182 |
|
| 183 |
\def\makemathcommand#1(#2)#3\stop{% |
| 184 |
\expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}% |
| 185 |
\ifx#2\empty% |
| 186 |
\else% |
| 187 |
\@makemathcommand#2,\stop, |
| 188 |
\fi} |
| 189 |
\def\@makemathcommand#1,{% |
| 190 |
\ifx#1\stop% |
| 191 |
\else% |
| 192 |
\expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}% |
| 193 |
\expandafter\@makemathcommand% |
| 194 |
\fi} |
| 195 |
\makeatother |
| 196 |
|
| 197 |
\def\calcname{\textsc{calc}} |
| 198 |
%% MW: END MATH MACROS |
| 199 |
|
| 200 |
|
| 201 |
\def\extractcommand#1#2\@@{% |
| 202 |
\pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}% |
| 203 |
\removeats{#1}% |
| 204 |
\index{\strippedat @\protect\myprintocmmand{\strippedat}} |
| 205 |
\pgfmanualpdflabel{\textbackslash\strippedat}{}% |
| 206 |
} |
| 207 |
|
| 208 |
|
| 209 |
% \begin{environment}{{name}\marg{arguments}} |
| 210 |
\renewenvironment{environment}[1]{ |
| 211 |
\begin{pgfmanualentry} |
| 212 |
\extractenvironement#1\@@ |
| 213 |
\pgfmanualbody |
| 214 |
} |
| 215 |
{ |
| 216 |
\end{pgfmanualentry} |
| 217 |
} |
| 218 |
|
| 219 |
\def\extractenvironement#1#2\@@{% |
| 220 |
\pgfmanualentryheadline{{\ttfamily\char`\\begin\char`\{\declare{#1}\char`\}}#2}% |
| 221 |
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}% |
| 222 |
\pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}% |
| 223 |
\index{#1@\protect\texttt{#1} environment}% |
| 224 |
\index{Environments!#1@\protect\texttt{#1}} |
| 225 |
\pgfmanualpdflabel{#1}{}% |
| 226 |
} |
| 227 |
|
| 228 |
|
| 229 |
\newenvironment{plainenvironment}[1]{ |
| 230 |
\begin{pgfmanualentry} |
| 231 |
\extractplainenvironement#1\@@ |
| 232 |
\pgfmanualbody |
| 233 |
} |
| 234 |
{ |
| 235 |
\end{pgfmanualentry} |
| 236 |
} |
| 237 |
|
| 238 |
\def\extractplainenvironement#1#2\@@{% |
| 239 |
\pgfmanualentryheadline{{\ttfamily\declare{\char`\\#1}}#2}% |
| 240 |
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}% |
| 241 |
\pgfmanualentryheadline{{\ttfamily\declare{\char`\\end#1}}}% |
| 242 |
\index{#1@\protect\texttt{#1} environment}% |
| 243 |
\index{Environments!#1@\protect\texttt{#1}}% |
| 244 |
} |
| 245 |
|
| 246 |
|
| 247 |
\newenvironment{contextenvironment}[1]{ |
| 248 |
\begin{pgfmanualentry} |
| 249 |
\extractcontextenvironement#1\@@ |
| 250 |
\pgfmanualbody |
| 251 |
} |
| 252 |
{ |
| 253 |
\end{pgfmanualentry} |
| 254 |
} |
| 255 |
|
| 256 |
\def\extractcontextenvironement#1#2\@@{% |
| 257 |
\pgfmanualentryheadline{{\ttfamily\declare{\char`\\start#1}}#2}% |
| 258 |
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}% |
| 259 |
\pgfmanualentryheadline{{\ttfamily\declare{\char`\\stop#1}}}% |
| 260 |
\index{#1@\protect\texttt{#1} environment}% |
| 261 |
\index{Environments!#1@\protect\texttt{#1}}} |
| 262 |
|
| 263 |
|
| 264 |
\newenvironment{shape}[1]{ |
| 265 |
\begin{pgfmanualentry} |
| 266 |
\pgfmanualentryheadline{Shape {\ttfamily\declare{#1}}}% |
| 267 |
\index{#1@\protect\texttt{#1} shape}% |
| 268 |
\index{Shapes!#1@\protect\texttt{#1}} |
| 269 |
\pgfmanualpdflabel{#1}{}% |
| 270 |
\pgfmanualbody |
| 271 |
} |
| 272 |
{ |
| 273 |
\end{pgfmanualentry} |
| 274 |
} |
| 275 |
|
| 276 |
\newenvironment{shading}[1]{ |
| 277 |
\begin{pgfmanualentry} |
| 278 |
\pgfmanualentryheadline{Shading {\ttfamily\declare{#1}}}% |
| 279 |
\index{#1@\protect\texttt{#1} shading}% |
| 280 |
\index{Shadings!#1@\protect\texttt{#1}} |
| 281 |
\pgfmanualpdflabel{#1}{}% |
| 282 |
\pgfmanualbody |
| 283 |
} |
| 284 |
{ |
| 285 |
\end{pgfmanualentry} |
| 286 |
} |
| 287 |
|
| 288 |
|
| 289 |
\newenvironment{dataformat}[1]{ |
| 290 |
\begin{pgfmanualentry} |
| 291 |
\pgfmanualentryheadline{Format {\ttfamily\declare{#1}}}% |
| 292 |
\index{#1@\protect\texttt{#1} format}% |
| 293 |
\index{Formats!#1@\protect\texttt{#1}} |
| 294 |
\pgfmanualpdflabel{#1}{}% |
| 295 |
\pgfmanualbody |
| 296 |
} |
| 297 |
{ |
| 298 |
\end{pgfmanualentry} |
| 299 |
} |
| 300 |
|
| 301 |
\newenvironment{handler}[1]{ |
| 302 |
\begin{pgfmanualentry} |
| 303 |
\extracthandler#1\@nil% |
| 304 |
\pgfmanualbody |
| 305 |
} |
| 306 |
{ |
| 307 |
\end{pgfmanualentry} |
| 308 |
} |
| 309 |
|
| 310 |
\def\gobble#1{} |
| 311 |
\def\extracthandler#1#2\@nil{% |
| 312 |
\pgfmanualentryheadline{Key handler \meta{key}{\ttfamily/\declare{#1}}#2}% |
| 313 |
\index{\gobble#1@\protect\texttt{#1} handler}% |
| 314 |
\index{Key handlers!#1@\protect\texttt{#1}} |
| 315 |
\pgfmanualpdflabel{/handlers/#1}% |
| 316 |
} |
| 317 |
|
| 318 |
|
| 319 |
\makeatletter |
| 320 |
|
| 321 |
|
| 322 |
\newenvironment{stylekey}[1]{ |
| 323 |
\begin{pgfmanualentry} |
| 324 |
\def\extrakeytext{style, } |
| 325 |
\extractkey#1\@nil% |
| 326 |
\pgfmanualbody |
| 327 |
} |
| 328 |
{ |
| 329 |
\end{pgfmanualentry} |
| 330 |
} |
| 331 |
|
| 332 |
\def\choicesep{$\vert$}% |
| 333 |
\def\choicearg#1{\texttt{#1}} |
| 334 |
|
| 335 |
\newif\iffirstchoice |
| 336 |
|
| 337 |
% \mchoice{choice1,choice2,choice3} |
| 338 |
\newcommand\mchoice[1]{% |
| 339 |
\begingroup |
| 340 |
\firstchoicetrue |
| 341 |
\foreach \mchoice@ in {#1} {% |
| 342 |
\iffirstchoice |
| 343 |
\global\firstchoicefalse |
| 344 |
\else |
| 345 |
\choicesep |
| 346 |
\fi |
| 347 |
\choicearg{\mchoice@}% |
| 348 |
}% |
| 349 |
\endgroup |
| 350 |
}% |
| 351 |
|
| 352 |
% \begin{key}{/path/x=value} |
| 353 |
% \begin{key}{/path/x=value (initially XXX)} |
| 354 |
% \begin{key}{/path/x=value (default XXX)} |
| 355 |
\newenvironment{key}[1]{ |
| 356 |
\begin{pgfmanualentry} |
| 357 |
\def\extrakeytext{} |
| 358 |
%\def\altpath{\emph{\color{gray}or}}% |
| 359 |
\extractkey#1\@nil% |
| 360 |
\pgfmanualbody |
| 361 |
} |
| 362 |
{ |
| 363 |
\end{pgfmanualentry} |
| 364 |
} |
| 365 |
|
| 366 |
% \insertpathifneeded{a key}{/pgf} -> assign mykey={/pgf/a key} |
| 367 |
% \insertpathifneeded{/tikz/a key}{/pgf} -> assign mykey={/tikz/a key} |
| 368 |
% |
| 369 |
% #1: the key |
| 370 |
% #2: a default path (or empty) |
| 371 |
\def\insertpathifneeded#1#2{% |
| 372 |
\def\insertpathifneeded@@{#2}% |
| 373 |
\ifx\insertpathifneeded@@\empty |
| 374 |
\def\mykey{#1}% |
| 375 |
\else |
| 376 |
\insertpathifneeded@#2\@nil |
| 377 |
\ifpgfutil@in@ |
| 378 |
\def\mykey{#2/#1}% |
| 379 |
\else |
| 380 |
\def\mykey{#1}% |
| 381 |
\fi |
| 382 |
\fi |
| 383 |
}% |
| 384 |
\def\insertpathifneeded@#1#2\@nil{% |
| 385 |
\def\insertpathifneeded@@{#1}% |
| 386 |
\def\insertpathifneeded@@@{/}% |
| 387 |
\ifx\insertpathifneeded@@\insertpathifneeded@@@ |
| 388 |
\pgfutil@in@true |
| 389 |
\else |
| 390 |
\pgfutil@in@false |
| 391 |
\fi |
| 392 |
}% |
| 393 |
|
| 394 |
% \begin{keylist}[default path] |
| 395 |
% {/path/option 1=value,/path/option 2=value2} |
| 396 |
% \end{keylist} |
| 397 |
\newenvironment{keylist}[2][]{% |
| 398 |
\begin{pgfmanualentry} |
| 399 |
\def\extrakeytext{}% |
| 400 |
\foreach \xx in {#2} {% |
| 401 |
\expandafter\insertpathifneeded\expandafter{\xx}{#1}% |
| 402 |
\expandafter\extractkey\mykey\@nil% |
| 403 |
}% |
| 404 |
\pgfmanualbody |
| 405 |
}{% |
| 406 |
\end{pgfmanualentry} |
| 407 |
}% |
| 408 |
|
| 409 |
\def\extractkey#1\@nil{% |
| 410 |
\pgfutil@in@={#1}% |
| 411 |
\ifpgfutil@in@% |
| 412 |
\extractkeyequal#1\@nil |
| 413 |
\else% |
| 414 |
\pgfutil@in@{(initial}{#1}% |
| 415 |
\ifpgfutil@in@% |
| 416 |
\extractequalinitial#1\@nil% |
| 417 |
\else |
| 418 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}}\hfill(\extrakeytext no value)}% |
| 419 |
\def\mykey{#1}% |
| 420 |
\def\mypath{}% |
| 421 |
\def\myname{}% |
| 422 |
\firsttimetrue% |
| 423 |
\decompose#1/\nil% |
| 424 |
\fi |
| 425 |
\fi% |
| 426 |
} |
| 427 |
|
| 428 |
\def\extractkeyequal#1=#2\@nil{% |
| 429 |
\pgfutil@in@{(default}{#2}% |
| 430 |
\ifpgfutil@in@% |
| 431 |
\extractdefault{#1}#2\@nil% |
| 432 |
\else% |
| 433 |
\pgfutil@in@{(initial}{#2}% |
| 434 |
\ifpgfutil@in@% |
| 435 |
\extractinitial{#1}#2\@nil% |
| 436 |
\else |
| 437 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}=}#2\hfill(\extrakeytext no default)}% |
| 438 |
\fi% |
| 439 |
\fi% |
| 440 |
\def\mykey{#1}% |
| 441 |
\def\mypath{}% |
| 442 |
\def\myname{}% |
| 443 |
\firsttimetrue% |
| 444 |
\decompose#1/\nil% |
| 445 |
} |
| 446 |
|
| 447 |
\def\extractdefault#1#2(default #3)\@nil{% |
| 448 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}\opt{=}}\opt{#2}\hfill (\extrakeytext default {\ttfamily#3})}% |
| 449 |
} |
| 450 |
|
| 451 |
\def\extractinitial#1#2(initially #3)\@nil{% |
| 452 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}=}#2\hfill (\extrakeytext no default, initially {\ttfamily#3})}% |
| 453 |
} |
| 454 |
|
| 455 |
\def\extractequalinitial#1 (initially #2)\@nil{% |
| 456 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}}\hfill (\extrakeytext initially {\ttfamily#2})}% |
| 457 |
\def\mykey{#1}% |
| 458 |
\def\mypath{}% |
| 459 |
\def\myname{}% |
| 460 |
\firsttimetrue% |
| 461 |
\decompose#1/\nil% |
| 462 |
} |
| 463 |
|
| 464 |
% Introduces a key alias '/#1/<name of current key>' |
| 465 |
% to be used inside of \begin{key} ... \end{key} |
| 466 |
\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par |
| 467 |
\pgfmanualpdflabel{/#1/\myname}{}% |
| 468 |
} |
| 469 |
|
| 470 |
\newif\iffirsttime |
| 471 |
|
| 472 |
\makeatother |
| 473 |
|
| 474 |
\def\decompose/#1/#2\nil{% |
| 475 |
\def\test{#2}% |
| 476 |
\ifx\test\empty% |
| 477 |
% aha. |
| 478 |
\index{#1@\protect\texttt{#1} key}% |
| 479 |
\index{\mypath#1@\protect\texttt{#1}}% |
| 480 |
\def\myname{#1}% |
| 481 |
\else% |
| 482 |
\iffirsttime |
| 483 |
\begingroup |
| 484 |
% also make a pdf link anchor with full key path. |
| 485 |
\def\hyperlabelwithoutslash##1/\nil{% |
| 486 |
\pgfmanualpdflabel{##1}{}% |
| 487 |
}% |
| 488 |
\hyperlabelwithoutslash/#1/#2\nil |
| 489 |
\endgroup |
| 490 |
\def\mypath{#1@\protect\texttt{/#1/}!}% |
| 491 |
\firsttimefalse |
| 492 |
\else |
| 493 |
\expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}% |
| 494 |
\fi |
| 495 |
\def\firsttime{} |
| 496 |
\decompose/#2\nil% |
| 497 |
\fi% |
| 498 |
} |
| 499 |
|
| 500 |
\def\indexkey#1{% |
| 501 |
\def\mypath{}% |
| 502 |
\decompose#1/\nil% |
| 503 |
} |
| 504 |
|
| 505 |
\newenvironment{predefinedmethod}[1]{ |
| 506 |
\begin{pgfmanualentry} |
| 507 |
\extractpredefinedmethod#1\@nil |
| 508 |
\pgfmanualbody |
| 509 |
} |
| 510 |
{ |
| 511 |
\end{pgfmanualentry} |
| 512 |
} |
| 513 |
\def\extractpredefinedmethod#1(#2)\@nil{% |
| 514 |
\pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)} |
| 515 |
\index{#1@\protect\texttt{#1} method}% |
| 516 |
\index{Methods!#1@\protect\texttt{#1}} |
| 517 |
\pgfmanualpdflabel{#1}{}% |
| 518 |
} |
| 519 |
|
| 520 |
|
| 521 |
\newenvironment{ooclass}[1]{ |
| 522 |
\begin{pgfmanualentry} |
| 523 |
\def\currentclass{#1} |
| 524 |
\pgfmanualentryheadline{Class \declare{\texttt{#1}}} |
| 525 |
\index{#1@\protect\texttt{#1} class}% |
| 526 |
\index{Class #1@Class \protect\texttt{#1}}% |
| 527 |
\index{Classes!#1@\protect\texttt{#1}} |
| 528 |
\pgfmanualpdflabel{#1}{}% |
| 529 |
\pgfmanualbody |
| 530 |
} |
| 531 |
{ |
| 532 |
\end{pgfmanualentry} |
| 533 |
} |
| 534 |
|
| 535 |
\newenvironment{method}[1]{ |
| 536 |
\begin{pgfmanualentry} |
| 537 |
\extractmethod#1\@nil |
| 538 |
\pgfmanualbody |
| 539 |
} |
| 540 |
{ |
| 541 |
\end{pgfmanualentry} |
| 542 |
} |
| 543 |
\def\extractmethod#1(#2)\@nil{% |
| 544 |
\def\test{#1} |
| 545 |
\ifx\test\currentclass |
| 546 |
\pgfmanualentryheadline{Constructor \declare{\ttfamily #1}\texttt(#2\texttt)} |
| 547 |
\else |
| 548 |
\pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt)} |
| 549 |
\fi |
| 550 |
\index{#1@\protect\texttt{#1} method}% |
| 551 |
\index{Methods!#1@\protect\texttt{#1}} |
| 552 |
\index{Class \currentclass!#1@\protect\texttt{#1}}% |
| 553 |
\pgfmanualpdflabel{#1}{}% |
| 554 |
} |
| 555 |
|
| 556 |
\newenvironment{attribute}[1]{ |
| 557 |
\begin{pgfmanualentry} |
| 558 |
\extractattribute#1\@nil |
| 559 |
\pgfmanualbody |
| 560 |
} |
| 561 |
{ |
| 562 |
\end{pgfmanualentry} |
| 563 |
} |
| 564 |
\def\extractattribute#1=#2;\@nil{% |
| 565 |
\def\test{#2}% |
| 566 |
\ifx\test\@empty |
| 567 |
\pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially empty)} |
| 568 |
\else |
| 569 |
\pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})} |
| 570 |
\fi |
| 571 |
\index{#1@\protect\texttt{#1} attribute}% |
| 572 |
\index{Attributes!#1@\protect\texttt{#1}} |
| 573 |
\index{Class \currentclass!#1@\protect\texttt{#1}}% |
| 574 |
\pgfmanualpdflabel{#1}{}% |
| 575 |
} |
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
\newenvironment{predefinednode}[1]{ |
| 580 |
\begin{pgfmanualentry} |
| 581 |
\pgfmanualentryheadline{Predefined node {\ttfamily\declare{#1}}}% |
| 582 |
\index{#1@\protect\texttt{#1} node}% |
| 583 |
\index{Predefined node!#1@\protect\texttt{#1}} |
| 584 |
\pgfmanualpdflabel{#1}{}% |
| 585 |
\pgfmanualbody |
| 586 |
} |
| 587 |
{ |
| 588 |
\end{pgfmanualentry} |
| 589 |
} |
| 590 |
|
| 591 |
\newenvironment{coordinatesystem}[1]{ |
| 592 |
\begin{pgfmanualentry} |
| 593 |
\pgfmanualentryheadline{Coordinate system {\ttfamily\declare{#1}}}% |
| 594 |
\index{#1@\protect\texttt{#1} coordinate system}% |
| 595 |
\index{Coordinate systems!#1@\protect\texttt{#1}} |
| 596 |
\pgfmanualpdflabel{#1}{}% |
| 597 |
\pgfmanualbody |
| 598 |
} |
| 599 |
{ |
| 600 |
\end{pgfmanualentry} |
| 601 |
} |
| 602 |
|
| 603 |
\newenvironment{snake}[1]{ |
| 604 |
\begin{pgfmanualentry} |
| 605 |
\pgfmanualentryheadline{Snake {\ttfamily\declare{#1}}}% |
| 606 |
\index{#1@\protect\texttt{#1} snake}% |
| 607 |
\index{Snakes!#1@\protect\texttt{#1}} |
| 608 |
\pgfmanualbody |
| 609 |
} |
| 610 |
{ |
| 611 |
\end{pgfmanualentry} |
| 612 |
} |
| 613 |
|
| 614 |
\newenvironment{decoration}[1]{ |
| 615 |
\begin{pgfmanualentry} |
| 616 |
\pgfmanualentryheadline{Decoration {\ttfamily\declare{#1}}}% |
| 617 |
\index{#1@\protect\texttt{#1} decoration}% |
| 618 |
\index{Decorations!#1@\protect\texttt{#1}} |
| 619 |
\pgfmanualbody |
| 620 |
} |
| 621 |
{ |
| 622 |
\end{pgfmanualentry} |
| 623 |
} |
| 624 |
|
| 625 |
|
| 626 |
\def\pgfmanualbar{\char`\|} |
| 627 |
\makeatletter |
| 628 |
\newenvironment{pathoperation}[3][]{ |
| 629 |
\begin{pgfmanualentry} |
| 630 |
\pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\path}\ |
| 631 |
\ \dots} |
| 632 |
\declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}% |
| 633 |
\def\pgfmanualtest{#1}% |
| 634 |
\ifx\pgfmanualtest\@empty% |
| 635 |
\index{#2@\protect\texttt{#2} path operation}% |
| 636 |
\index{Path operations!#2@\protect\texttt{#2}}% |
| 637 |
\pgfmanualpdflabel{#2}{}% |
| 638 |
\fi% |
| 639 |
\pgfmanualbody |
| 640 |
} |
| 641 |
{ |
| 642 |
\end{pgfmanualentry} |
| 643 |
} |
| 644 |
\newenvironment{datavisualizationoperation}[3][]{ |
| 645 |
\begin{pgfmanualentry} |
| 646 |
\pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\datavisualization}\ |
| 647 |
\ \dots} |
| 648 |
\declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}% |
| 649 |
\def\pgfmanualtest{#1}% |
| 650 |
\ifx\pgfmanualtest\@empty% |
| 651 |
\index{#2@\protect\texttt{#2} (data visualization)}% |
| 652 |
\index{Data visualization!#2@\protect\texttt{#2}}% |
| 653 |
\pgfmanualpdflabel{#2}{}% |
| 654 |
\fi% |
| 655 |
\pgfmanualbody |
| 656 |
} |
| 657 |
{ |
| 658 |
\end{pgfmanualentry} |
| 659 |
} |
| 660 |
\makeatother |
| 661 |
|
| 662 |
\def\extractcommand#1#2\@@{% |
| 663 |
\pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}% |
| 664 |
\removeats{#1}% |
| 665 |
\index{\strippedat @\protect\myprintocmmand{\strippedat}} |
| 666 |
\pgfmanualpdflabel{\textbackslash\strippedat}{}% |
| 667 |
} |
| 668 |
|
| 669 |
\def\doublebs{\texttt{\char`\\\char`\\}} |
| 670 |
|
| 671 |
|
| 672 |
\newenvironment{package}[1]{ |
| 673 |
\begin{pgfmanualentry} |
| 674 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepackage\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX}} |
| 675 |
\index{#1@\protect\texttt{#1} package}% |
| 676 |
\index{Packages and files!#1@\protect\texttt{#1}}% |
| 677 |
\pgfmanualentryheadline{{\ttfamily\char`\\input \declare{#1}.tex\space\space\space \char`\%\space\space plain \TeX}} |
| 678 |
\pgfmanualentryheadline{{\ttfamily\char`\\usemodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t}} |
| 679 |
\pgfmanualbody |
| 680 |
} |
| 681 |
{ |
| 682 |
\end{pgfmanualentry} |
| 683 |
} |
| 684 |
|
| 685 |
|
| 686 |
\newenvironment{pgfmodule}[1]{ |
| 687 |
\begin{pgfmanualentry} |
| 688 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule\char`\{\declare{#1}\char`\}\space\space\space |
| 689 |
\char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}} |
| 690 |
\index{#1@\protect\texttt{#1} module}% |
| 691 |
\index{Modules!#1@\protect\texttt{#1}}% |
| 692 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}} |
| 693 |
\pgfmanualbody |
| 694 |
\pgfmanualpdflabel{#1}{}% |
| 695 |
} |
| 696 |
{ |
| 697 |
\end{pgfmanualentry} |
| 698 |
} |
| 699 |
|
| 700 |
\newenvironment{pgflibrary}[1]{ |
| 701 |
\begin{pgfmanualentry} |
| 702 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space |
| 703 |
\char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}} |
| 704 |
\index{#1@\protect\texttt{#1} library}% |
| 705 |
\index{Libraries!#1@\protect\texttt{#1}}% |
| 706 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}} |
| 707 |
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space |
| 708 |
\char`\%\space\space \LaTeX\space and plain \TeX\space when using \tikzname}} |
| 709 |
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space |
| 710 |
\char`\%\space\space Con\TeX t\space when using \tikzname}} |
| 711 |
\pgfmanualbody |
| 712 |
\pgfmanualpdflabel{#1}{}% |
| 713 |
} |
| 714 |
{ |
| 715 |
\end{pgfmanualentry} |
| 716 |
} |
| 717 |
|
| 718 |
\newenvironment{tikzlibrary}[1]{ |
| 719 |
\begin{pgfmanualentry} |
| 720 |
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}} |
| 721 |
\index{#1@\protect\texttt{#1} library}% |
| 722 |
\index{Libraries!#1@\protect\texttt{#1}}% |
| 723 |
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}} |
| 724 |
\pgfmanualbody |
| 725 |
\pgfmanualpdflabel{#1}{}% |
| 726 |
} |
| 727 |
{ |
| 728 |
\end{pgfmanualentry} |
| 729 |
} |
| 730 |
|
| 731 |
|
| 732 |
|
| 733 |
\newenvironment{filedescription}[1]{ |
| 734 |
\begin{pgfmanualentry} |
| 735 |
\pgfmanualentryheadline{File {\ttfamily\declare{#1}}}% |
| 736 |
\index{#1@\protect\texttt{#1} file}% |
| 737 |
\index{Packages and files!#1@\protect\texttt{#1}}% |
| 738 |
\pgfmanualbody |
| 739 |
} |
| 740 |
{ |
| 741 |
\end{pgfmanualentry} |
| 742 |
} |
| 743 |
|
| 744 |
|
| 745 |
\newenvironment{packageoption}[1]{ |
| 746 |
\begin{pgfmanualentry} |
| 747 |
\pgfmanualentryheadline{{\ttfamily\char`\\usepackage[\declare{#1}]\char`\{pgf\char`\}}} |
| 748 |
\index{#1@\protect\texttt{#1} package option}% |
| 749 |
\index{Package options for \textsc{pgf}!#1@\protect\texttt{#1}}% |
| 750 |
\pgfmanualbody |
| 751 |
} |
| 752 |
{ |
| 753 |
\end{pgfmanualentry} |
| 754 |
} |
| 755 |
|
| 756 |
|
| 757 |
|
| 758 |
\newcommand\opt[1]{{\color{black!50!green}#1}} |
| 759 |
\newcommand\ooarg[1]{{\ttfamily[}\meta{#1}{\ttfamily]}} |
| 760 |
|
| 761 |
\def\opt{\afterassignment\pgfmanualopt\let\next=} |
| 762 |
\def\pgfmanualopt{\ifx\next\bgroup\bgroup\color{black!50!green}\else{\color{black!50!green}\next}\fi} |
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
\def\beamer{\textsc{beamer}} |
| 767 |
\def\pdf{\textsc{pdf}} |
| 768 |
\def\eps{\texttt{eps}} |
| 769 |
\def\pgfname{\textsc{pgf}} |
| 770 |
\def\tikzname{Ti\emph{k}Z} |
| 771 |
\def\pstricks{\textsc{pstricks}} |
| 772 |
\def\prosper{\textsc{prosper}} |
| 773 |
\def\seminar{\textsc{seminar}} |
| 774 |
\def\texpower{\textsc{texpower}} |
| 775 |
\def\foils{\textsc{foils}} |
| 776 |
|
| 777 |
{ |
| 778 |
\makeatletter |
| 779 |
\global\let\myempty=\@empty |
| 780 |
\global\let\mygobble=\@gobble |
| 781 |
\catcode`\@=12 |
| 782 |
\gdef\getridofats#1@#2\relax{% |
| 783 |
\def\getridtest{#2}% |
| 784 |
\ifx\getridtest\myempty% |
| 785 |
\expandafter\def\expandafter\strippedat\expandafter{\strippedat#1} |
| 786 |
\else% |
| 787 |
\expandafter\def\expandafter\strippedat\expandafter{\strippedat#1\protect\printanat} |
| 788 |
\getridofats#2\relax% |
| 789 |
\fi% |
| 790 |
} |
| 791 |
|
| 792 |
\gdef\removeats#1{% |
| 793 |
\let\strippedat\myempty% |
| 794 |
\edef\strippedtext{\stripcommand#1}% |
| 795 |
\expandafter\getridofats\strippedtext @\relax% |
| 796 |
} |
| 797 |
|
| 798 |
\gdef\stripcommand#1{\expandafter\mygobble\string#1} |
| 799 |
} |
| 800 |
|
| 801 |
\def\printanat{\char`\@} |
| 802 |
|
| 803 |
\def\declare{\afterassignment\pgfmanualdeclare\let\next=} |
| 804 |
\def\pgfmanualdeclare{\ifx\next\bgroup\bgroup\color{red!75!black}\else{\color{red!75!black}\next}\fi} |
| 805 |
|
| 806 |
|
| 807 |
\let\textoken=\command |
| 808 |
\let\endtextoken=\endcommand |
| 809 |
|
| 810 |
\def\myprintocmmand#1{\texttt{\char`\\#1}} |
| 811 |
|
| 812 |
\def\example{\par\smallskip\noindent\textit{Example: }} |
| 813 |
\def\themeauthor{\par\smallskip\noindent\textit{Theme author: }} |
| 814 |
|
| 815 |
|
| 816 |
\def\indexoption#1{% |
| 817 |
\index{#1@\protect\texttt{#1} option}% |
| 818 |
\index{Graphic options and styles!#1@\protect\texttt{#1}}% |
| 819 |
} |
| 820 |
|
| 821 |
\def\itemcalendaroption#1{\item \declare{\texttt{#1}}% |
| 822 |
\index{#1@\protect\texttt{#1} date test}% |
| 823 |
\index{Date tests!#1@\protect\texttt{#1}}% |
| 824 |
} |
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
\def\class#1{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}% |
| 829 |
\extractclass#1@\par\topsep=0pt} |
| 830 |
\def\endclass{\endlist} |
| 831 |
\def\extractclass#1#2@{% |
| 832 |
\item{{{\ttfamily\char`\\documentclass}#2{\ttfamily\char`\{\declare{#1}\char`\}}}}% |
| 833 |
\index{#1@\protect\texttt{#1} class}% |
| 834 |
\index{Classes!#1@\protect\texttt{#1}}} |
| 835 |
|
| 836 |
\def\partname{Part} |
| 837 |
|
| 838 |
\makeatletter |
| 839 |
\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index} |
| 840 |
%This index contains pointers to all the commands and configuration keys |
| 841 |
%described somewhere in the documentation. In addition, it contains some |
| 842 |
%keywords that, hopefully, will make it easier to find what you are looking |
| 843 |
%for. |
| 844 |
%%index should also contain carefully selected keywords. This index is |
| 845 |
%%not a good index. |
| 846 |
%\bigskip |
| 847 |
} |
| 848 |
\c@IndexColumns=2 |
| 849 |
\def\theindex{\@restonecoltrue |
| 850 |
\columnseprule \z@ \columnsep 29\p@ |
| 851 |
\twocolumn[\index@prologue]% |
| 852 |
\parindent -30pt |
| 853 |
\columnsep 15pt |
| 854 |
\parskip 0pt plus 1pt |
| 855 |
\leftskip 30pt |
| 856 |
\rightskip 0pt plus 2cm |
| 857 |
\small |
| 858 |
\def\@idxitem{\par}% |
| 859 |
\let\item\@idxitem \ignorespaces} |
| 860 |
\def\endtheindex{\onecolumn} |
| 861 |
\def\noindexing{\let\index=\@gobble} |
| 862 |
|
| 863 |
|
| 864 |
|
| 865 |
\newcommand\symarrow[1]{ |
| 866 |
\index{#1@\protect\texttt{#1} arrow tip}% |
| 867 |
\index{Arrow tips!#1@\protect\texttt{#1}} |
| 868 |
\texttt{#1}& yields thick |
| 869 |
\begin{tikzpicture}[arrows={#1-#1},thick,baseline] |
| 870 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 871 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 872 |
\end{tikzpicture} and thin |
| 873 |
\begin{tikzpicture}[arrows={#1-#1},thin,baseline] |
| 874 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 875 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 876 |
\end{tikzpicture} |
| 877 |
} |
| 878 |
\newcommand\symarrowdouble[1]{ |
| 879 |
\index{#1@\protect\texttt{#1} arrow tip}% |
| 880 |
\index{Arrow tips!#1@\protect\texttt{#1}} |
| 881 |
\texttt{#1}& yields thick |
| 882 |
\begin{tikzpicture}[arrows={#1-#1},thick,baseline] |
| 883 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 884 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 885 |
\end{tikzpicture} |
| 886 |
and thin |
| 887 |
\begin{tikzpicture}[arrows={#1-#1},thin,baseline] |
| 888 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 889 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 890 |
\end{tikzpicture}, double |
| 891 |
\begin{tikzpicture}[arrows={#1-#1},thick,baseline] |
| 892 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 893 |
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); |
| 894 |
\end{tikzpicture} and |
| 895 |
\begin{tikzpicture}[arrows={#1-#1},thin,baseline] |
| 896 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 897 |
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); |
| 898 |
\end{tikzpicture} |
| 899 |
} |
| 900 |
|
| 901 |
\newcommand\sarrow[2]{ |
| 902 |
\index{#1@\protect\texttt{#1} arrow tip}% |
| 903 |
\index{Arrow tips!#1@\protect\texttt{#1}} |
| 904 |
\index{#2@\protect\texttt{#2} arrow tip}% |
| 905 |
\index{Arrow tips!#2@\protect\texttt{#2}} |
| 906 |
\texttt{#1-#2}& yields thick |
| 907 |
\begin{tikzpicture}[arrows={#1-#2},thick,baseline] |
| 908 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 909 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 910 |
\end{tikzpicture} and thin |
| 911 |
\begin{tikzpicture}[arrows={#1-#2},thin,baseline] |
| 912 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 913 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 914 |
\end{tikzpicture} |
| 915 |
} |
| 916 |
|
| 917 |
\newcommand\sarrowdouble[2]{ |
| 918 |
\index{#1@\protect\texttt{#1} arrow tip}% |
| 919 |
\index{Arrow tips!#1@\protect\texttt{#1}} |
| 920 |
\index{#2@\protect\texttt{#2} arrow tip}% |
| 921 |
\index{Arrow tips!#2@\protect\texttt{#2}} |
| 922 |
\texttt{#1-#2}& yields thick |
| 923 |
\begin{tikzpicture}[arrows={#1-#2},thick,baseline] |
| 924 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 925 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 926 |
\end{tikzpicture} and thin |
| 927 |
\begin{tikzpicture}[arrows={#1-#2},thin,baseline] |
| 928 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 929 |
\draw (0pt,.5ex) -- (1cm,.5ex); |
| 930 |
\end{tikzpicture}, double |
| 931 |
\begin{tikzpicture}[arrows={#1-#2},thick,baseline] |
| 932 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 933 |
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); |
| 934 |
\end{tikzpicture} and |
| 935 |
\begin{tikzpicture}[arrows={#1-#2},thin,baseline] |
| 936 |
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex); |
| 937 |
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex); |
| 938 |
\end{tikzpicture} |
| 939 |
} |
| 940 |
|
| 941 |
\newcommand\carrow[1]{ |
| 942 |
\index{#1@\protect\texttt{#1} arrow tip}% |
| 943 |
\index{Arrow tips!#1@\protect\texttt{#1}} |
| 944 |
\texttt{#1}& yields for line width 1ex |
| 945 |
\begin{tikzpicture}[arrows={#1-#1},line width=1ex,baseline] |
| 946 |
\useasboundingbox (0pt,-0.5ex) rectangle (1.5cm,2ex); |
| 947 |
\draw (0pt,.5ex) -- (1.5cm,.5ex); |
| 948 |
\end{tikzpicture} |
| 949 |
} |
| 950 |
\def\myvbar{\char`\|} |
| 951 |
\newcommand\plotmarkentry[1]{% |
| 952 |
\index{#1@\protect\texttt{#1} plot mark}% |
| 953 |
\index{Plot marks!#1@\protect\texttt{#1}} |
| 954 |
\texttt{\char`\\pgfuseplotmark\char`\{\declare{#1}\char`\}} & |
| 955 |
\tikz\draw[color=black!25] plot[mark=#1,mark options={fill=examplefill,draw=black}] coordinates{(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\ |
| 956 |
} |
| 957 |
\newcommand\plotmarkentrytikz[1]{% |
| 958 |
\index{#1@\protect\texttt{#1} plot mark}% |
| 959 |
\index{Plot marks!#1@\protect\texttt{#1}} |
| 960 |
\texttt{mark=\declare{#1}} & \tikz\draw[color=black!25] |
| 961 |
plot[mark=#1,mark options={fill=examplefill,draw=black}] |
| 962 |
coordinates {(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\ |
| 963 |
} |
| 964 |
|
| 965 |
|
| 966 |
|
| 967 |
\ifx\scantokens\@undefined |
| 968 |
\PackageError{pgfmanual-macros}{You need to use extended latex |
| 969 |
(elatex) or (pdfelatex) to process this document}{} |
| 970 |
\fi |
| 971 |
|
| 972 |
\begingroup |
| 973 |
\catcode`|=0 |
| 974 |
\catcode`[= 1 |
| 975 |
\catcode`]=2 |
| 976 |
\catcode`\{=12 |
| 977 |
\catcode `\}=12 |
| 978 |
\catcode`\\=12 |gdef|find@example#1\end{codeexample}[|endofcodeexample[#1]] |
| 979 |
|endgroup |
| 980 |
|
| 981 |
% define \returntospace. |
| 982 |
% |
| 983 |
% It should define NEWLINE as {}, spaces and tabs as \space. |
| 984 |
\begingroup |
| 985 |
\catcode`\^=7 |
| 986 |
\catcode`\^^M=13 |
| 987 |
\catcode`\^^I=13 |
| 988 |
\catcode`\ =13% |
| 989 |
\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^I=13\def^^I{\space}} |
| 990 |
\gdef\showreturn{\show^^M} |
| 991 |
\endgroup |
| 992 |
|
| 993 |
\begingroup |
| 994 |
\catcode`\%=13 |
| 995 |
\catcode`\^^M=13 |
| 996 |
\gdef\commenthandler{\catcode`\%=13\def%{\@gobble@till@return}} |
| 997 |
\gdef\@gobble@till@return#1^^M{} |
| 998 |
\gdef\@gobble@till@return@ignore#1^^M{\ignorespaces} |
| 999 |
\gdef\typesetcomment{\catcode`\%=13\def%{\@typeset@till@return}} |
| 1000 |
\gdef\@typeset@till@return#1^^M{{\def%{\char`\%}\textsl{\char`\%#1}}\par} |
| 1001 |
\endgroup |
| 1002 |
|
| 1003 |
% Define tab-implementation functions |
| 1004 |
% \codeexample@tabinit@replacementchars@ |
| 1005 |
% and |
| 1006 |
% \codeexample@tabinit@catcode@ |
| 1007 |
% |
| 1008 |
% They should ONLY be used in case that tab replacement is active. |
| 1009 |
% |
| 1010 |
% This here is merely a preparation step. |
| 1011 |
% |
| 1012 |
% Idea: |
| 1013 |
% \codeexample@tabinit@catcode@ will make TAB active |
| 1014 |
% and |
| 1015 |
% \codeexample@tabinit@replacementchars@ will insert as many spaces as |
| 1016 |
% /codeexample/tabsize contains. |
| 1017 |
{ |
| 1018 |
\catcode`\^^I=13 |
| 1019 |
% ATTENTION: do NOT use tabs in these definitions!! |
| 1020 |
\gdef\codeexample@tabinit@replacementchars@{% |
| 1021 |
\begingroup |
| 1022 |
\count0=\pgfkeysvalueof{/codeexample/tabsize}\relax |
| 1023 |
\toks0={}% |
| 1024 |
\loop |
| 1025 |
\ifnum\count0>0 |
| 1026 |
\advance\count0 by-1 |
| 1027 |
\toks0=\expandafter{\the\toks0\ }% |
| 1028 |
\repeat |
| 1029 |
\xdef\codeexample@tabinit@replacementchars@@{\the\toks0}% |
| 1030 |
\endgroup |
| 1031 |
\let^^I=\codeexample@tabinit@replacementchars@@ |
| 1032 |
}% |
| 1033 |
\gdef\codeexample@tabinit@catcode@{\catcode`\^^I=13}% |
| 1034 |
}% |
| 1035 |
|
| 1036 |
% Called after any options have been set. It assigns |
| 1037 |
% \codeexample@tabinit@catcode |
| 1038 |
% and |
| 1039 |
% \codeexample@tabinit@replacementchars |
| 1040 |
% which are used inside of |
| 1041 |
%\begin{codeexample} |
| 1042 |
% ... |
| 1043 |
%\end{codeexample} |
| 1044 |
% |
| 1045 |
% \codeexample@tabinit@catcode is either \relax or it makes tab |
| 1046 |
% active. |
| 1047 |
% |
| 1048 |
% \codeexample@tabinit@replacementchars is either \relax or it inserts |
| 1049 |
% a proper replacement sequence for tabs (as many spaces as |
| 1050 |
% configured) |
| 1051 |
\def\codeexample@tabinit{% |
| 1052 |
\ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax |
| 1053 |
\let\codeexample@tabinit@replacementchars=\relax |
| 1054 |
\let\codeexample@tabinit@catcode=\relax |
| 1055 |
\else |
| 1056 |
\let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@ |
| 1057 |
\let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@ |
| 1058 |
\fi |
| 1059 |
} |
| 1060 |
|
| 1061 |
\pgfqkeys{/codeexample}{% |
| 1062 |
width/.code= {\setlength\codeexamplewidth{#1}}, |
| 1063 |
graphic/.code= {\colorlet{graphicbackground}{#1}}, |
| 1064 |
code/.code= {\colorlet{codebackground}{#1}}, |
| 1065 |
execute code/.is if=code@execute, |
| 1066 |
code only/.code= {\code@executefalse}, |
| 1067 |
pre/.store in=\code@pre, |
| 1068 |
post/.store in=\code@post, |
| 1069 |
% #1 is the *complete* environment contents as it shall be |
| 1070 |
% typeset. In particular, the catcodes are NOT the normal ones. |
| 1071 |
typeset listing/.code= {#1}, |
| 1072 |
render instead/.store in=\code@render, |
| 1073 |
vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}}, |
| 1074 |
ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore}, |
| 1075 |
leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax}, |
| 1076 |
tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT. |
| 1077 |
every codeexample/.style={width=4cm+7pt}, |
| 1078 |
} |
| 1079 |
|
| 1080 |
\let\code@pre\pgfutil@empty |
| 1081 |
\let\code@post\pgfutil@empty |
| 1082 |
\let\code@render\pgfutil@empty |
| 1083 |
\def\code@catcode@hook{} |
| 1084 |
|
| 1085 |
\newdimen\codeexamplewidth |
| 1086 |
\newif\ifcode@execute |
| 1087 |
\newbox\codeexamplebox |
| 1088 |
\def\codeexample[#1]{% |
| 1089 |
\begingroup% |
| 1090 |
\code@executetrue |
| 1091 |
\pgfqkeys{/codeexample}{every codeexample,#1}% |
| 1092 |
\codeexample@tabinit% assigns \codeexample@tabinit@[catcode,replacementchars] |
| 1093 |
\parindent0pt |
| 1094 |
\begingroup% |
| 1095 |
\par% |
| 1096 |
\medskip% |
| 1097 |
\let\do\@makeother% |
| 1098 |
\dospecials% |
| 1099 |
\obeylines% |
| 1100 |
\@vobeyspaces% |
| 1101 |
\catcode`\%=13% |
| 1102 |
\catcode`\^^M=13% |
| 1103 |
\code@catcode@hook% |
| 1104 |
\codeexample@tabinit@catcode |
| 1105 |
\relax% |
| 1106 |
\find@example} |
| 1107 |
\def\endofcodeexample#1{% |
| 1108 |
\endgroup% |
| 1109 |
\ifcode@execute% |
| 1110 |
\setbox\codeexamplebox=\hbox{% |
| 1111 |
\ifx\code@render\pgfutil@empty% |
| 1112 |
{% |
| 1113 |
{% |
| 1114 |
\returntospace% |
| 1115 |
\commenthandler% |
| 1116 |
\xdef\code@temp{#1}% removes returns and comments |
| 1117 |
}% |
| 1118 |
\catcode`\^^M=9% |
| 1119 |
\colorbox{graphicbackground}{\color{black}\ignorespaces% |
| 1120 |
\code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}% |
| 1121 |
}% |
| 1122 |
\else% |
| 1123 |
\colorbox{graphicbackground}{\color{black}\ignorespaces% |
| 1124 |
\code@render}% |
| 1125 |
\fi% |
| 1126 |
}% |
| 1127 |
\ifdim\wd\codeexamplebox>\codeexamplewidth% |
| 1128 |
\def\code@start{\par}% |
| 1129 |
\def\code@flushstart{}\def\code@flushend{}% |
| 1130 |
\def\code@mid{\parskip2pt\par\noindent}% |
| 1131 |
\def\code@width{\linewidth-6pt}% |
| 1132 |
\def\code@end{}% |
| 1133 |
\else% |
| 1134 |
\def\code@start{% |
| 1135 |
\linewidth=\textwidth% |
| 1136 |
\parshape \@ne 0pt \linewidth |
| 1137 |
\leavevmode% |
| 1138 |
\hbox\bgroup}% |
| 1139 |
\def\code@flushstart{\hfill}% |
| 1140 |
\def\code@flushend{\hbox{}}% |
| 1141 |
\def\code@mid{\hskip6pt}% |
| 1142 |
\def\code@width{\linewidth-12pt-\codeexamplewidth}% |
| 1143 |
\def\code@end{\egroup}% |
| 1144 |
\fi% |
| 1145 |
\code@start% |
| 1146 |
\noindent% |
| 1147 |
\begin{minipage}[t]{\codeexamplewidth}\raggedright |
| 1148 |
\hrule width0pt% |
| 1149 |
\footnotesize\vskip-1em% |
| 1150 |
\code@flushstart\box\codeexamplebox\code@flushend% |
| 1151 |
\vskip-1ex |
| 1152 |
\leavevmode% |
| 1153 |
\end{minipage}% |
| 1154 |
\else% |
| 1155 |
\def\code@mid{\par} |
| 1156 |
\def\code@width{\linewidth-6pt} |
| 1157 |
\def\code@end{} |
| 1158 |
\fi% |
| 1159 |
\code@mid% |
| 1160 |
\colorbox{codebackground}{% |
| 1161 |
\begin{minipage}[t]{\code@width}% |
| 1162 |
{% |
| 1163 |
\let\do\@makeother |
| 1164 |
\dospecials |
| 1165 |
\frenchspacing\@vobeyspaces |
| 1166 |
\normalfont\ttfamily\footnotesize |
| 1167 |
\typesetcomment% |
| 1168 |
\codeexample@tabinit@replacementchars |
| 1169 |
\@tempswafalse |
| 1170 |
\def\par{% |
| 1171 |
\if@tempswa |
| 1172 |
\leavevmode \null \@@par\penalty\interlinepenalty |
| 1173 |
\else |
| 1174 |
\@tempswatrue |
| 1175 |
\ifhmode\@@par\penalty\interlinepenalty\fi |
| 1176 |
\fi}% |
| 1177 |
\obeylines |
| 1178 |
\everypar \expandafter{\the\everypar \unpenalty}% |
| 1179 |
\pgfkeysvalueof{/codeexample/typeset listing/.@cmd}{#1}\pgfeov |
| 1180 |
} |
| 1181 |
\end{minipage}}% |
| 1182 |
\code@end% |
| 1183 |
\par% |
| 1184 |
\medskip |
| 1185 |
\end{codeexample} |
| 1186 |
} |
| 1187 |
|
| 1188 |
\def\endcodeexample{\endgroup} |
| 1189 |
|
| 1190 |
|
| 1191 |
\makeatother |
| 1192 |
|
| 1193 |
\usepackage{pgfmanual} |
| 1194 |
|
| 1195 |
\makeatletter |
| 1196 |
% \pgfautoxrefs will be defined by 'make dist' |
| 1197 |
\pgfutil@ifundefined{pgfautoxrefs}{% |
| 1198 |
\def\pgfmanualpdflabel#1#2{#2}% NO-OP |
| 1199 |
\def\pgfmanualpdfref#1#2{#2}% |
| 1200 |
\pgfkeys{ |
| 1201 |
/pdflinks/codeexample links=false,% DISABLED. |
| 1202 |
}% |
| 1203 |
}{} |
| 1204 |
\makeatother |
| 1205 |
|
| 1206 |
%%% Local Variables: |
| 1207 |
%%% mode: latex |
| 1208 |
%%% TeX-master: "beameruserguide" |
| 1209 |
%%% End: |