summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgfplots/test/liststructuretest/liststructuretest.tex
blob: 408b6d4cfb67f65e7322e28c294ed391bf8309c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
\documentclass[a4paper]{article}
\usepackage{german}
\usepackage[utf8]{inputenc} % erlaubt direkte Nutzung von Umlauten

% \usepackage[a4paper,noheadfoot,pdftex,left=0.8cm,right=1cm,top=0.8cm,bottom=0.8cm]{geometry}
% \usepackage{color}
% \usepackage{colortbl}
% \usepackage{longtable}
% \usepackage[a4paper,colorlinks=true]{hyperref} % Querverweise etc. option pdftex,dvipdfm?
% \usepackage{graphicx}
% \usepackage[draft]{graphicx}
% \usepackage{listings} % fuer codefragmente jeder art
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
% \usepackage{amsthm}
\usepackage{bibgerm}
%\usepackage{simplelist}

\usepackage{pgf}
\makeatletter
\input pgfplotsliststructure.code.tex
\input pgfplotsarray.code.tex
\makeatother

% fuer endvironment 'sidewaysfigure' bspw
% \usepackage{rotating}

%\pdfinfo {
%	/Author	(Christian Feuersaenger)
%}

%%
% My user defined commands ...
%
\usepackage{mymath}
\usepackage{myext}

% von Alex: A4-Groesse, symmetrische Seitenraender.
% \usepackage{mya4sym}


% figure einstellungen:
%\renewcommand{\topfraction}{0.85}
%\renewcommand{\textfraction}{0.06}
%\renewcommand{\floatpagefraction}{0.8}

\def\testfile#1{\chapter{#1}}
\def\testsection#1{\message{STARTING TEST SECTION '#1'}\section{#1}}
\def\testsubsection#1{\message{STARTING TEST SUBSECTION '#1'}\subsection{#1}}
\def\testsubsubsection#1{\message{STARTING TEST SUBSUBSECTION '#1'}\subsubsection{#1}}


\author{Christian Feuersänger}
%\title{}

\begin{document}
%\maketitle
\testsection{pgfplotslist test}
\message{pgfplotslist test}%
{
\tracingcommands=2
\tracingmacros=2
\pgfplotslistnewempty\probe
\pgfplotslistpushback eins\to\probe
\pgfplotslistpushback [probe]\to\probe
\pgfplotslistpushback [probe2]\to\probe
\pgfplotslistpushback [probe3]\to\probe

Size: \pgfplotslistsize\probe\to{\count0}\the\count0

Contents:

\pgfplotslistforeach\probe\as\curlistelem{\curlistelem \par}

\pgfplotslistnew\foolist{Eins\\Zwei\\Drei\\}%
\pgfplotslistforeach\foolist\as\foo{Element \foo\par}%

\testsubsection{select}
\count1=1
Element \the\count1: \pgfplotslistselect\count1\of\probe\to\elem\elem

Element 3: \pgfplotslistselect3\of\probe\to\elem\elem

count1 is now=\the\count1
\vskip1cm

\testsubsection{listpopfront}
\pgfplotslistpopfront\probe\to\first
first:  \first

remaining size: \pgfplotslistsize\probe\to{\count0}\the\count0

\pgfplotslistpopfront\probe\to\first
first: \first

remaining size: \pgfplotslistsize\probe\to{\count0}\the\count0


\testsubsection{list concat}
new list:
\pgfplotslistnew\foolist{First Element\\Second Element\\Third Element\\}
\pgfplotslistnew\foolistX{Eins\\Zwei\\}

Contents:
\pgfplotslistforeach\foolist\as\curlistelem{\curlistelem \par}

\pgfplotslistconcat\third=\foolist&\foolistX

Result of concat:
\pgfplotslistforeach\third\as\curlistelem{\curlistelem \par}
}

\section{pgfplotsarray test}
\message{pgfplotsarray test}
{
\tracingcommands=2
\tracingmacros=2

\pgfplotsarraynewempty\probe
\pgfplotsarraypushback eins\to\probe
\pgfplotsarraypushback [probe]\to\probe
\pgfplotsarraypushback [probe2]\to\probe
\pgfplotsarraypushback [probe3]\to\probe

Size: `\pgfplotsarraysize\probe\to{\count0}\the\count0'

Content:

\pgfplotsarrayforeach\probe\as\curarrayelem{\curarrayelem \par}

\testsubsection{Select}
Test list:

\pgfplotsarraynew\fooarray{Eins\\Zwei\\Drei\\}%
\pgfplotsarrayforeach\fooarray\as\foo{Element \foo\par}%

Getting elements:

\count1=1
Element \the\count1: \pgfplotsarrayselect\count1\of\fooarray\to\elem\elem

Element 2: \pgfplotsarrayselect2\of\fooarray\to\elem\elem

\vskip1cm


\testsubsection{Copy}

Copy:
\pgfplotsarraynew\fooarray{Eins\\Zwei\\Drei\\}%
Source: \pgfplotsarrayforeach\fooarray\as\foo{Element \foo\par}%

\pgfplotsarraycopy\fooarray\to\fooarrayX

Copy:   \pgfplotsarrayforeach\fooarrayX\as\foo{Element \foo\par}%
}


\bibliographystyle{gerabbrv} %gerapali} %gerabbrv} %gerunsrt.bst} %gerabbrv}% gerplain}
% \bibliography{literatur.bib}
\end{document}