Debian Codegraph @

texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex

raw
1 % Copyright 2019 by Till Tantau and Christian Feuersänger
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 Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \input pgfmanual.prettyprinter.code.tex
11 \input pgfmanual.pdflinks.code.tex
12
13 % TODO for auto xrefs:
14 % 1. check the already identified labels, preferably using
15 % /pdflinks/show labels=true
16 % and the image externalization debug mode (see pgfmanual-en-main.tex)
17 % (to strip almost all images away)
18 %
19 % 2. Insert '\declareandlabel' in the document whenever something has been
20 % defined in the text, so it should get a pdf anchor (see
21 % pgfmanual.pdflinks.code.tex )
22 %
23 % 2.1 perhaps insert \pgfmanualpdflabel{<label>}{} where needed.
24 %
25 % 3. Verify that the |...| commands occurring in situations where catcodes can't
26 % be changed (footnotes or macro arguments) work as expected.
27 %
28 % 4. Consider telling the pretty printer that several control sequences
29 % have arguments which are options (see below for the predefined list).
30 % This may apply to \pgfpageslogicalpageoptions or so.
31 %
32 % 5. @Christian: consider extensions of the parser such that it identifies path commands (at least partially)
33 %
34 %
35
36 \def\pgfmanual@warning#1{\pgf@typeout{! Package pgfmanual Warning: #1}}%
37
38
39 \pgfkeys{
40 % set this to 'false' to disable auto reference generation.
41 % However, a little bit runtime overhead will still remain
42 % (and the \pgfmanualpdflabel commands will still be used)
43 /pdflinks/codeexample links=true,
44 %
45 /codeexample/prettyprint/cs arguments/tikzset/.initial=1,
46 /codeexample/prettyprint/cs/tikzset/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace},
47 /codeexample/prettyprint/cs arguments/usetikzlibrary/.initial=1,
48 /codeexample/prettyprint/cs/usetikzlibrary/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualpdfref{#2}{#2}\pgfmanualclosebrace},
49 /codeexample/prettyprint/cs arguments/usepgflibrary/.initial=1,
50 /codeexample/prettyprint/cs/usepgflibrary/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualpdfref{#2}{#2}\pgfmanualclosebrace},
51 %
52 %
53 %
54 % whenever an unqualified key is found, the following key prefix
55 % list is tried to find a match.
56 /pdflinks/search key prefixes in={/tikz/,/pgf/},
57 %
58 % the link prefix written to the pdf file:
59 /pdflinks/internal link prefix=pgf,
60 %
61 /pdflinks/warnings=false,
62 % for debugging:
63 /pdflinks/show labels=false,
64 }%