summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
blob: e9e4e3ea2232907e2bb74658531f66f19e374fce (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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
% knitexamples.tex
%
% Provides examples of usage of the knitting package
%
% author: Ariel Barton
%
% Copyright Ariel Barton, 2010
%
% The contents of the files knitkey.tex and knitexamples.tex
% may be copied and/or modified in other files without
% restriction or need for acknowledgement. 
%
% The work as a whole may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any
% later version.
% The latest version of the license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of
% LaTeX version 2003/06/01 or later.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The complete list of files considered part of this work is in
% the file `knitting-doc.pdf' and its source code `knitting-doc.tex'.
%
% Date: 2019/04/03
%
% Version: 3

\documentclass[draft]{article}

\usepackage[chartsonly]{knitting}

\usepackage{calc}

%\textwidth = 3in

\begin{document}

\knitgrid

\settowidth{\textwidth}{\begin{tabular}{|c|l|l|}
\textknit{>}&Knit 2 together&Purl 2 together\\
\end{tabular}}

\begin{smallpage}
\noindent\begin{tabular}{|c|l|l|}
\hline
& Right side & Wrong side\\\hline
\textknit{-}&Knit&Purl\\
\textknit{=}&Purl&Knit\\
\textknit{>}&Knit 2 together&Purl 2 together\\
\textknit{<}&Slip, slip, knit&Slip, slip, purl\\
\hline
\end{tabular}
\end{smallpage}

\ifchartsonly \else Odd-number ribbed braid \fi

\knitgrid
\rnevenonly

\chart[right]{
=--==\!==----==\!=
\-{14}
=--==\!==CCkk==\!=
=--==\!==----==\!=
=CCpp\!ggKKCCpp\!=
~~~\_\_~~~~~~\_\_~
===\!----====\!--=
===\!ccKK====\!--=
===\!----====\!--=
~~~\_\_~~~~~~\_\_~
=ggKK\!CCppggKK\!=
=--==\!==----==\!=
\-{14}
\vskip 0.5\knitlinewd
}
\rnnormal

\ifchartsonly \else Even-number ribbed braid \fi

\knitnogrid
\newdimen\knitlinewd
\setlength{\knitlinewd}{1.2pt} 
% Zigzagging lines will look better if we make them a little wider
\chart[oddleft]{
=--==\!==----==\!==--=
\-{18}
=--==\!==CCkk==\!==--=
=--==\!==----==\!==--=
=CCpp\!ggKKCCpp\!ggKK=
~~~\_\_~~~~~~\_\_~
===\!----====\!----===
===\!ccKK====\!ccKK===
===\!----====\!----===
~~~\_\_~~~~~~\_\_~
=ggKK\!CCppggKK\!CCpp=
=--==\!==----==\!==--=
\-{18}
\vskip 0.5\knitlinewd
}
\rnnormal

\ifchartsonly \else Twining leaves \fi

\knitnogrid
\definecolor{knitlinecolor}{rgb}{0,0,0.8}
\definecolor{rncolor}{rgb}{0,0,0.8}
\definecolor{rnarrowcolor}{rgb}{0,0,0.6}

\rnevenonly
\stitchcountchart[right]{
===,,,,,,===--===,,,,,,===
===,,,,,,===--==,,,\>3,,,===
===,,,,,,===--==,,---,,===
===,,,,,,===--==,,>-<,,===
===,,,,,,===--==,-----,===
===,,,,,,===--==,>---<,===
===,,,,,,===--==-------===
===,,,,,,===--==--O-O--===
===,,,,,,===--==,-----,===
\overline{===,,,\>3,,,==--==,-O-O-,===}
===,,---,,==--==,,---,,===
===,,>-<,,==--==,,O-O,,===
===,-----,==--==-,,,,,,===
===,>---<,==--=pK,,,,,,===
===-------==--=-=,,,,,,===
===--O-O--==--pK=,,,,,,===
===,-----,==---==,,,,,,===
===,-O-O-,==-kK=,,,\>3,,,===
===,,---,,==--==,,---,,===
===,,O-O,,==--==,,>-<,,===
===,,,,,,-==--==,-----,===
===,,,,,,Kp=--==,>---<,===
===,,,,,,=-=--==-------===
===,,,,,,=Kp--==--O-O--===
===,,,,,,==---==,-----,===
\overline{%
===,,,,,,==Kk-==,-O-O-,===}
===,,,,,,===--==,,---,,===
===,,,,,,===--==,,O-O,,===
===,,,,,,===--==-,,,,,,===
===,,,,,,===--=pK,,,,,,===
===,,,,,,===--=-=,,,,,,===
===,,,,,,===--pK=,,,,,,===
===,,,,,,===---==,,,,,,===
===,,,,,,===-kK==,,,,,,===
===,,,,,,===--===,,,,,,===
}
\rnnormal

\definecolor{knitlinecolor}{rgb}{0.7,0,0}
\definecolor{rncolor}{rgb}{0.6,0,0}
\definecolor{rnarrowcolor}{rgb}{0.45,0,0}

\ifchartsonly \else Print o' the Wave \fi

\knitgrid

\resetrnfalse
\setcounter{rownumber}{99}
\setcounter{rownumberskip}{2}

\chart[right]{
<O<O-----O))><((O<O----
-<O<O---O))>--<((O<O---
--<O<O-O))>----<((O<O--
----O>O))><((O-----O>O>
---O>O))>--<((O---O>O>-
--O>O))>----<((O-O>O>--
<O<O-----O))><((O<O----
-<O<O---O))>--<((O<O---
--<O<O-O))>----<((O<O--
----O>O))><((O-----O>O>
---O>O))>--<((O---O>O>-
--O>O))>----<((O-O>O>--
~~~\numberrow{20}{5}{1}
}

\resetrntrue
\setcounter{rownumberskip}{1}


\ifchartsonly \else Colorwork \fi

\knitwide

\definecolor{green}{rgb}{0,0.6,0.1}
\definecolor{lightgreen}{rgb}{0.5,1,0.5}
\definecolor{yellow}{rgb}{1,1,0.35}


% Enclosing the \catcode `\^=\active and the chart in braces
% means that ^ will go back to its usual math meaning after the chart
{
	%We turn ^ into an active character
	\catcode `\^=\active
	% And then we can define it like a command
	\renewcommand{^}{\noindent{\purlpass{\color{lightgreen}}\purlbackground{-}}}

	\chart[right]{
	\purlpass{\color{blue}} 
	% = produces blue
	-|--------------|
	-|=--=--=--=--=-|
	=|--=--=-=--=--=|
	^|^=^^=^^^=^^=^^|
	^|=^^=^^=^^=^^=^|
	\purlpass{\color{green}} 
	% = produces green
	=|^^=^^=^=^^=^^=|
	^|^=^^=^^^=^^=^^|
	\renewcommand{^}{\noindent{\purlpass{\color{yellow}}\purlbackground{-}}} 
	% ^ produces yellow
	^|=^^=^^=^^=^^=^|
	=|^^=^^=^=^^=^^=|
	^|=^^=^^=^^=^^=^|
	\renewcommand{^}{\noindent{\purlpass{\color{lightgreen}}\purlbackground{-}}}
	% ^ produces light green
	^|^=^^=^^^=^^=^^|
	=|^^=^^=^=^^=^^=|
	\purlpass{\color{blue}} 
	% = produces blue
	^|=^^=^^=^^=^^=^|
	^|^=^^=^^^=^^=^^|
	=|--=--=-=--=--=|
	-|=--=--=--=--=-|
	-|--------------|
	}
}

