diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex | 149 |
1 files changed, 144 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex index 5c0e4fa1215..fbb96fa537d 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex @@ -1,21 +1,33 @@ +\def\eps{\textsc{eps}} + \input pgfmanual-en-macros.tex \def\pgfmanualbar{\char`\|} \makeatletter \newenvironment{addplotoperation}[3][]{ \begin{pgfmanualentry} + {% + \let\ltxdoc@marg=\marg + \let\ltxdoc@oarg=\oarg + \let\ltxdoc@parg=\parg + \let\ltxdoc@meta=\meta + \def\marg##1{{\normalfont\ltxdoc@marg{##1}}}% + \def\oarg##1{{\normalfont\ltxdoc@oarg{##1}}}% + \def\parg##1{{\normalfont\ltxdoc@parg{##1}}}% + \def\meta##1{{\normalfont\ltxdoc@meta{##1}}}% \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\addplot\ }}% \declare{\texttt{#2}} \texttt{#3;}}% \unskip \nobreak - \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\addplot[\meta{style options}] {\small plot[\meta{behavior options}]}}\ }% - \declare{\texttt{#2}} \texttt{#3}\ \textcolor{gray}{\meta{trailing path commands}\texttt{;}}}% + \pgfmanualentryheadline{\textcolor{gray}{{\texttt{\char`\\addplot}\oarg{style options} \texttt{plot}\oarg{behavior options}}\ }% + \declare{\texttt{#2}} \texttt{#3} \textcolor{gray}{\meta{trailing path commands}}\texttt{;}}% \def\pgfmanualtest{#1}% \ifx\pgfmanualtest\@empty% - \index{#2@\protect\texttt{#2} path operation}% - \index{Path operations!#2@\protect\texttt{#2}}% + \index{#2@\protect\textcolor{gray}{\protect\texttt{plot}}\protect\texttt{ #2}}% + \index{Plot operations!plot #2@\protect\texttt{plot #2}}% \fi% + }% \pgfmanualbody } { @@ -56,6 +68,22 @@ \end{pgfmanualentry} } +\newenvironment{pgfplotsxycodekeylist}[1]{% + \begingroup + \let\oldpgfmanualentryheadline=\pgfmanualentryheadline + \def\pgfmanualentryheadline##1{% + \pgfmanualentryheadline@##1\pgfplots@EOI + }% + \def\pgfmanualentryheadline@##1\hfill##2\pgfplots@EOI{% + \oldpgfmanualentryheadline{{\ttfamily\declare{##1}\textcolor{gray}{/.code}=\marg{...}}\hfill}% + } + \begin{pgfplotsxykeylist}{#1}% +} +{ + \end{pgfplotsxykeylist} + \endgroup +} + \newenvironment{pgfplotskey}[1]{% \begin{key}{/pgfplots/#1}% } @@ -100,6 +128,25 @@ \end{pgfmanualentry} }% +% \begin{xystylekey}{/path/\x label=value} +% \end{xystylekey} +% +% has same features with 'default', 'initially' etc as key environment +\newenvironment{xystylekey}[2][]{% + \begin{pgfmanualentry} + \def\extrakeytext{style, } + \insertpathifneeded{#2}{#1}% + \expandafter\pgfutil@in@\expandafter=\expandafter{\mykey}% + \ifpgfutil@in@% + \expandafter\xykey@eq\mykey\@nil + \else + \expandafter\xykey@noeq\mykey\@nil + \fi + \pgfmanualbody +}{% + \end{pgfmanualentry} +}% + % \insertpathifneeded{a key}{/pgfplots} -> assign mykey={/pgfplots/a key} % \insertpathifneeded{/tikz/a key}{/pgfplots} -> assign mykey={/tikz/a key} % @@ -241,11 +288,103 @@ \newenvironment{pgfplotstablecolumnkey}{% \begin{pgfmanualentry} \pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{columns/\meta{column name}}\textcolor{gray}{/.style}=\marg{key-value-list}}\hfill}% + \pgfplotsmanualkeyindex{/pgfplots/table/columns}% \pgfmanualbody } { \end{pgfmanualentry} } -\makeatother +\newenvironment{pgfplotstabledisplaycolumnkey}{% + \begin{pgfmanualentry} + \pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{display columns/\meta{index}}\textcolor{gray}{/.style}=\marg{key-value-list}}\hfill}% + \pgfplotsmanualkeyindex{/pgfplots/table/display columns}% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\newenvironment{pgfplotstablealiaskey}{% + \begin{pgfmanualentry} + \pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{alias/\meta{col name}}\textcolor{gray}{/.initial}=\marg{real col name}}\hfill}% + \pgfplotsmanualkeyindex{/pgfplots/table/alias}% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} + + +\def\pgfplotsmanualkeyindex#1{% + \def\mypath{#1}% + \def\myname{}% + \firsttimetrue% + \decompose#1/\nil% +} +\newenvironment{pgfplotstablecreateonusekey}{% + \begin{pgfmanualentry} + \pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{create on use/\meta{col name}}\textcolor{gray}{/.style}=\marg{create options}}\hfill}% + \def\mykey{/pgfplots/table/create on use}% + \pgfmanualbody + \pgfplotsmanualkeyindex{/pgfplots/table/create on use}% +} +{ + \end{pgfmanualentry} +} + +\def\pgfplotsassertcmdkeyexists#1{% + \pgfkeysifdefined{/pgfplots/#1/.@cmd}\relax{% + \pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% + }% +}% +{ +\catcode`\ =12% +\gdef\makespaceexpandable{\def\ { }}}% +\def\pgfplotsassertXYcmdkeyexists#1{% + {\makespaceexpandable\def\x{x}\edef\pgfplotsassertXYcmdkeyexists@tmp{#1}% + \pgfkeysifdefined{/pgfplots/\pgfplotsassertXYcmdkeyexists@tmp/.@cmd}\relax{% + \pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% + }}% + {\makespaceexpandable\def\x{y}\edef\pgfplotsassertXYcmdkeyexists@tmp{#1}% + \pgfkeysifdefined{/pgfplots/\pgfplotsassertXYcmdkeyexists@tmp/.@cmd}\relax{% + \pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% + }}% +}% + +\def\pgfplotsshortstylekey #1=#2;{% + \pgfplotsassertcmdkeyexists{#1}% + \pgfplotsassertcmdkeyexists{#2}% + \begin{pgfplotskey}{#1=\marg{key-value-list}} + An abbreviation for \texttt{#2/.append style=}\marg{key-value-list}. + \end{pgfplotskey} +} +\def\pgfplotsshortxystylekey #1=#2;{% + \pgfplotsassertXYcmdkeyexists{#1}% + \pgfplotsassertXYcmdkeyexists{#2}% + \begin{pgfplotsxykey}{#1=\marg{key-value-list}} + An abbreviation for {\def\x{x}\texttt{#2/.append style=}}\marg{key-value-list} (or the respective style for $y$, {\def\x{y}\texttt{#2}}). + \end{pgfplotsxykey} +} +\def\pgfplotsshortstylekeys #1,#2=#3;{% + \pgfplotsassertcmdkeyexists{#1}% + \pgfplotsassertcmdkeyexists{#2}% + \pgfplotsassertcmdkeyexists{#3}% + \begin{pgfplotskeylist}{% + #1=\marg{key-value-list}, + #2=\marg{key-value-list}} + Different abbreviations for \texttt{#3/.append style=}\marg{key-value-list}. + \end{pgfplotskeylist} +} +\def\pgfplotsshortxystylekeys #1,#2=#3;{% + \pgfplotsassertXYcmdkeyexists{#1}% + \pgfplotsassertXYcmdkeyexists{#2}% + \pgfplotsassertXYcmdkeyexists{#3}% + \begin{pgfplotsxykeylist}{% + #1=\marg{key-value-list}, + #2=\marg{key-value-list}} + Different abbreviations for {\def\x{x}\texttt{#3/.append style=}}\marg{key-value-list} (or the respective style for $y$, {\def\x{y}\texttt{#3}}). + \end{pgfplotsxykeylist} +} + +\makeatother |