summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/knitting
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-07 00:38:17 +0000
committerKarl Berry <karl@freefriends.org>2010-09-07 00:38:17 +0000
commit50f3494b12ada52be9b302aa865453dcbbf5119c (patch)
tree3d1d31b4d3e4f92b3ac8a61e11730e789526ec3e /Master/texmf-dist/doc/fonts/knitting
parenta79aae44637de232d489b3396e917453d37746cd (diff)
knitting 2 (30aug10)
git-svn-id: svn://tug.org/texlive/trunk@19595 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/fonts/knitting')
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitexamples.tex85
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitkey.tex112
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdfbin314878 -> 424098 bytes
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex944
4 files changed, 808 insertions, 333 deletions
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex b/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
index 81c2d30fd2d..6b98fcfbae8 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
@@ -24,14 +24,17 @@
% 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: 2010/01/17
-
+% Date: 2010/08/29
+%
+% Version: 2
-\documentclass{article}
+\documentclass[draft]{article}
\usepackage[chartsonly]{knitting}
-\textwidth = 3in
+\usepackage{calc}
+
+%\textwidth = 3in
\begin{document}
@@ -79,12 +82,10 @@
\ifchartsonly \else Even-number ribbed braid \fi
\knitnogrid
-\rnevenonly
\newdimen\knitlinewd
\setlength{\knitlinewd}{1.2pt}
% Zigzagging lines will look better if we make them a little wider
-
-\chart[right]{
+\chart[oddleft]{
=--==\!==----==\!==--=
\-{18}
=--==\!==CCkk==\!==--=
@@ -106,10 +107,13 @@
\knitnogrid
\definecolor{knitlinecolor}{rgb}{0,0,0.8}
+\definecolor{rncolor}{rgb}{0,0,0.8}
+\definecolor{rnarrowcolor}{rgb}{0,0,0.6}
-\chart[evenright]{
+\rnevenonly
+\stitchcountchart[right]{
===,,,,,,===--===,,,,,,===
-===,,,,,,===--==,,,A,,,===
+===,,,,,,===--==,,,\>3,,,===
===,,,,,,===--==,,---,,===
===,,,,,,===--==,,>-<,,===
===,,,,,,===--==,-----,===
@@ -117,16 +121,15 @@
===,,,,,,===--==-------===
===,,,,,,===--==--O-O--===
===,,,,,,===--==,-----,===
-===,,,A,,,==--==,-O-O-,===
-\overline{%
-===,,---,,==--==,,---,,===}
+\overline{===,,,\>3,,,==--==,-O-O-,===}
+===,,---,,==--==,,---,,===
===,,>-<,,==--==,,O-O,,===
===,-----,==--==-,,,,,,===
===,>---<,==--=pK,,,,,,===
===-------==--=-=,,,,,,===
===--O-O--==--pK=,,,,,,===
===,-----,==---==,,,,,,===
-===,-O-O-,==-kK=,,,A,,,===
+===,-O-O-,==-kK=,,,\>3,,,===
===,,---,,==--==,,---,,===
===,,O-O,,==--==,,>-<,,===
===,,,,,,-==--==,-----,===
@@ -134,9 +137,9 @@
===,,,,,,=-=--==-------===
===,,,,,,=Kp--==--O-O--===
===,,,,,,==---==,-----,===
-===,,,,,,==Kk-==,-O-O-,===
\overline{%
-===,,,,,,===--==,,---,,===}
+===,,,,,,==Kk-==,-O-O-,===}
+===,,,,,,===--==,,---,,===
===,,,,,,===--==,,O-O,,===
===,,,,,,===--==-,,,,,,===
===,,,,,,===--=pK,,,,,,===
@@ -146,19 +149,11 @@
===,,,,,,===-kK==,,,,,,===
===,,,,,,===--===,,,,,,===
}
+\rnnormal
-\ifchartsonly \else The letter Z\fi
-
-\chart{
-,=========,
-=;+++++-==,
-======pK==,
-=====pK===,
-====pK====,
-===pK=====,
-==pK======,
-==s+++++O==
-==,=====,==}
+\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
@@ -195,7 +190,6 @@
\definecolor{green}{rgb}{0,0.6,0.1}
\definecolor{lightgreen}{rgb}{0.5,1,0.5}
\definecolor{yellow}{rgb}{1,1,0.35}
-\definecolor{knitlinecolor}{rgb}{0.8,0,0}
\catcode `\^=\active
% Since we aren't using math, we turn ^ into an active character
@@ -230,4 +224,39 @@
-|--------------|
}}
+\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}
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitkey.tex b/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
index 01da46a6aa3..046dbdd054e 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
@@ -25,16 +25,25 @@
% 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: 2010/01/17
+% Date: 2010/08/29
+%
+% Version: 2
\documentclass{article}
\usepackage{knitting}
+\usepackage[colorlinks]{hyperref}
% Choose your chart symbol font
\knitnogrid
\knitwide
\knitgrid
+% \ifdesigner lets me easily hide all my comments to the designer and
+% just write a stitch key.
+\newif \ifdesigner
+\designertrue
+% \designerfalse
+
% The commands to draw chart rows
% (I'm just not happy with {tabular})
@@ -43,6 +52,7 @@
\newlength{\doublecolwidth}
\newcommand{\setcolwidths}[1]{
\setlength{\symbolcolwidth}{#1}
+ \addtolength{\symbolcolwidth}{1pt}
\setlength{\doublecolwidth}{\textwidth}
\addtolength{\doublecolwidth}{-4\tabcolsep}
\addtolength{\doublecolwidth}{-1.2pt} % Width of 3 rules
@@ -74,11 +84,12 @@
\raisebox{1pt}{\strut}#2\raisebox{-1pt}{\strut}\end{minipage}%
\hfill\vrule
\par\nointerlineskip}
-
+
\begin{document}
\begin{fullpages}
+\ifdesigner
Any knitting chart should have a key. This file provides a key of
suggested definitions for most of the symbols. If you find it
convenient, you have permission to simply copy and paste the relevant
@@ -92,6 +103,10 @@ exact definition should vary from pattern to pattern.
\textknit{H}
\textknit{v}
\textknit{V}
+\textknit{6}
+\textknit{7}
+\textknit{8}
+\textknit{9}
\textknit{\narrowincrease{3}}
\textknit{\pnarrowincrease{3}}
\textknit{\wideincrease{3}}
@@ -106,11 +121,35 @@ exact definition should vary from pattern to pattern.
\textknit{\knitbox{etc.}{2}}
\end{quote}
+\definecolor{darkgrey}{gray}{0.3}
+
+The Craft Yarn Council of America suggests a \href{http://www.craftyarncouncil.com/chart_knit.html}{slightly different set of symbols}. In particular, they want to use
+\begin{itemize}
+\item \textknit{)} and \textknit{(} for single decreases (where I have \textknit{>} and \textknit{<})
+\item \textknit{v} and \textknit{6} for slipped stitches (where I have \textknit{s} and \textknit{\purlbackground{s}})
+\item Solid black dots \textknit{\knitbox{{$\bullet$}}{1}} for bobbles
+\item Solid dark squares \textknit{{\purlpass{\color{darkgrey}}\mainpass[=]{``}}} for no-stitch boxes
+\item
+\textknit{\rlap{\raisebox{-1pt}{\hskip1.3pt \footnotesize\textnormal{\textsf{3}}}}%
+\mainpass[(]{\hskip1pt\rule[-\stitchdp]{0pt}{\stitchht}\raisebox{1pt}[0pt][0pt]{(}\hskip-1pt}}
+and \textknit{\mainpass[)]{\hskip-1pt\rule[-\stitchdp]{0pt}{\stitchht}\raisebox{1pt}[0pt][0pt]{)}\hskip1pt}%
+\llap{\raisebox{-1pt}{\footnotesize\textnormal{\textsf{3}}\hskip1.3pt}}}
+for double decreases (and
+\textknit{\rlap{\raisebox{-1pt}{\hskip1.3pt \footnotesize\textnormal{\textsf{4}}}}%
+\mainpass[(]{\hskip1pt\rule[-\stitchdp]{0pt}{\stitchht}\raisebox{1pt}[0pt][0pt]{(}\hskip-1pt}}
+and \textknit{\mainpass[)]{\hskip-1pt\rule[-\stitchdp]{0pt}{\stitchht}\raisebox{1pt}[0pt][0pt]{)}\hskip1pt}%
+\llap{\raisebox{-1pt}{\footnotesize\textnormal{\textsf{4}}\hskip1.3pt}}}
+for triple decreases)
+\item \textknit{7}, \textknit{8}, and \textknit{9} instead of \textknit{y}, \textknit{u}, and \textknit{z}.
+\end{itemize}
+\textknit{{\purlpass{\color{darkgrey}}\mainpass[=]{``}}}
+is harder to get out of \TeX\ than the grid symbol {\knitgrid\textknit{,}} and is less clear than the nongrid symbol {\knitnogrid\textknit{,}}. The rest of my symbols are different because I think they are clearer, prettier, or allow for more different stitches to be indicated. (\textknit{v} looks like an increase to me, and the CYCA doesn't distinguish between \textknit{l} and \textknit{L}). \fi
+
\section{General symbols}
+\ifdesigner
If you do not use twisted make-1 increases (or if you use \textknit{m}
for them) you may wish to substitute \textknit{t} for \textknit{b}.
-
If you do use \textknit{t} or \textknit{x}, and you don't care about the
distinction between \textknit{b} and \textknit{q}, you may wish to
substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
@@ -119,23 +158,32 @@ substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
\medskip
+\fi
+
\settowidth{\dimen0}{\textknit{s} or \textknit{S}}
\setcolwidths{\dimen0} % The argument is the width of the widest thing in the left column
\keyrow{Symbol}{Right side instructions}{Wrong side instructions}
\keyrow{\textknit{-}}{Knit}{Purl}
\keyrow{\textknit{=}}{Purl}{Knit}
+\dblkeyrow{\textknit{\knitbox{12}{3}}}{Knit (RS) or purl (WS) the number of stitches listed in the center of the box.}
+\dblkeyrow{\textknit{\purlbox{12}{3}}}{Purl (RS) or knit (WS) the number of stitches listed in the center of the box.}
\keyrow{\textknit{)} or \textknit{(}}{Knit}{Purl}
\keyrow{\textknit{b}}{Knit through back loop}{Purl through back loop}
\keyrow{\textknit{B}}{Purl through back loop}{Knit through back loop}
\dblkeyrow{\textknit{q}}{Slip 1 as if to knit, return to right needle, and knit (RS) or purl (WS) through front loop. This twists the stitch, but in the opposite direction from \textknit{b}.}
\dblkeyrow{\textknit{Q}}{As for \textknit{q}, but this time purl on WS and knit on RS.}
\keyrow{\textknit{\bobble{3}}}
-{(Knit 1, yo, knit 1) in next stitch, turn, purl 3, turn, slip 1 knitwise, knit 1, pass slipped stitch over}
-{(Purl 1, yo, purl 1) in next stitch, turn, knit 3, turn, slip 1 purlwise, p2tog or ssp tbl, pass slipped stitch over}
+{(Knit 1, yarn over, knit 1) in next stitch, turn, purl 3, turn, slip 1 knitwise, knit 2 together, pass slipped stitch over}
+{(Purl 1, yarn over, purl 1) in next stitch, turn, knit 3, turn, purl 3 together or slip 1 purlwise, ssp tbl, pass slipped stitch over}
+
+\ifdesigner\hrule\medskip
+If you use bobbles, be sure to define ssp tbl somewhere.
+\clearpage\fi
+
\keyrow{\textknit{\bobble{5}}}
-{(Knit 1, yo, knit 1, yo, knit 1) in next stitch, turn, purl 5, turn, knit 5, turn, purl 5, turn, quadruple decrease}
-{(Purl 1, yo, purl 1, yo, purl 1) in next stitch, turn, knit 5, turn, purl 5, turn, knit 5, turn, quadruple decrease}
+{(Knit 1, yarn over, knit 1, yarn over, knit 1) in next stitch. Turn, purl 5, turn, knit 5, turn, purl 5, turn. Quadruple decrease: slip 2 as if to knit, knit 3 together, pass slipped sts over}
+{(Purl 1, yarn over, purl 1, yarn over, purl 1) in next stitch. Turn, knit 5, turn, purl 5, turn, knit 5, turn. Quadruple decrease: purl 5 together or slip 2 as if to purl, sssp tbl, pass 2 slipped sts over}
\dblkeyrow{\textknit{s} or \textknit{S}}{Slip one as if to purl with yarn held to the wrong side.}
\dblkeyrow{\textknit{\purlbackground{s}} or \textknit{\purlbackground{S}}}
{Slip one as if to purl with yarn held to the right side.}
@@ -144,7 +192,7 @@ substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
\dblkeyrow{\textknit{"} or \textknit{""}}{Wrap and turn: Move yarn between needles to right side of work, slip 1 stitch as if to purl, move yarn to wrong side of work (wrapping it around the slipped stitch), slip stitch back to the left needle, and turn work.}
\ifgrid\dblkeyrow{\textknit{,} or \textknit{.}}{No stitch; ignore these squares} \fi
\dblkeyrow{\textknit{@}}{Beaded stitch}
-\dblkeyrow{\textknit{h}}{Drop next stitch from needle}
+\dblkeyrow{\textknit{h}}{Drop stitch from needle}
\keyrow{\textknit{\gridpass[``*``]{\knitbox{}{3}}}}{Purl 3 together but do not remove from left needle. Knit same 3 stitches together. Then purl same 3 stitches together and remove from left needle.}{Knit 3 together but do not remove from left needle. Purl same 3 stitches together. Then knit same 3 stitches together and remove from left needle.}
\hrule
@@ -167,6 +215,8 @@ substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
\medskip
+\ifdesigner
+
A horizontal cable should (usually) be preceded by a yarn over and followed by a decrease. You may wish to write the yarn over or decrease as part of the instructions for a horizontal cable:
\medskip
@@ -175,18 +225,26 @@ A horizontal cable should (usually) be preceded by a yarn over and followed by a
{\knitgrid
\keyrow{\textknit{\char21}}
-{Yarn over. Slip 1 as to knit. Insert left needle through last 2 stitches on right needle from right to left and remove right needle. Slip 1 as if to purl.}
-{Yarn over. Slip 1 from right needle to left needle. Slip 2 as if to knit 2 together. Slip 1 from right needle back to left needle.}
+{Yarn over. Slip 1 as to knit. Insert left needle through last 2 stitches on right needle from right to left and remove right needle. Slip 1 as if to purl.}{Purl 2 together}
\keyrow{\textknit{\char20}}
{Knit 1. Slip 1 as to knit. Insert left needle through last 2 stitches on right needle from right to left and remove right needle. Slip 1 as if to purl.}
{Purl 1. Slip 1 from right needle to left needle. Slip 2 as if to knit 2 together. Slip 1 from right needle back to left needle.}
-\keyrow{\textknit{+}}{SSK or SKP}{Purl 2 together}}
+\keyrow{\textknit{+}}{SSK or SKP}{Yarn over. Slip 1 from right needle to left needle. Slip 2 as if to knit 2 together. Slip 1 from right needle back to left needle.}
+}
\hrule
+\fi
+
\clearpage
\section{Increases}
+\ifdesigner Some charts work better if a double increase \textknit{W} takes up three squares instead of one. In the grid font, the best-looking way to do this is to use \verb|\mainpass|: {\verb|\mainpass[\purlbox{}{3}]{``W``}| \knitgrid \textknit{\mainpass[\purlbox{}{3}]{``W``}}}.
+
+\medskip
+
+\fi
+
\setcolwidths{\stitchwd}
\dblkeyrow{\textknit{O}}{Yarn over}
\dblkeyrow{\textknit{U}}{Cast on}
@@ -216,6 +274,7 @@ A horizontal cable should (usually) be preceded by a yarn over and followed by a
\section{Decreases}
+\ifdesigner
Purl decreases produce strong diagonal lines on the wrong side. You
may wish to use \textknit{;} for p2tog and \textknit{:} for SSP tbl if
you wish to clearly indicate which way these diagonal lines slant.
@@ -225,6 +284,7 @@ You may also think that \textknit{4} and \textknit{5} look better in your patter
\nopagebreak
\medskip
+\fi
\setcolwidths{\stitchwd}
\keyrow{\textknit{>}}{Knit 2 together}{Purl 2 together or slip 1, purl 1, pass slipped stitch over}
@@ -258,11 +318,15 @@ first stitch, return first stitch on right needle to left needle.* Repeat from *
\section{Cable Symbols}
+\ifdesigner
+
This is a comprehensive list of the cable symbols available in the grid
-fonts; more non-grid cable symbols are possible.
+fonts; more non-grid cable symbols are possible. (A few examples are at the end of this document.
\medskip
+\fi
+
% There are three different symbols for most of the cable crossings,
% and two different symbols for most of the twist crossings.
@@ -285,8 +349,8 @@ fonts; more non-grid cable symbols are possible.
\setcolwidths{8.5\stitchwd}
\dblkeyrow{\cableset{kK}{kN}{kD}}{Slip 2 as if to knit 2 together. Return to left needle, then knit 2 (RS) or purl 2 (WS), (\textbf{not} together!) through back loop.}
\dblkeyrow{\cableset{Kk}{Kn}{Kd}}{Slip 2 as if to SSK. Insert left needle through both slipped stitches from right to left, as if to k2tog. Remove right needle, then knit 2 (RS) or purl 2 (WS) through front loop.}
-\dblkeyrow{\twistset{pK}{pN}}{Slip 2 as if to knit 2 together. Return to left needle, then knit 1 through back loop, purl 1 through back loop.}
-\dblkeyrow{\twistset{Kp}{Ko}}{Slip 2 as if to SSK. Insert left needle through both slipped stitches from right to left, as if to k2tog. Remove right needle, then purl 1, knit 1.}
+\dblkeyrow{\twistset{pK}{pN}}{Slip 2 as if to knit 2 together. Return to left needle, then knit 1 through back loop, purl 1 through back loop. Or: Slip 1 to cable neeble and hold in back; knit 1; purl 1 from cable needle.}
+\dblkeyrow{\twistset{Kp}{Ko}}{Slip 2 as if to SSK. Insert left needle through both slipped stitches from right to left, as if to k2tog. Remove right needle, then purl 1, knit 1. Or: Slip 1 to cable neeble and hold in front; knit 1; purl 1 from cable needle.}
\dblkeyrow{\textknit{pP}}{Slip 2 as if to knit 2 together. Return to left needle, then purl 2 (RS) or knit 2 (WS) through back loop.}
\dblkeyrow{\textknit{Pp}}{Slip 2 as if to SSK. Insert left needle through both slipped stitches from right to left, as if to k2tog. Remove right needle, then purl 2 (RS) or knit 2 (WS) through front loop.}
%
@@ -330,6 +394,7 @@ fonts; more non-grid cable symbols are possible.
\keyrow{\twistset{KKKpp}{KKKpo}}{{Slip 3 to cable needle and hold in front; purl 2; knit 3 from cable needle}}{{Slip 2 to cable needle and hold in front; purl 3; knit 2 from cable needle}}
\keyrow{\textknit{ppPPP}}{{Slip 2 to cable needle and hold in back; purl 3; purl 2 from cable needle}}{{Slip 3 to cable needle and hold in back; knit 2; knit 3 from cable needle}}
\keyrow{\textknit{PPPpp}}{{Slip 3 to cable needle and hold in front; purl 2; knit 3 from cable needle}}{{Slip 2 to cable needle and hold in front; knit 3; knit 2 from cable needle}}
+%
\hrule
\clearpage
@@ -349,12 +414,14 @@ fonts; more non-grid cable symbols are possible.
\keyrow{\textknit{pppPP}}{{Slip 3 to cable needle and hold in back; purl 2; purl 3 from cable needle}}{{Slip 2 to cable needle and hold in back; knit 3; knit 2 from cable needle}}
\keyrow{\textknit{PPppp}}{{Slip 2 to cable needle and hold in front; purl 3; knit 2 from cable needle}}{{Slip 3 to cable needle and hold in front; knit 2; knit 3 from cable needle}}
%
+\ifdim \stitchwd > \stitchht \else
\keyrow{\cableset{kkkKKK}{kkkKKN}{kkkKKD}}{{Slip 3 to cable needle and hold in back; knit 3; knit 3 from cable needle}}{{Slip 3 to cable needle and hold in back; purl 3; purl 3 from cable needle}}
\keyrow{\cableset{KKKkkk}{KKKkkn}{KKKkkd}}{{Slip 3 to cable needle and hold in front; knit 3; knit 3 from cable needle}}{{Slip 3 to cable needle and hold in front; purl 3; purl 3 from cable needle}}
\dblkeyrow{\twistset{pppKKK}{pppKKN}}{Slip 3 to cable needle and hold in back; knit 3; purl 3 from cable needle}
\dblkeyrow{\twistset{KKKppp}{KKKppo}}{Slip 3 to cable needle and hold in front; purl 3; knit 3 from cable needle}
\keyrow{\textknit{pppPPP}}{{Slip 3 to cable needle and hold in back; purl 3; purl 3 from cable needle}}{{Slip 3 to cable needle and hold in back; knit 3; knit 3 from cable needle}}
\keyrow{\textknit{PPPppp}}{{Slip 3 to cable needle and hold in front; purl 3; purl 3 from cable needle}}{{Slip 3 to cable needle and hold in front; knit 3; knit 3 from cable needle}}
+\fi
\hrule
\clearpage
@@ -383,6 +450,7 @@ Knit 2, purl 1 from the second (back) CN, then knit 2 from the first (front) CN.
\emph{Better-looking method}:
Slip 3 to CN and hold to front. Purl 2. Slip leftmost stitch from CN back to left needle and move CN to the back.
Knit 1 from left needle, then purl 2 from CN.}
+\ifdim \stitchwd > \stitchht \else
\keyrow{\cablepair{KKppkk}{KKppkd}}
{\emph{Easy method}: Slip 2 to cable needle and hold in front, knit 2, purl 2, and then knit 2 from cable needle. \par
\emph{Better-looking method}:
@@ -393,6 +461,7 @@ Knit 2, purl 2 from the second (back) CN, then knit 2 from the first (front) CN.
\emph{Better-looking method}:
Slip 4 to CN and hold to front. Purl 2. Slip leftmost 2 stitches from CN back to left needle and move CN to the back.
Knit 2 from left needle, then purl 2 from CN.}
+\fi
\keyrow{\cablepair{kpK}{kpD}}
{\emph{Easy method}: Slip 2 to CN and hold in back, knit 1, then purl 1, knit 1 from CN. \par
\emph{Better-looking method}: Slip 2 to CN and hold in back, knit 1.
@@ -412,7 +481,8 @@ Purl 1 from left needle, then knit 2 from CN.}
{\emph{Easy method}: Slip 2 to CN and hold in back, purl 2, knit 1, then purl 2 from CN. \par
\emph{Better-looking method}: Slip 2 to CN and hold in back. Slip 1 to a second CN and hold in front.
Purl 2 from left needle, knit 1 from second (front) CN, then purl 2 from first (back) CN.}
-\keyrow{\cablepair{kkpp}{kkppKD}}
+\ifdim \stitchwd > \stitchht \else
+\keyrow{\cablepair{kkppKK}{kkppKD}}
{\emph{Easy method}: Slip 4 to CN and hold in back, knit 2, then purl 2, knit 2 from CN. \par
\emph{Better-looking method}:
Slip 4 to CN and hold in back, knit 2.
@@ -421,6 +491,18 @@ Purl 2 from left needle, then knit 2 from CN.}
{\emph{Easy method}: Slip 2 to CN and hold in back, purl 2, knit 2, then purl 2 from CN. \par
\emph{Better-looking method}: Slip 2 to CN and hold in back. Slip 2 to a second CN and hold in front.
Purl 2 from left needle, knit 2 from second (front) CN, then purl 2 from first (back) CN.}
+\fi
+\hrule
+
+\clearpage
+
+\knitnogrid
+
+\keyrow{\textknit{peKK}}{{Slip 1 to cable needle and hold in back; knit 2; make 1 purlwise (by picking up any strand of yarn which is convenient); purl 1 from cable needle}}{{Slip 2 to cable needle and hold in back; knit 1; make 1 knitwise; purl 2 from cable needle}}
+
+\keyrow{\textknit{pkKK}}{{Slip 2 to cable needle and hold in back; knit 2; knit 1 from cable needle, purl 1 from cable needle}}{{Slip 2 to cable needle and hold in back; knit 1; purl 1; purl 2 from cable needle}}
+\keyrow{\textknit{kpKK}}{{Slip 2 to cable needle and hold in back; knit 2; purl 1 from cable needle, knit 1 from cable needle}}{{Slip 2 to cable needle and hold in back; purl 1; knit 1; purl 2 from cable needle}}
+
\hrule
\end{fullpages}
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf
index 8c593980bc3..f8d154687dd 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf
+++ b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex
index e5095ae5652..bf6d09ab5bc 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex
@@ -20,9 +20,13 @@
% The complete list of files considered part of this work is in
% the file `knitting-doc.pdf' and later in this file.
%
-% Date: 2010/01/17
+% Date: 2010/08/29
+%
+% Version: 2
-\documentclass{amsart}
+\documentclass[draft]{amsart}
+% Do not remove the [draft] option; we need it to explain something
+% in Section 5.
\usepackage{knitting}
@@ -34,12 +38,15 @@
\usepackage{color,verbatim}
\hyphenation{auto-number-chart}
-\usepackage[draft=false]{hyperref}
+\usepackage[draft=false,pdfborder={0 0 0}]{hyperref}
\title{The \textsf{knitting} package}
\author{Ariel Barton}
+\renewcommand\sectionautorefname{Section}
+\renewcommand\subsectionautorefname{Section}
+
\begin{document}
\maketitle
@@ -85,7 +92,7 @@ later sections of this document.
\section{License}
This work (the \textsf{knitting} package) consists of all files listed
-in Section~\ref{se:manifest}. It is copyright Ariel Barton, 2010.
+in \autoref{se:manifest}. It is copyright Ariel Barton, 2010.
This work may be distributed and/or modified under the
conditions of the \LaTeX\ Project Public License, either
@@ -103,7 +110,7 @@ This work has the LPPL maintenance status ``author-maintained''.
The \LaTeX\ project license above gives the conditions under which you
may redistribute or modify the fonts and files listed in
-Section~\ref{se:manifest}. This license (loosely speaking) allows you to
+\autoref{se:manifest}. This license (loosely speaking) allows you to
pass around copies of the package provided you redistribute it in its
entirety. In addition, any part, no matter how large, of the files
\texttt{knitkey.tex} and \texttt{knitexamples.tex}, \emph{and these two
@@ -188,10 +195,11 @@ or the lines
\verb|\pdfmapline{+knitgg\space <knitgg.pfb}|\\
\verb|\pdfmapline{+knitwg\space <knitwg.pfb}|
\end{quote}
-These map lines can go in \texttt{t1knit.fd},
+These map lines can go in \texttt{uknit.fd},
\texttt{knitting.sty}, or the file that uses the package.
-%You may need to downoad the file \texttt{T1-WGL4.enc}. I got this file from
+%You may need to downoad the file \texttt{T1-WGL4.enc}. I got this file
+% from
%\begin{quote}\raggedright
%\href{http://ctan.binkerton.com/info/german/MiKTeX-WinEdt-TrueType-Anleitung/T1-WGL4.enc}
%{\texttt{http://ctan.binkerton.com/info/german/MiKTeX-WinEdt-\allowbreak TrueType-Anleitung\slash T1-WGL4.enc}}
@@ -217,6 +225,8 @@ With MiK\TeX, I need to say
\texttt{initexmf -{}-edit-config-file updmap}
and then add the line \texttt{Map knitfont.map} to the file which opens, then run \texttt{updmap} from the command line.
+Something similar should work with most distributions; it is always wise to check and see what your distribution's documentation says about \texttt{updmap} before using it.
+
\section{Using the package}
In your document, type \verb|\usepackage{knitting}| (\LaTeX) or \verb|\input knitting| (plain \TeX). This will define the following macros:
@@ -229,12 +239,14 @@ In your document, type \verb|\usepackage{knitting}| (\LaTeX) or \verb|\input kni
\end{itemize}
-Inside a chart, you mostly just type letters and punctuation, and \textsf{knitting} converts them to appropriate knitting symbols. See Section~\ref{se:normal} for a translation key.
+Inside a chart, you mostly just type letters and punctuation, and \textsf{knitting} converts them to appropriate knitting symbols. See \autoref{se:normal} for a translation key.
However, there are commands that change overall appearance of the charts, or produce fancier symbols. Many of these commands (indicated with $\star$s and not bullets) only work inside of a knitting chart, to avoid conflicts: \verb|\overline|, for example, already has a meaning $\overline{xy}$ in math mode.
These redefined commands do \emph{not} work in concert with \verb|\textknit|.
+\subsection{Commands affecting overall appearance}
+
\begin{itemize}
\item \verb|\knitgrid|, \verb|\knitnogrid|, \verb|\knitwide|. These macros let you switch which font you're using: the normal grid font, the normal nogrid font, or the grid font with rectangular (wide) grid cells. These commands should be used outside the chart they are to affect.
@@ -243,9 +255,9 @@ These redefined commands do \emph{not} work in concert with \verb|\textknit|.
In plain \TeX, use the command \verb|\changeknitsize|, which takes one argument (the desired size). After \verb|\changeknitsize{10pt}| (the default size), five lines of a knitting chart will take up as much vertical space as five lines of 10-point text. This means that chart cells are 12 (not 10) points tall.
-\item The package option \verb|[chartsonly]| (\LaTeX) or the command \verb|\chartsonly| (plain \TeX) causes charts to be typeset in small PDF files which can be easily included in other documents, or converted to image files for use on a webpage.
+\item The package option \verb|chartsonly| (\LaTeX) or the command \verb|\chartsonly| (plain \TeX) causes charts to be typeset in small PDF files which can be easily included in other documents, or converted to image files for use on a webpage.
-If you would also like to bundle your chart key into a little PDF, you can do it with the environment \verb|{smallpage}| (\LaTeX) or \verb|\smallpage| and \verb|\endsmallpage| (plain \TeX).
+If you would also like to bundle your chart key into a little PDF, you can do it with the environment \verb|smallpage| (\LaTeX) or \verb|\smallpage| and \verb|\endsmallpage| (plain \TeX).
The charts will automatically be the right width. The pages you generate with \verb|smallpage| will be the natural width of their contents; this is usually \verb|\textwidth| (\LaTeX) or \verb|\hsize| (plain \TeX).
@@ -253,18 +265,90 @@ For some reason, \verb|smallpage| won't work if your small page only has one lin
This command doesn't work with dvi-\TeX; this is a pdf\/\TeX\ command only.
-\item \texttt{fullpages}. Changing page dimensions mid-document in \LaTeX\ is hard, but a knitting pattern writer might want several pages of instructions with classically large \LaTeX\ margins followed by several pages of charts with smaller margins. The environment \texttt{fullpages} does this. (Changing margins in plain \TeX\ is easy enough that \texttt{knitting.tex} has no special commands for it.)
+\item \texttt{fullpages}. Changing page dimensions mid-document in \LaTeX\ is hard, but a knitting pattern writer might want several pages of instructions with the usual large \LaTeX\ margins followed by several pages of charts with smaller margins. The environment \texttt{fullpages} does this. (Changing margins in plain \TeX\ is easy enough that \texttt{knitting.tex} has no special commands for it.)
+
+\end{itemize}
+
+\subsection{Counting stitches and rows}
+
+\begin{figure}
+\caption{Counting examples}\label{fig:countex}
+
+\advance\hsize 60pt
+\noindent \hskip -30pt
+\begin{minipage}[b]{3.2in}
+\obeylines
+\verb?\chart{?
+\verb? ======\rnright?
+\verb? \rnleft======\addtocounter{rownumber}{-1}?
+\verb? ======\rnright?
+\verb? \addtocounter{rownumber}{-5}}?
+\end{minipage}%
+\hfill
+\begin{minipage}[b]{1.33in}
+\knitnogrid
+\quad\verb|\knitnogrid|\\
+\chart{
+======\rnright
+\rnleft======\addtocounter{rownumber}{-1}
+======\rnright
+\addtocounter{rownumber}{-5}
+``\nonumber}
+\end{minipage}%
+\hfill
+\hfill
+\begin{minipage}[b]{1.33in}
+\knitgrid
+\qquad\verb|\knitgrid|\\
+\chart{
+ ======\rnright
+\rnleft======\addtocounter{rownumber}{-1}
+ ======\rnright
+\addtocounter{rownumber}{-5}
+``\nonumber}
+\end{minipage}
+\par\medskip\par
+\noindent \hskip -30pt
+\begin{minipage}[b]{3.2in}
+\obeylines
+\verb?\chart[right]{?
+\verb? ======?
+\verb? ====== \nonumber ?
+\verb? ======?
+\verb? ======?
+\verb? \numberrow{6}{2}{2}}?
+\end{minipage}%
+\hfill
+\begin{minipage}[b]{1.33in}
+\knitnogrid
+\hskip\stitchwd\chart[right]{
+======
+====== \nonumber
+======
+======
+\numberrow{6}{2}{2}
+}
+\end{minipage}%
+\hfill
+\hfill
+\begin{minipage}[b]{1.33in}
+\knitgrid
+\hskip\stitchwd\chart[right]{
+======
+====== \nonumber
+======
+======
+\numberrow{6}{2}{2}
+}
+\end{minipage}
+\end{figure}
-% Row number stuff
+\begin{itemize}
\item[$\star$] \verb|\rn| prints out the value of the counter
\verb|rownumber|, then decreases it by the value of the counter
-\texttt{rownumberskip}.\footnote{\texttt{\char`\\ rn} puts the number
-in a box of width \texttt{\char`\\ rownumberwd}. You can change the
-width by saying \texttt{\char`\\
-renewcommand\allowbreak\char`\{\char`\\
-rownumberwd\char`\}\char`\{1em\char`\}}.} For slightly better-looking
-results, use \verb|\rnleft| on the left edge and \verb|\rnright| on
+\texttt{rownumberskip}.
+For better results, use \verb|\rnleft| on the left edge and \verb|\rnright| on
the right edge.
If you want to skip a few row numbers, you can say
@@ -281,9 +365,9 @@ down from there.
This may be necessary if you have very long charts, since charts do not break across pages. (You may need to put a \verb|\par\nointerlineskip\par| between the pieces of charts.)
-\item \verb|\chart| has an optional first argument that places row numbers automatically. It should be one of the six words \texttt{left}, \texttt{right}, \texttt{oddleft}, \texttt{oddright}, \texttt{evenleft}, or \texttt{evenright}. This will automatically place numbers down the left edge, the right edge, or put the odd numbers on one side and the even numbers on the other side.
+\item \verb|\chart| has an optional first argument that places row numbers automatically. It should be one of the seven words \texttt{left}, \texttt{right}, \texttt{oddleft}, \texttt{oddright}, \texttt{evenleft}, \texttt{evenright}, or \texttt{both}. This will automatically place numbers down the left edge, the right edge, or put the odd numbers on one side and the even numbers on the other side.
-If you want to show only even or only odd numbers, you can do it with the commands \verb|\rnoddonly| or \verb|\rnevenonly|, and can restore normal behavior with the command \verb|\rnnormal|.
+If you want to show only even or only odd numbers, you can do it with the commands \verb|\rnoddonly| or \verb|\rnevenonly|, and can restore normal behavior with the command \verb|\rnnormal|. Alternatively, you can redefine \verb|\printrightrownumber| to only print if the counter \texttt{rownumber} is odd; effects like this are why the \texttt{[both]} option exists.
I suggest using \verb|\setcounter{rownumberskip}{2}| \verb|\chart[right]| for charts which show only right-side rows. For charts which show all rows, I suggest using \verb|[right]| for charts which are meant to be worked in the round, \verb|[oddright]| or \verb|[oddleft]| for charts which are meant to be worked flat (back and forth), and \verb|\rnevenonly| or \verb|\rnoddonly| with \verb|[right]| for charts which may be used either flat or in the round.
@@ -293,268 +377,273 @@ I suggest using \verb|\setcounter{rownumberskip}{2}| \verb|\chart[right]| for ch
\item[$\star$] If you don't like any of my automatic countdown options, you can use \verb|\rnbox{8}|, \verb|\rnboxleft{12}|, \verb|\rnboxright{3}| to do your own row-number boxes.
-% Colored stuff: purl background, knit lines
+\item Two commands exist to let you get \TeX\ to count stitches for you: \texttt{\char`\\stitch\-count\-chart} and \verb|\countstitches|. The command \texttt{\char`\\ adjust\-stitch\-count} is also useful here. See \autoref{se:counting} for more details.
-\item \verb|\purlbackground|. I use a gray background to indicate simple purls, and also the purl version of more complicated stitches: \textknit{<} for slip, slip, knit, and \textknit{;} for purl 2 together. You can get \textknit{3} instead of \textknit{A} by typing~\texttt{3} instead of~\texttt{A}, but I didn't have space to provide a purl version of every symbol; so the only way to get \textknit{\purlbackground{r}} is with \verb|\purlbackground{r}|.
+\end{itemize}
-\item[$\star$] \verb|\overline| and \verb|\underline| take one argument and typeset it, then put a colored bar over or under it. This is designed to provide a way to outline pattern repeats.
+You can adjust the appearance of the row numbers in a few ways. \texttt{\char`\\ rn} puts the number
+in a box of width \texttt{\char`\\ rownumberwd}; you can change the
+width by saying
+\texttt{\char`\\renewcommand\allowbreak
+ \char`\{\char`\\rownumberwd\char`\}\char`\{1em\char`\}}.
+You can change the appearance of the rownumbers by renewing the commands \texttt{\char`\\ printrownumber}, \texttt{\char`\\ printleftrownumber} and \texttt{\char`\\ printrightrownumber}; the default values (in \LaTeX) are
+\begin{quote}
+\verb|{{\color{rncolor}\textnormal{#1}}}|,\\
+\verb|{\knitleftarrowhead{\color{rncolor}\textnormal{#1}}}| and\\
+\verb|{{\color{rncolor}\textnormal{#1}}\knitrightarrowhead}|.
+\end{quote}
-\item[$\star$] The character \texttt{|} and the command \verb?\|? produce a vertical line suitable for outlining pattern repeats.
+\verb|\printrownumber| controls the appearance of both \verb|\rn| and \verb|\rnbox|. You can also change the appearance of \verb|\rn|, but not \verb|\rnbox|, by redefining \verb|\therownumber|. \verb|\roman{rownumber}| (\LaTeX) or \verb|\romannumeral| \verb|\rownumber| (plain \TeX), for example, will number rows with Roman numerals.
-\item[$\star$] Occasionally, you may need to outline a pattern repeat with lines that bend.
+\subsection{Repeat outlines}
-The command \verb?\!? produces a vertical line which will overlap the adjacent cells to avoid disrupting the alignment of columns. You can get short horizontal lines to go with \verb?\!? by using \verb|\_|; it should be positioned using tildes~\texttt{\char`\~}.
+\begin{figure}
+\caption{Outline examples}\label{fig:outlineex}
-If you want to use short horizontal lines with just \verb?|?, then you should use the command \verb|\=|, which takes an argument (the width of the overlining in stitches). You should have one instance of \verb|\=| per column of \verb?|?s. It is strongly recommended that you not mix short overlines with \verb?|?s in the grid font; it will look odd.
+\advance\hsize 60pt
+\noindent \hskip -30pt
+\begin{minipage}[b]{3in}
+\obeylines
+\verb?\definecolor{knitlinecolor}{rgb}{0,0,0.8}?
+\verb?\setcounter{rownumberskip}{2}?
+\verb?\chart{?
+\verb? ---|---|- ?
+\verb? -\overline{--|---|-}?
+\verb?~\={2}~\={2}~ \\ -|---|--- ?
+\verb?~\={2}~\={2}~ \\ ---|---|- ?
+\verb?\vspace{12pt}?
+\verb? ---\!---\!-?
+\verb? -\overline*{--\!---\!-}?
+\verb?~\_\_~\_\_~ \\ -\!---\!--- ?
+\verb?~\_\_~\_\_~ \\ ---\!---\!- ?
+\vspace{0pt}
+\verb?}?
+\end{minipage}%
+\hfill
+\begin{minipage}[b]{105pt}
+\knitnogrid
+\definecolor{knitlinecolor}{rgb}{0,0,0.8}
+\setcounter{rownumberskip}{2}
+\chart{
+ ---|---|-
+ -\overline{--|---|-}
+~\={2}~\={2}~ \\ -|---|---
+~\={2}~\={2}~ \\ ---|---|-
+\vspace{12pt} ---\!---\!-
+ -\overline*{--\!---\!-}
+~\_\_~\_\_~ \\ -\!---\!---
+~\_\_~\_\_~ \\ ---\!---\!-
+\nonumber``}
+\vspace{0pt}
+\end{minipage}%
+\hfill
+\begin{minipage}[b]{110pt}
+\knitgrid
+\definecolor{knitlinecolor}{rgb}{0,0,0.8}
+\setcounter{rownumberskip}{2}
+\chart{ ---|---|-
+ -\overline{--|---|-}
+~\={2}~\={2}~ \\ -|---|---
+~\={2}~\={2}~ \\ ---|---|-
+\vspace{12pt} ---\!---\!-
+ -\overline*{--\!---\!-}
+~\_\_~\_\_~ \\ -\!---\!---
+~\_\_~\_\_~ \\ ---\!---\!-
+\nonumber``}
+\vspace{0pt}
+\end{minipage}
+\end{figure}
-If you want your horizontal lines to reach the edge of the chart, you should use \verb|\-|, which like \verb|\=| takes an argument.
-\item \verb|\purlpass|, \verb|\gridpass|, \verb|\mainpass|. \verb|\chart| and \verb|\textknit| compile their argument twice: once in gray, using the purl background font, and then once in black using the foreground font. They then put them on top of each other. (The grid font does a third pass, in the middle, for just the grid; this lets us have grid lines that are gray rather than black.) \verb|\purlpass| takes one mandatory argument (something to do only during the purl pass) and one optional first argument (something to do during the other two passes.)
+\begin{itemize}
-% Colors to redefine
+\item[$\star$] \verb|\overline| and \verb|\underline| take one argument and typeset it, then put a colored bar over or under it. This is designed to provide a way to outline vertical pattern repeats.
-\item \verb|\color{purlgray}| (\LaTeX) or \verb|\purlgray| (plain \TeX) are used by \verb|\chart|, \verb|\textknit| and \verb|\purlbackground| to change the color to gray.
+These commands have starred and unstarred forms. \verb|\overline| spreads the chart rows to make room for the line; it should be used for lines that go all the way across the chart. \verb|\overline*| does not (the lines overlap the chart a bit) and so should be used for lines that go only partway across the chart.
-The \LaTeX\ package \texttt{knitting.sty} loads the \textsf{color} package and uses it to define the color. If you want a different purl color, you can use \textsf{color}'s \verb|\definecolor| syntax to change \verb|{purlgray}|. This is especially useful if you want to write two-color colorwork charts.
+\item[$\star$] The character \texttt{|} and the command \verb?\|? produce a vertical line suitable for outlining horizontal pattern repeats. The command \verb?\!? produces a slightly different vertical line: like \verb|\overline*|, it will overlap the adjacent cells to avoid disrupting the alignment of columns. Thus, \texttt{|} and \verb?\|? should be used with \verb|\overline|, while \verb|\!| should be used with \verb|\overline*|.
-\texttt{knitting.tex} defines \verb|\purlgray| itself, using syntax that works for pdf\/\TeX\ and \textsf{dvips}, but possibly not other drivers; if you insist on using plain \TeX\ and another driver, you are assumed to know enough to edit \texttt{knitting.tex} to compensate.
+\item[$\star$] You may prefer to specify horizontal lines on their own, without interleaving them with the chart symbols using \verb|\overline|. This may be done, but implementation is complicated.
-\item The colors \texttt{knitlinecolor} and \texttt{gridcolor} are defined and may be changed similarly. \texttt{knitlinecolor} controls the lines produced by \verb?\!?,~\verb?|?, \verb|\=|, \verb|\_|, \verb|\-|, \verb|\overline|, and \verb|\underline|; \texttt{gridcolor} controls the grid.
+You can get short horizontal lines to go with \verb?\!? by using \verb|\_|; it should be positioned using tildes~\texttt{\char`\~}.
-% Special stitches
+If you want to use short horizontal lines with \verb?\|? or~\verb?|?, then you should use the command \verb|\=|, which takes an argument (the width of the overlining in stitches). You should have one instance of \verb|\=| per column of \verb?|?s.
-\item \verb|\knit| and \verb|\purl|. These macros take one argument each and type out that many plain knit or plain purl symbols.
+If you use your horizontal lines on the edge of the chart, you should use \verb|\-|, which like \verb|\=| takes an argument.
-\item \verb|\Knit|, \verb|\Purl|, \verb|\knitbox|, \verb|\purlbox|. These macros were designed to produce appropriate shorthand for ``Knit or purl 12 stitches, regardless of how many are actually shown''. They also provide ways to get lots and lots of bizarre symbols if necessary. The first argument is text to appear inside the box; the second is the desired width of the box (in units of one stitch).
+\end{itemize}
-\item \verb|\wideincrease| and \verb|\widedecrease|. These macros take one argument each (the width, in stitches).
-\sloppy
+\subsection{Colors}
-\item \verb|\bobble|, \verb|\narrowincrease|, \verb|\narrowdecrease|, \verb|\pnarrow|\-\verb|increase|, and \verb|\pnarrow|\-\verb|decrease|. These macros take one argument each; that argument is typeset in small letters over some symbol I thought was appropriate~\textknit{\bobble{5}}.
+\begin{itemize}
-\item[$\star$] Inside a knitting chart (but not after \verb|\textknit|), the shorter commands \verb|\@|, \verb|\<|, \verb|\>|, \verb|\[|, and \verb|\]| are available.
+\item \verb|\color{purlgray}| (\LaTeX) or \verb|\purlgray| (plain \TeX) are used by \verb|\chart|, \verb|\textknit| and \verb|\purlbackground| to change the color to gray.
-\item \verb|\cableleft| and \verb|\cableright| will produce the most general possible cable symbols. While there are simple methods to get {\knitnogrid \textknit{kkKK}} (see Section~\ref{se:cables}), these let you get such obscure symbols as \textknit{\cableright{*}{-Q-}} or even (in concert with \verb|\bobble| and \verb|\knitbox|) \textknit{\cableleft{\narrowincrease{3}\knitbox{knit}{2}}{\purlbox{purl}{2}\bobble{3}}}.
+The \LaTeX\ package \texttt{knitting.sty} loads the \textsf{color} package and uses it to define the color. If you want a different purl color, you can use \textsf{color}'s \verb|\definecolor| syntax to change \verb|{purlgray}|. This is especially useful if you want to write two-color colorwork charts.
-% Dimensions, booleans, sans serif text
+\texttt{knitting.tex} defines \verb|\purlgray| itself, using syntax that works for pdf\/\TeX\ and \textsf{dvips}, but possibly not other drivers; if you insist on using plain \TeX\ and another driver, you are assumed to know enough to edit \texttt{knitting.tex} to compensate.
-\item \verb|\knitlinewd|, \verb|\gridwidth|, \verb|\stitchwd|, \verb|\stitchht|, and \verb|\stitchdp| store most of the dimensional information about the knitting fonts.\footnote{Grid cells are designed to be 12pt (or 16.3pt) by 12pt, and extend slightly below the baseline to work gracefully with numbers or other normal text. In \LaTeX, \texttt{\char`\\ stitchht} is 12pt. In plain \TeX, \texttt{\char`\\ stitchht} is 12pt$-$\texttt{\char`\\ stitchdp}. This is because the plain \TeX\ \texttt{\char`\\ raise} macro and the \LaTeX\ \texttt{\char`\\ raisebox} macro work differently.}
+\item The colors \texttt{knitlinecolor} and \texttt{gridcolor} are defined and may be changed similarly. \texttt{knitlinecolor} controls the lines produced by \verb?\!?,~\verb?|?, \verb|\=|, \verb|\_|, \verb|\-|, \verb|\overline|, and \verb|\underline|; \texttt{gridcolor} controls the grid.
-It is inadvisable to change any of these (except \verb|\knitlinewd|); a 0.4pt grid is built into the fonts, and changing \verb|\gridwidth| won't change it, just mess up any code that relies on \verb|\gridwidth|.
+\item Finally, the color \texttt{rncolor} is used by \verb|\printrownumber| (and \texttt{\char`\\print\-stitch\-count}) so that the row numbers and stitch counts cannot be mistaken for parts of the chart proper. (The color \texttt{rnarrowcolor} is used for just the small arrows in left and right row numbers.)
-You can change \verb|\knitlinewd| with \verb|\setlength|; however, \verb|\knitlinewd| is defined by \textsf{knitting} in a complicated way so as to change gracefully with changing knit sizes, and so it is probably best to say \verb|\newdimen| \verb|\knitlinewd| (not \verb|\newlength|\allowbreak\verb|{\knitlinewd}|) first.
+\end{itemize}
-If you use one of these parameters outside of a \verb|\chart| or \verb|\textknit|, you may get error messages about undefined fonts. To fix them, use \verb|\knitgrid|, \verb|\knitnogrid| or \verb|\knitwide| again.
+\subsection{Stitch symbols produced or modified with commands}
-\item The boolean variables \verb|\ifgrid| and \verb|\ifchartsonly| are standard \TeX\ conditionals: they may be used as
-\begin{center}\verb|\ifgrid| Grid code \verb|\else| Nongrid code \verb|\fi|
-\end{center}
+\begin{itemize}
-They are useful if you haven't decided yet how you want to format your document, or if you want to compile it several times with slightly different results.
+\item \verb|\wideincrease| and \verb|\widedecrease|. These macros take one argument each (the width, in stitches) and produce wide symbols:
+\begin{quote}
+\verb|\textknit{\wideincrease{3}}| \textknit{\wideincrease{3}}
+\end{quote}
-\item In \LaTeX, you get sans serif text (the font inside the knit boxes) with the usual command \verb|\textsf|. In plain \TeX, you can get sans serif text with \verb|\knitsf|.
+\item \verb|\bobble|, \verb|\narrowincrease|, \verb|\narrowdecrease|, \verb|\pnarrow|\-\verb|increase|, and \verb|\pnarrow|\-\verb|decrease|. These macros take one argument each. That argument is typeset in small letters over some symbol I thought was appropriate:
+\begin{quote}
+\verb|\textknit{\bobble{5}}|~\textknit{\bobble{5}}.
+\end{quote}
-\end{itemize}
+\item[$\star$] Inside a knitting chart (but not after \verb|\textknit|), the shorter commands \verb|\@|, \verb|\<|, \verb|\>|, \verb|\[|, and \verb|\]| are available.
-\begin{figure}
-\caption{Examples}
+\item \verb|\cableleft| and \verb|\cableright| will produce the most general possible cable symbols. While there are simple methods to get {\knitnogrid \textknit{kkKK}} (see \autoref{se:cables}), these let you get such obscure symbols as \textknit{\cableright{*}{-Q-}} or even (in concert with \verb|\bobble| and \verb|\knitbox|) \textknit{\cableleft{\narrowincrease{3}\knitbox{knit}{2}}{\purlbox{purl}{2}\bobble{3}}}.
-\advance\hsize 60pt
-\noindent \hskip -30pt
-\begin{minipage}[b]{3in}
-\obeylines
-\verb?\chart[oddleft]{?
-\verb?\nonumber?
-\verb?\overline{~~~~~\hspace{2\knitlinewd}}?
-\verb?\nonumber-|\widedecrease{3}|-?
-\verb?-|\knitbox{8}{3}|-?
-\verb?\@3|\purlbox{8}{3}|=?
-\vspace{1pt}
-\verb?\overline{-|\knit{3}|-}?
-\verb?\underline{-|\Knit{8}{3}|=}?
-\vspace{1pt}
-\verb?-|-{\purlpass{\color{blue}} pK}|-?
-\verb?-|\Purl{12}{3}|=?
-\verb?-|\purlbackground{\wideincrease{3}}|-?
-\verb?\addtocounter{rownumber}{-2}}}?
-\end{minipage}%
-\hfill
-\begin{minipage}[b]{1.5in}
-\knitnogrid
-\qquad\verb|\knitnogrid|\\
-\chart[oddleft]{
-\nonumber
-\overline{~~~~~\hspace{2\knitlinewd}}
-\nonumber-|\widedecrease{3}|-
--|\knitbox{8}{3}|-
-\@3|\purlbox{8}{3}|=
-\overline{-|\knit{3}|-}
-\underline{-|\Knit{8}{3}|=}
--|-{\purlpass{\color{blue}} pK}|-
--|\Purl{12}{3}|=
--|\purlbackground{\wideincrease{3}}|-
-\nonumber\addtocounter{rownumber}{-2}`}
-\end{minipage}%
-\hfill
-\begin{minipage}[b]{1.5in}
+\item \verb|\purlbackground|. I use a gray background to indicate simple purls, and also the purl version of more complicated stitches: \textknit{<} for slip, slip, knit, and \textknit{;} for purl 2 together. You can get \textknit{3} instead of \textknit{A} by typing~\texttt{3} instead of~\texttt{A}, but I didn't have space to provide a purl version of every symbol; so the only way to get \textknit{\purlbackground{r}} is with \verb|\purlbackground{r}|.
+
+\item \verb|\knit| and \verb|\purl|. These macros take one argument each and type out that many plain knit or plain purl symbols.
+
+\item \verb|\Knit|, \verb|\Purl|, \verb|\knitbox|, \verb|\purlbox|. These macros were designed to produce appropriate shorthand for ``Knit or purl 12 stitches, regardless of how many are actually shown''. They also provide ways to get lots and lots of bizarre symbols if necessary. The first argument is text to appear inside the box; the second is the desired width of the box (in units of one stitch).
+
+They look like this:
+\begin{quote}\raggedright
\knitgrid
-\qquad\verb|\knitgrid|\\
-\chart[oddleft]{
-\nonumber
-\overline{~~~~~\hspace{2\knitlinewd}}
-\nonumber-|\widedecrease{3}|-
--|\knitbox{8}{3}|-
-\@3|\purlbox{8}{3}|=
-\overline{-|\knit{3}|-}
-\underline{-|\Knit{8}{3}|=}
--|-{\purlpass{\color{blue}} pK}|-
--|\Purl{12}{3}|=
--|\purlbackground{\wideincrease{3}}|-
-\nonumber\addtocounter{rownumber}{-2}`}
-\end{minipage}
+\verb|\Knit{12}{5}| \textknit{\Knit{12}{5}}
+\verb|\knitbox{12}{5}| \textknit{\knitbox{12}{5}}\\
+\verb|\Purl{12}{5}| \textknit{\Purl{12}{5}}
+\verb|\purlbox{12}{5}| \textknit{\purlbox{12}{5}}
+\knitnogrid
+\verb|\Knit{12}{5}| \textknit{\Knit{12}{5}}
+\verb|\knitbox{12}{5}| \textknit{\knitbox{12}{5}}\\
+\verb|\Purl{12}{5}| \textknit{\Purl{12}{5}}
+\verb|\purlbox{12}{5}| \textknit{\purlbox{12}{5}}
+\end{quote}
-\bigskip
+Normally, the first argument is centered inside the box. However, you can offset the label with an optional first argument. This is the displacement to the right in half-stitches; to get a displacement to the left, use negative numbers.
-\noindent \hskip -30pt
-\begin{minipage}[b]{3in}
-\obeylines
-\verb?\definecolor{knitlinecolor}{rgb}{0,0,0.8}?
-\verb?\setcounter{rownumberskip}{2}?
-\verb?\chart{?
-\verb? \overline{--|--|-}\rnright?
-\verb?~\={1}~\={1}~\\-|--|-- \rnright?
-\verb?~\={1}~\={1}~\\--|--|- \rnright?
-\verb?\vspace{24pt}?
-\verb?\-{5}?
-\verb?--\!--\!- \rnright \\ ~\_~\_~?
-\verb?-\!--\!-- \rnright \\ ~\_~\_~?
-\verb?--\!--\!- \rnright?
-\vspace{0pt}
-\verb?}?
-\end{minipage}%
-\hfill
-\begin{minipage}[b]{85pt}
+If you want to make these characters more obvious, you can change the colors for the knit and purl boxes (and the generated {\knitnogrid \textknit{=}s and \textknit{-}s}) by redefining the commands \verb|\knitboxforeground|, \verb|\purlboxforeground|, \verb|\knitboxbackground|, \verb|\purlboxbackground|; by default, they are blank and \verb|\color{purlgray}| (or \verb|\purlgray|).
+
+\begin{quote}\raggedright
\knitnogrid
-\definecolor{knitlinecolor}{rgb}{0,0,0.8}
-\setcounter{rownumberskip}{2}
-\chart{
- \overline{--|--|-}\rnright
-~\={1}~\={1}~\\-|--|-- \rnright
-~\={1}~\={1}~\\--|--|-\rnright
-\vspace{24pt}
-\-{5}
---\!--\!- \rnright \\ ~\_~\_~
--\!--\!-- \rnright \\ ~\_~\_~
---\!--\!- \rnright
-\nonumber``}
-\vspace{0pt}
-\end{minipage}%
-\hfill
-\begin{minipage}[b]{90pt}
-\knitgrid
-\definecolor{knitlinecolor}{rgb}{0,0,0.8}
-\setcounter{rownumberskip}{2}
-\chart{
- \overline{--|--|-}\rnright
-~\={1}~\={1}~\\-|--|-- \rnright
-~\={1}~\={1}~\\--|--|-\rnright
-\vspace{24pt}
-\-{5}
---\!--\!- \rnright \\ ~\_~\_~
--\!--\!-- \rnright \\ ~\_~\_~
---\!--\!- \rnright
-\nonumber``}
-\vspace{0pt}
-\end{minipage}
-\end{figure}
+\verb?\definecolor{purlboxbg}{gray}{0.57}?\\
+\verb?\definecolor{purlboxfg}{gray}{0.2}?\\
+\verb?\renewcommand\purlboxbackground{\color{purlboxbg}}?\\
+\verb?\renewcommand\purlboxforeground{\color{purlboxfg}}?\\
+\verb?\textknit{Kp\Purl[-1]{12}{6}}?
+\definecolor{purlboxbg}{gray}{0.57}
+\definecolor{purlboxfg}{gray}{0.2}
+\renewcommand\purlboxbackground{\color{purlboxbg}}
+\renewcommand\purlboxforeground{\color{purlboxfg}}
+\textknit{Kp\Purl[-1]{12}{6}}
+\end{quote}
-\section{What goes in the charts}
+\end{itemize}
-After careful consideration, I decided to depart from \TeX\ tradition and set the fonts up so that your input would also look more or less like a chart (rather than defining new commands like \verb|\ssk|).
+\subsection{Miscellaneous commands}
-So here's what you type:
+\begin{itemize}
-\subsection{Space in the input}
+\item \verb|\purlpass|, \verb|\gridpass|, \verb|\mainpass|. \verb|\chart| and \verb|\textknit| compile their argument twice: once in gray, for the purl background, and then once in black for the foreground. They then put them on top of each other. (The grid font does a third pass, in the middle, for just the grid; this lets us have grid lines that are gray rather than black.) \verb|\purlpass| takes one mandatory argument (something to do only during the purl pass) and one optional first argument (something to do during the other two passes.) These let you produce a variety of effects:
+\begin{quote}
+\verb|\purlpass{\color{blue}} pK| \textknit{\purlpass{\color{blue}} pK}
+\end{quote}
-A normal space in the source code in a knit grid, like a space in math mode, is ignored.
-In a knitting chart, unlike in normal text, you want to prescribe all your line breaks. For convenience, knitting charts have the macro \verb|\obeylines| built in, so that a single $\langle$return$\rangle$ produces a new paragraph (and therefore a new line), like a double $\langle$return$\rangle$ usually does.
+\item \verb|\knitlinewd|, \verb|\gridwidth|, \verb|\stitchwd|, \verb|\stitchht|, and \verb|\stitchdp| store most of the dimensional information about the knitting fonts.\footnote{Grid cells are designed to be 12pt (or 16.3pt) by 12pt, and extend slightly below the baseline to work gracefully with numbers or other normal text. In \LaTeX, \texttt{\char`\\ stitchht} is 12pt. In plain \TeX, \texttt{\char`\\ stitchht} is 12pt$-$\texttt{\char`\\ stitchdp}. This is because the plain \TeX\ \texttt{\char`\\ raise} macro and the \LaTeX\ \texttt{\char`\\ raisebox} macro work differently.}
-If you want two or more lines in the source code to produce one line on the chart, end all but the last with the comment character~\verb|%|.
+It is inadvisable to change any of these (except \verb|\knitlinewd|); a \the\gridwidth\ grid is built into the fonts, and changing \verb|\gridwidth| won't change it, just mess up any code that relies on \verb|\gridwidth|.
-Unfortunately, the trick I use to make $\langle$return$\rangle$s trigger new lines is delicate; specifically, if you put your chart inside another command, it stops working. (It works fine inside environments.) (The bar \verb?|? also stops working; it produces a plain black bar whose width will not change if you redefine \verb|\knitlinewd|.)
+You can change \verb|\knitlinewd| with \verb|\setlength|; however, \verb|\knitlinewd| is defined by \textsf{knitting} in a complicated way so as to change gracefully with changing knit sizes, and so it is probably best to say \verb|\newdimen| \verb|\knitlinewd| (not \verb|\newlength|\allowbreak\verb|{\knitlinewd}|) first.
-So if you want to embed your chart inside another command, you have to end each line with a \verb|\par|, \verb|\\|, or a double $\langle$return$\rangle$ (blank line).
+If you use one of these parameters outside of a \verb|\chart| or \verb|\textknit|, you may get error messages about undefined fonts. To fix them, use \verb|\knitgrid|, \verb|\knitnogrid| or \verb|\knitwide| again.
-\begin{figure}
-\caption{The effects of embedding charts in commands and environments}
-\par\bigskip\par
-\begin{minipage}[b]{2.5in}
-\begin{verbatim}
-\newdimen\knitlinewd
-\setlength{\knitlinewd}{4pt}
-\parbox{77pt}{
-\chart{
-tt|
-AA\|%
---\\
-==|==\\}
-}
-\end{verbatim}
-\end{minipage}%
-\hskip -108pt
-\begin{minipage}[b]{80pt}
-\newdimen\knitlinewd
-\setlength{\knitlinewd}{4pt}
-\parbox{80pt}{
-\chart{
-tt|
-AA\|%
---\\
-==|==\\}}
-\vspace{24pt}
-\end{minipage}%
-\hskip 12pt
-\begin{minipage}[b]{2.5in}
-\begin{verbatim}
-\newdimen\knitlinewd
-\setlength{\knitlinewd}{4pt}
-\begin{center}
-\chart{
-tt|
-AA\|%
---\\
-==|==\\}
-\end{center}
-\end{verbatim}
-\end{minipage}%
-\hskip -84pt
-\begin{minipage}[b]{55pt}
-\newdimen\knitlinewd
-\setlength{\knitlinewd}{4pt}
-\begin{center}
-\chart{
-tt|
-AA\|%
---\\
-==|==\\}
+\item The boolean variables \verb|\ifgrid| and \verb|\ifchartsonly| are standard \TeX\ conditionals: they may be used as
+\begin{center}\verb|\ifgrid| Grid code \verb|\else| Nongrid code \verb|\fi|
\end{center}
-\vspace{24pt}
-\end{minipage}
-\end{figure}
-\subsection{Space in the output}
+They are useful if you haven't decided yet how you want to format your document, or if you want to compile it several times with slightly different results.
-A tilde $\sim$ produces a gap the width of one stitch. This is meant to be used in charts with ragged edges. It's been designed so that automatically placed rownumbers show up {after} the gaps left by $\sim$, not before. If you really want them to show up earlier, you can use single quotes instead of $\sim$s as spacers.
+\item In \LaTeX, you get sans serif text (the font inside the knit boxes) and roman text (the row number/stitch count font) with the usual commands \verb|\textsf| and \verb|\textnormal|. In plain \TeX, you can get these fonts with \verb|\knitsf| and \verb|\knitrm|.
-The single quotes \texttt{`} and \texttt{'} produce spaces that are {half} the width of a normal box (white or gray). If for some reason you need an empty, borderless box in the grid font, you can use~\texttt{``} or~\texttt{''}. It is inadvisable to use $\sim$s alone on their own line; \texttt{``}s are much better behaved.
+\end{itemize}
-In the nongrid font, \fbox{\texttt{\vphantom{I}.}}\ and~\fbox{\texttt{\vphantom{I},}} both produce empty boxes. (Of different colors; \fbox{\texttt{\vphantom{I}.}}~produces white, \fbox{\texttt{\vphantom{I},}}~produces gray.) These are meant to be no-stitch markers which are as unobtrusive and non-misleading as possible, and are in fact why the nongrid font has no grid.
+%\begin{figure}
+%\caption{Examples}\label{fig:examples}
+%\advance\hsize 60pt
+%\noindent \hskip -30pt
+%\begin{minipage}[b]{3in}
+%\obeylines
+%\verb?\chart[oddleft]{?
+%\verb?\nonumber?
+%\verb?\overline{~~~~~\hspace{2\knitlinewd}}?
+%\verb?\nonumber-|\widedecrease{3}|-?
+%\verb?-|\knitbox[-1]{8}{3}|-?
+%\verb?\@3|\purlbox[1]{8}{3}|=?
+%\vspace{1pt}
+%\verb?\overline{-|\knit{3}|-}?
+%\verb?\underline{-|\Knit{8}{3}|=}?
+%\vspace{1pt}
+%\verb?-|-{\purlpass{\color{blue}} pK}|-?
+%\verb?-|\Purl{12}{3}|=?
+%\verb?-|\purlbackground{\wideincrease{3}}|-?
+%\verb?\addtocounter{rownumber}{-2}}}?
+%\end{minipage}%
+%\hfill
+%\begin{minipage}[b]{1.5in}
+%\knitnogrid
+%\quad\verb|\knitnogrid|\\
+%\chart[oddleft]{
+%\nonumber
+%\overline{~~~~~\hspace{2\knitlinewd}}
+%\nonumber-|\widedecrease{3}|-
+%-|\knitbox[-1]{8}{3}|-
+%\@3|\purlbox[1]{8}{3}|=
+%\overline{-|\knit{3}|-}
+%\underline{-|\Knit{8}{3}|=}
+%-|-{\purlpass{\color{blue}} pK}|-
+%-|\Purl{12}{3}|=
+%-|\purlbackground{\wideincrease{3}}|-
+%\nonumber\addtocounter{rownumber}{-2}`}
+%\end{minipage}%
+%\hfill
+%\begin{minipage}[b]{1.5in}
+%\knitgrid
+%\qquad\verb|\knitgrid|\\
+%\chart[oddleft]{
+%\nonumber
+%\overline{~~~~~\hspace{2\knitlinewd}}
+%\nonumber-|\widedecrease{3}|-
+%-|\knitbox[-1]{8}{3}|-
+%\@3|\purlbox[1]{8}{3}|=
+%\overline{-|\knit{3}|-}
+%\underline{-|\Knit{8}{3}|=}
+%-|-{\purlpass{\color{blue}} pK}|-
+%-|\Purl{12}{3}|=
+%-|\purlbackground{\wideincrease{3}}|-
+%\nonumber\addtocounter{rownumber}{-2}`}
+%\end{minipage}
+%\end{figure}
+
+\section{What goes in the charts}
+After careful consideration, I decided to depart from \TeX\ tradition and set the fonts up so that your input would also look more or less like a chart (rather than defining new commands like \verb|\ssk|).
\subsection{Normal symbols}\label{se:normal}
The normal symbols are in \autoref{fig:symbols}. The file \texttt{knitkey.tex} contains my suggested meanings for all the available symbols.
+\makeatletter
+\let \barknit \bar@knit
+\let \barthinknit \barthin@knit
+\makeatother
+
\begin{figure}
\caption{The normal symbols}\label{fig:symbols}
\newcommand\knitrow[1]{\texttt{#1}&\knitgrid\textknit{#1}&\knitnogrid\textknit{#1}\\}
@@ -579,6 +668,7 @@ The normal symbols are in \autoref{fig:symbols}. The file \texttt{knitkey.tex} c
\knitrow{m}
\knitrow{M}
\knitrow{O}
+\knitrow{9}
\hline
\end{tabular}
\hfill
@@ -602,6 +692,8 @@ The normal symbols are in \autoref{fig:symbols}. The file \texttt{knitkey.tex} c
\knitrow{W}
\knitrow{E}
\knitrow{Y}
+\knitrow{6}
+%\knitrow{0}
\hline
\end{tabular}
\hfill
@@ -624,12 +716,14 @@ The normal symbols are in \autoref{fig:symbols}. The file \texttt{knitkey.tex} c
\knitrow{U}
\knitrow{f}
\knitrow{F}
-\knitrow{@}
+\knitrow{7}
+\knitrow{8}
\hline
\end{tabular}
\hfill
\begin{tabular}[t]{|ccc|}
\hline
+\knitrow{@}
\knitrow{"}
\knitrow{""}
\knitrow{*}
@@ -644,15 +738,96 @@ The normal symbols are in \autoref{fig:symbols}. The file \texttt{knitkey.tex} c
\knitrow{???}
\knitrow{+++}
\knitrow{+/+}
-\knitrow{|}
-\displaypair{|}{\char`\\!}
+\displaypair{\barknit}{\char`\\|}
+\displaypair{\barthinknit}{\char`\\!}
\displaypair{\wideincrease{4}}{}
\displaypair{\widedecrease{4}}{}
\hline
\end{tabular}
\end{figure}
-If these symbols (and the cable symbols in the next section) do not suffice, then you can generate new symbols with \verb|\knitbox|: \textknit{\knitbox{a}{1}} \textknit{\knitbox{Cable 6 left}{6}}. This is the best way to indicate very wide cables in the grid font, since very wide cable symbols do not exist in that font, and if they did, they would slant too steeply to be easily read. A great many strange symbols are available by using math symbols: \verb|\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}| \chart{\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}}. However, these may look a little incongruous with the rest of the font, so use with care.
+If these symbols (and the cable symbols in \autoref{se:cables}) do not suffice, then you can generate new symbols with \verb|\knitbox|: \textknit{\knitbox{a}{1}} \textknit{\knitbox{Cable 6 left}{6}}. This is the best way to indicate very wide cables in the grid font, since very wide cable symbols do not exist in that font, and if they did, they would slant too steeply to be easily read. A great many strange symbols are available by using math symbols: \verb|\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}| \chart{\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}}. However, these may look a little incongruous with the rest of the font, so use with care.
+
+\subsection{Space in the input}
+
+A normal space in the source code in a knitting chart, like a space in math mode, is ignored.
+In a knitting chart, unlike in normal text, you want to prescribe all your line breaks. For convenience, knitting charts have the macro \verb|\obeylines| built in, so that a single $\langle$return$\rangle$ produces a new paragraph (and therefore a new line), like a double $\langle$return$\rangle$ usually does.
+
+If you want two or more lines in the source code to produce one line on the chart, end all but the last with the comment character~\verb|%|.
+
+Unfortunately, the trick I use to make $\langle$return$\rangle$s trigger new lines is delicate; specifically, if you put your chart inside another command, it stops working. (It works fine inside environments.) (The bar \verb?|? also stops working; it produces a plain black bar whose width will not change if you redefine \verb|\knitlinewd|.)
+
+So if you want to embed your chart inside another command, you have to end each line with a \verb|\par|, \verb|\\|, or a double $\langle$return$\rangle$ (blank line).
+
+\let \saveknitlinewd \knitlinewd
+
+\begin{figure}
+\caption{The effects of embedding charts in commands and environments}
+\par\bigskip\par
+\begin{minipage}[b]{2.5in}
+\begin{verbatim}
+\newdimen\knitlinewd
+\setlength{\knitlinewd}{4pt}
+\parbox{77pt}{
+\chart{
+tt|
+AA\|%
+--\\
+==|==\\}
+}
+\end{verbatim}
+\end{minipage}%
+\hskip -108pt
+\begin{minipage}[b]{80pt}
+\newdimen\knitlinewd
+\setlength{\knitlinewd}{4pt}
+\parbox{80pt}{
+\chart{
+tt|
+AA\|%
+--\\
+==|==\\}}
+\vspace{24pt}
+\end{minipage}%
+\hskip 12pt
+\begin{minipage}[b]{2.5in}
+\begin{verbatim}
+\newdimen\knitlinewd
+\setlength{\knitlinewd}{4pt}
+\begin{center}
+\chart{
+tt|
+AA\|%
+--\\
+==|==\\}
+\end{center}
+\end{verbatim}
+\end{minipage}%
+\hskip -84pt
+\begin{minipage}[b]{55pt}
+\newdimen\knitlinewd
+\setlength{\knitlinewd}{4pt}
+\begin{center}
+\chart{
+tt|
+AA\|%
+--\\
+==|==\\}
+\end{center}
+\vspace{24pt}
+\end{minipage}
+\end{figure}
+
+\let \knitlinewd \saveknitlinewd
+
+\subsection{Space in the output}
+
+A tilde $\sim$ produces a gap the width of one stitch. This is meant to be used in charts with ragged edges. It's been designed so that automatically placed rownumbers show up {after} the gaps left by $\sim$, not before. If you really want them to show up earlier, you can use single quotes instead of $\sim$s as spacers.
+
+The single quotes \texttt{`} and \texttt{'} produce spaces that are {half} the width of a normal box (white or gray). If for some reason you need an empty, borderless box in the grid font, you can use~\texttt{``} or~\texttt{''}. It is inadvisable to use $\sim$s alone on their own line; \texttt{``}s are much better behaved.
+
+In the nongrid font, \fbox{\texttt{\vphantom{I}.}}\ and~\fbox{\texttt{\vphantom{I},}} both produce empty boxes. (Of different colors; \fbox{\texttt{\vphantom{I}.}}~produces white, \fbox{\texttt{\vphantom{I},}}~produces gray.) These are meant to be no-stitch markers which are as unobtrusive and non-misleading as possible, and are in fact why the nongrid font has no grid.
+
\subsection{Ligatures and cables}
\label{se:cables}
@@ -727,7 +902,7 @@ Twelve special cable symbols are also possible:
\textknit{kpK~Kpk~kkpKK~KKpkk~kkppKK~KKppkk}\\
\textknit{kpD~Kpd~kkpKD~KKpkd~kkppKD~KKppkd}\\
\end{center}
-You get these by putting \texttt{p}s (not \texttt{g}s) between the \texttt{k}s and \texttt{K}s/\texttt{D}s.\footnote{{The rules for these cables are actually more complicated. The only way to get \knitnogrid\textknit{kkpKK}, the nogrid equivalent of \knitgrid\textknit{kkpKK}, is by typing \texttt{kkpKK} or some equivalent with \texttt{c}s and~\texttt{g}s. In the grid font, you can't use \texttt{g} for the middle purl stitch. More importantly, the fonts don't check to make sure you typed exactly \texttt{kkpKK}. The only grid cable that can start with \texttt{kkp} is \textknit{kkp}; so \texttt{kkp} followed by any number of \texttt{K}s will produce \textknit{kkpKKKKK}.}}
+You get these by putting \texttt{p}s (not \texttt{g}s) between the \texttt{k}s and \texttt{K}s.\footnote{{The rules for these cables are actually more complicated. The only way to get \knitnogrid\textknit{kkpKK}, the nogrid equivalent of \knitgrid\textknit{kkpKK}, is by typing \texttt{kkpKK} or some equivalent with \texttt{c}s and~\texttt{g}s. In the grid font, you can't use \texttt{g} for the middle purl stitch. More importantly, the fonts don't check to make sure you typed exactly \texttt{kkpKK}. The only grid cable that can start with \texttt{kkp} is \textknit{kkp}; so \texttt{kkp} followed by any number of \texttt{K}s will produce \textknit{kkpKKKKK}.}}
In the wide-cell grid font, for technical reasons no symbols more than five cells wide are available; so while \knitwide\textknit{pK} is available, a wider version of \knitgrid\textknit{kkppKK} is not.
@@ -750,15 +925,19 @@ KKdd~KKnn~KKoo
\end{center}
\texttt{e} and \texttt{o} have the same effect.
-
-Some special effects are possible. You can get fancy with the colors of these symbols:
+Some special effects are possible. You can get fancy with the colors of these symbols:\footnote{If you use \texttt{\char`\\colorbox} with \texttt{\char`\\textknit} insteat of \texttt{\char`\\chart}, you will need to say \texttt{\char`\\setlength\allowbreak\char`\{\char`\\fboxsep\char`\}\char`\{0pt\char`\}} at some point to make this work; this statement is built into \texttt{\char`\\chart}.}
\bigskip
-\verb?\setlength{\fboxsep}{0pt}?\hfill{\setlength{\fboxsep}{0pt}
-\textknit{\purlpass[Kk]{\colorbox{lightblue}{\color{blue}{kK}}}}}
+\noindent{\setlength{\fboxsep}{0pt}
+\verb|\colorbox{lightblue}{A}|
+\hfill\textknit{`\colorbox{lightblue}{A}`}}
+
+\smallskip
-\verb?\textknit{\purlpass[Kk]{\colorbox{lightblue}{\color{blue}{kK}}}?
+\noindent{\setlength{\fboxsep}{0pt}
+\verb|\purlpass[Kk]{\colorbox{lightblue}{\color{blue}kK}}|
+\hfill\textknit{\purlpass[Kk]{\colorbox{lightblue}{\color{blue}kK}}}}
\bigskip
@@ -781,93 +960,278 @@ ppKK}
This is enough for most cable patterns.
+\section{Counting stitches}
+\label{se:counting}
+
+\setcounter{rownumberskip}{1}
+
+When knitting a complicated pattern, it can be helpful if the chart indicates the expected stitch count after each row. When writing a complicated chart, and especially when designing a new stitch pattern, it can be very helpful to have some way of checking to see that each row uses exactly as many stitches as the previous row generated. \textsf{knitting} provides a mechanism for counting stitches and for comparing them from row to row.
+
+If used inside a knitting chart, the command \verb|\countstitches| takes one argument and sets the counters \texttt{stitchcountout} and \texttt{stitchcountin} to reflect how many stitches that sequence of stitches would produce or consume, assuming that all the symbols have the meanings given in \textsf{knitkey.tex}.
+
+So, for example:
+
+\bigskip
+
+\noindent\begin{minipage}[t]{224pt}
+\obeylines\parindent=0pt\tt
+\verb?\chart{\countstitches{->-}}?
+\verb?stitchcountout: \thestitchcountout?
+\verb?stitchcountin: \thestitchcountin?
+\end{minipage}
+\quad
+\begin{minipage}[t]{108pt} \obeylines
+\chart{\countstitches{->-}}
+stitchcountout: \thestitchcountout
+stitchcountin: \thestitchcountin
+\end{minipage}
+
+\bigskip
+
+This can be used to automatically label each row with its stitch count.
+
+\bigskip
+
+\noindent\begin{minipage}[b]{350pt}
+\obeylines\parindent=0pt\tt
+\verb?\newcommand{\mystitchcount}[1]{\countstitches{#1}#1?
+\verb? \mainpass{{\color{rncolor}%?
+\verb? \textnormal{ (\thestitchcountout\ sts)}}}}?
+\verb?\chart{?
+\verb? \mystitchcount{~-A-~}?
+\verb? \mystitchcount{-----}?
+\verb? \mystitchcount{~-w-~}}?
+\end{minipage}
+\hskip -108pt
+\begin{minipage}[b]{108pt}
+\newcommand{\mystitchcount}[1]{\countstitches{#1}#1
+ \mainpass{{\color{rncolor}%
+ \textnormal{ (\thestitchcountout\ sts)}}}}
+\chart{
+ \mystitchcount{~-A-~}
+ \mystitchcount{-----}
+ \mystitchcount{~-w-~}}
+\end{minipage}
+
+\bigskip
+
+(A more complicated example is in \texttt{knitexamples.tex}. Repeated patterns affect stitch count in strange ways; that example should show you how to cope.)
+
+You can adjust the stitch count using the command \verb|\adjuststitchcount|. It takes a mandatory argument (how many stitches to add) and an optional argument (a different number of stitches to add to the incount.)
+
+By using the command \verb|\stitchcountwarningbar|, we can check to see that stitch counts are consistent from row to row:
+
+\bigskip
+
+\noindent\begin{minipage}[b]{\textwidth}
+\obeylines\parindent=0pt\tt
+\verb?\newcommand{\mystitchcount}[1]{\countstitches{#1}#1%?
+\verb? \textnormal{\color{rncolor}?
+\verb? \mainpass{ (\thestitchcountout\ sts)\stitchcountwarningbar}}?
+\end{minipage}
+
+\noindent\begin{minipage}[b]{350pt}
+\obeylines\parindent=0pt\tt
+\verb?\chart{?
+\verb? \setcounter{stitchcountin}{-100}?
+\verb? \mystitchcount{~-A-~}?
+\verb? \mystitchcount{-----}?
+\verb? \mystitchcount{-->--}?
+\verb? \mystitchcount{-----}?
+\verb? \mystitchcount{~-w-~}}?
+\end{minipage}
+\hskip -108pt
+\begin{minipage}[b]{108pt}
+\newcommand{\mystitchcount}[1]{%
+ \countstitches{#1}#1%
+ \textnormal{\color{rncolor}
+ \mainpass{ (\thestitchcountout\ sts)\stitchcountwarningbar}}}
+\chart{
+ \setcounter{stitchcountin}{-100}
+ \mystitchcount{~-A-~}
+ \mystitchcount{-----}
+ \mystitchcount{-->--}
+ \mystitchcount{-----}
+ \mystitchcount{~-w-~}}
+\end{minipage}
+
+\bigskip
+
+The heavy bar beside Row 2 indicates that Row~3 uses six stitches, but Row~2 produces only five. \verb|\stitchcountwarningbar| is built using the same code as \TeX's usual overfull rules; thus, it will only appear (in \LaTeX) if the \texttt{draft} document option is enabled.
+
+The initial \verb?\setcounter{stitchcountin}{-100}? prevents a warning bar from showing up on the very first row. A \verb?\setcounter{stitchcountin}{3}? would work in this case as well, since the top row produces 3 stitches.
+
+All of this gives you a lot of control over the stitch-counting mechanism in your chart. However, it requires a lot of work to set up. \textsf{knitting} has a quick command for generating charts with stitch counts:
+
+\bigskip
+
+\noindent\begin{minipage}[b]{350pt}
+\obeylines\parindent=0pt\tt
+\verb?\rnoddonly?
+\verb?\stitchcountchart[right]{?
+\verb? -----?
+\verb? ---\adjuststitchcount{2}?
+\verb? ---"\adjuststitchcount{2}?
+\verb? -----?
+\verb? }?
+\end{minipage}
+\hskip -108pt
+\begin{minipage}[b]{108pt}
+\rnoddonly
+\stitchcountchart[right]{
+ -----
+ ---\adjuststitchcount{2}
+ ---"\adjuststitchcount{2}
+ -----
+ }
+\par\strut
+\end{minipage}
+\bigskip
+
+The only way to customize this is the optional argument (which places row numbers as usual) and by redefining the commands \texttt{\char`\\ printleftstitchcount} and \texttt{\char`\\ printrightstitchcount}. The default (\LaTeX) values are
+\begin{quote}
+\verb?\newcommand{\printleftstitchcount}{{\color{rncolor}%?\\
+\verb? \textnormal{(\thestitchcountout\ sts) }}}?\\
+\verb?\newcommand{\printrightstitchcount}{}?
+\end{quote}
+
+\subsection*{Warnings} The stitch-counting machinery cannot, of course, actually know what meanings you assign to symbols. It is designed for the meanings in \textsf{knitkey.tex}. If you deviate from these, it will get the wrong answer.
+
+In particular, \verb|\Knit|, \verb|\Purl|, \verb|\knitbox| and \verb|\purlbox| count out as many stitches as their printed chart width. So \verb|\Knit{Knit 12}{7}| \textknit{\Knit{Knit 12}{7}} will be counted as 7 stitches. The best way to deal with this is probably to define a \verb|\myknit| command:
+\begin{quote}
+\verb?\newcommand{\myknit}[2]{\Knit{Knit #1}{#2}%?\\
+\verb? \adjuststitchcount{-#2}\adjuststitchcount{#1}}?
+\end{quote}
+
+Also, \verb|\stitchcountchart| is delicate; it must not be used inside commands, the closing~\verb|}| must be on its own line, and it often has trouble if strange things are put at the start of a line. (You can fix this by starting the line with a \verb|\noindent| or \verb|\leavevmode| or \verb|\mbox{}|.)
+
+\section{Revision history}
+
+\subsection*{August 2010}
+
+I've added the symbols \textknit{(}, \textknit{)}, \textknit{6}, \textknit{7}, \textknit{8}, and~\textknit{9} to the fonts for the benefit of people who want to use the symbols suggested by the Craft Yarn Council of America, and updated \texttt{knitkey.tex} to include these symbols (and a few others that can be generated by judicious use of \verb|\knitbox| and \verb|\purlpass|).
+
+I've added the commands \texttt{\char`\\ print\-rightrownumber}, \texttt{\char`\\ printleftrownumber} and \texttt{\char`\\ print\-row\-number} to make row numbers easier to customize. I've redefined the left and right row number macros to include little arrows.
+
+I've added the starred forms of \verb|\overline| and \verb|\underline| and the optional argument to \verb|\Knit|, \verb|\Purl|, \verb|\knitbox| and \verb|\purlbox| to offset the labels, and have rewritten those commands to use \verb|\knitboxbackground| and \verb|\purlboxbackground| in order to make them easier to customize.
+
+\catcode`\_=12
+
+I've added the stitch-counting mechanism. This has entailed minor revisions to a number of existing commands, writing the stitch-counting macros themselves, and also creating the supporting fonts \texttt{knitn_sc_in}, \texttt{knitn_sc_out}, \texttt{knitg_sc_in}, \texttt{knitg_sc_out}, \texttt{knitw_sc_in}, and \texttt{knitw_sc_out}.
+
\section{List of files that are considered part of this package}
\label{se:manifest}
This package should have come with all the following files, organized into the directories listed.
-\begingroup \ttfamily
+\medskip
+
+\begingroup \ttfamily
\noindent knitting/docs
\begin{itemize}
- \item knitexamples.tex
- \item knitkey.tex
- \item knitting-doc.pdf
- \item knitting-doc.tex
+ \item knitexamples.tex
+ \item knitkey.tex
+ \item knitting-doc.pdf
+ \item knitting-doc.tex
\end{itemize}
\noindent knitting/fonts/afm
\begin{itemize}
- \item knitgg.afm
- \item knitgn.afm
- \item knitgp.afm
- \item knitnl.afm
- \item knitnn.afm
- \item knitnp.afm
- \item knitnr.afm
- \item knitwg.afm
- \item knitwn.afm
- \item knitwp.afm
+ \item knitg_sc_in.afm
+ \item knitg_sc_out.afm
+ \item knitgg.afm
+ \item knitgn.afm
+ \item knitgp.afm
+ \item knitn_sc_in.afm
+ \item knitn_sc_out.afm
+ \item knitnl.afm
+ \item knitnn.afm
+ \item knitnp.afm
+ \item knitnr.afm
+ \item knitw_sc_in.afm
+ \item knitw_sc_out.afm
+ \item knitwg.afm
+ \item knitwn.afm
+ \item knitwp.afm
\end{itemize}
\noindent knitting/fonts/map
\begin{itemize}
- \item knitfont.map
+ \item knitfont.map
\end{itemize}
\noindent knitting/fonts/source
\begin{itemize}
- \item knit\char`\_dimens.mf
- \item knit\char`\_grid\char`\_cables.mf
- \item knit\char`\_nogrid\char`\_cables.mf
- \item knit\char`\_symbols.mf
- \item knitgg.mf
- \item knitgn.mf
- \item knitgp.mf
- \item knitnl.mf
- \item knitnn.mf
- \item knitnp.mf
- \item knitnr.mf
- \item knitwg.mf
- \item knitwn.mf
- \item knitwp.mf
+ \item knit_dimens.mf
+ \item knit_grid_cables.mf
+ \item knit_nogrid_cables.mf
+ \item knit_symbols.mf
+ \item knitg_sc_in.mf
+ \item knitg_sc_out.mf
+ \item knitgg.mf
+ \item knitgn.mf
+ \item knitgp.mf
+ \item knitn_sc_in.mf
+ \item knitn_sc_out.mf
+ \item knitnl.mf
+ \item knitnn.mf
+ \item knitnp.mf
+ \item knitnr.mf
+ \item knitw_sc_in.mf
+ \item knitw_sc_out.mf
+ \item knitwg.mf
+ \item knitwn.mf
+ \item knitwp.mf
\end{itemize}
\noindent knitting/fonts/tfm
\begin{itemize}
- \item knitgg.tfm
- \item knitgn.tfm
- \item knitgp.tfm
- \item knitnl.tfm
- \item knitnn.tfm
- \item knitnp.tfm
- \item knitnr.tfm
- \item knitwg.tfm
- \item knitwn.tfm
- \item knitwp.tfm
+ \item knitg_sc_in.tfm
+ \item knitg_sc_out.tfm
+ \item knitgg.tfm
+ \item knitgn.tfm
+ \item knitgp.tfm
+ \item knitn_sc_in.tfm
+ \item knitn_sc_out.tfm
+ \item knitnl.tfm
+ \item knitnn.tfm
+ \item knitnp.tfm
+ \item knitnr.tfm
+ \item knitw_sc_in.tfm
+ \item knitw_sc_out.tfm
+ \item knitwg.tfm
+ \item knitwn.tfm
+ \item knitwp.tfm
\end{itemize}
\noindent knitting/fonts/type1
\begin{itemize}
- \item knitgg.pfb
- \item knitgn.pfb
- \item knitgp.pfb
- \item knitnl.pfb
- \item knitnn.pfb
- \item knitnp.pfb
- \item knitnr.pfb
- \item knitwg.pfb
- \item knitwn.pfb
- \item knitwp.pfb
+ \item knitg_sc_in.pfb
+ \item knitg_sc_out.pfb
+ \item knitgg.pfb
+ \item knitgn.pfb
+ \item knitgp.pfb
+ \item knitn_sc_in.pfb
+ \item knitn_sc_out.pfb
+ \item knitnl.pfb
+ \item knitnn.pfb
+ \item knitnp.pfb
+ \item knitnr.pfb
+ \item knitw_sc_in.pfb
+ \item knitw_sc_out.pfb
+ \item knitwg.pfb
+ \item knitwn.pfb
+ \item knitwp.pfb
\end{itemize}
\noindent knitting/tex/latex
\begin{itemize}
- \item knitting.sty
- \item uknit.fd
+ \item knitting.sty
+ \item uknit.fd
\end{itemize}
\noindent knitting/tex/plain
\begin{itemize}
- \item knitting.tex
+ \item knitting.tex
\end{itemize}
\endgroup