\ifchartsonly \else Repeats \fi

\renewcommand{\printrightrownumber}[1]{%
	\knitleftarrowhead
	\textnormal{\color{rncolor}%
	#1 (\thestitchcountout\ sts)}}

\newcommand\threepartrow[3]{%
	% Count the stitches, counting the middle stitches 4 times
	\mainpass{\countstitches{#1 #2#2#2#2 #3}}%
	% Print the row
	#1\|#2\|#3
	% Print a bar if we have a stitch count mismatch
	\mainpass{\stitchcountwarningbar}}
	
\knitgrid
\resetrnfalse
\setcounter{rownumber}{12}
\setcounter{rownumberskip}{2}

% Setting stitchcountin to any number less than -99 suppresses the
% warning bar on the first row.
\setcounter{stitchcountin}{-100}

\chart[right]{
    ~~~~~~~~\hskip\knitlinewd %
    \mainpass{\makebox[18\stitchwd][c]{\color{rncolor}\textnormal{%
    	Repeat 4 times}}} \nonumber ``
    % The `` is necessary for proper vertical alignment
	\threepartrow{-O------}{..-----OAO-----..-}{-----O-}
	~\threepartrow{-O-----}{..----O>-<O----..-}{----O-}
	~~\threepartrow{-O----}{..<--O>OAO<O-->..-}{---O-}
	~~~\threepartrow{-O---}{.<--O>O>-<O<O-->.-}{--O-}
	~~~~\threepartrow{-O--}{<--O>O>---<O<O-->-}{-O-}
	~~~~~\threepartrow{-O-}{..------\narrowincrease{7}------..-}{O-}
	}
	
\end{document}