summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-05 21:05:06 +0000
committerKarl Berry <karl@freefriends.org>2019-04-05 21:05:06 +0000
commitdbdaa8c3ce30ed3514c5b2e0fb227b06152ba7ca (patch)
tree6d56fc8f737ca2a0437037bbbb6d34e157e079dd /Master/texmf-dist/doc/fonts
parent8453b4092bc269968bd77aa4bf824035718fdec8 (diff)
knitting (5apr19)
git-svn-id: svn://tug.org/texlive/trunk@50782 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/fonts')
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/README11
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitexamples.pdfbin0 -> 92519 bytes
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitexamples.tex77
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitkey.pdfbin0 -> 223877 bytes
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitkey.tex52
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdfbin424098 -> 477772 bytes
-rw-r--r--Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex1499
7 files changed, 1013 insertions, 626 deletions
diff --git a/Master/texmf-dist/doc/fonts/knitting/README b/Master/texmf-dist/doc/fonts/knitting/README
index b4b2f9e3a25..649dead8457 100644
--- a/Master/texmf-dist/doc/fonts/knitting/README
+++ b/Master/texmf-dist/doc/fonts/knitting/README
@@ -2,9 +2,14 @@ This package is written to make it possible to write cable and lace
charts for knitting patterns using plain TeX or LaTeX. It provides fonts
of appropriate symbols and macros for their use.
-This package is released under the LaTeX Project Public License. See
-http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for
-the details of that license.
+This work 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.
As per the LPPL, no restrictions are placed on running this package. In
particular, no restrictions are placed by the package author on selling
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitexamples.pdf b/Master/texmf-dist/doc/fonts/knitting/knitexamples.pdf
new file mode 100644
index 00000000000..952bacbfc0d
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/knitting/knitexamples.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex b/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
index 6b98fcfbae8..e9e4e3ea223 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitexamples.tex
@@ -24,9 +24,9 @@
% 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/08/29
+% Date: 2019/04/03
%
-% Version: 2
+% Version: 3
\documentclass[draft]{article}
@@ -191,38 +191,47 @@
\definecolor{lightgreen}{rgb}{0.5,1,0.5}
\definecolor{yellow}{rgb}{1,1,0.35}
-\catcode `\^=\active
-% Since we aren't using math, we turn ^ into an active character
-\renewcommand{^}{\noindent{\purlpass{\color{lightgreen}}=}}
-% And then we can define it like a command
-% The \noindent is there to keep the row numbering working.
-
-\chart[right]{{
-\purlpass{\color{blue}} % = produces blue
--|--------------|
--|=--=--=--=--=-|
-=|--=--=-=--=--=|
-^|^=^^=^^^=^^=^^|
-^|=^^=^^=^^=^^=^|
-\purlpass{\color{green}} % = produces green
-=|^^=^^=^=^^=^^=|
-^|^=^^=^^^=^^=^^|
-\renewcommand{^}{\noindent{\purlpass{\color{yellow}}=}}
-% ^ produces yellow
-^|=^^=^^=^^=^^=^|
-=|^^=^^=^=^^=^^=|
-^|=^^=^^=^^=^^=^|
-\renewcommand{^}{\noindent{\purlpass{\color{lightgreen}}=}}
-% ^ produces light green
-^|^=^^=^^^=^^=^^|
-=|^^=^^=^=^^=^^=|
-\purlpass{\color{blue}} % = produces blue
-^|=^^=^^=^^=^^=^|
-^|^=^^=^^^=^^=^^|
-=|--=--=-=--=--=|
--|=--=--=--=--=-|
--|--------------|
-}}
+
+% 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
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitkey.pdf b/Master/texmf-dist/doc/fonts/knitting/knitkey.pdf
new file mode 100644
index 00000000000..e86cbe4c20a
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/knitting/knitkey.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitkey.tex b/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
index 046dbdd054e..fc50643144a 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitkey.tex
@@ -25,17 +25,18 @@
% 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/08/29
+% Date: 2019/04/03
%
-% Version: 2
+% Version: 3
-\documentclass{article}
+\documentclass{amsart}
\usepackage{knitting}
\usepackage[colorlinks]{hyperref}
% Choose your chart symbol font
\knitnogrid
\knitwide
+\knitmixed
\knitgrid
% \ifdesigner lets me easily hide all my comments to the designer and
@@ -124,11 +125,17 @@ exact definition should vary from pattern to pattern.
\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}}
@@ -140,11 +147,15 @@ for double decreases (and
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
+\clearpage
+
\section{General symbols}
\ifdesigner
@@ -156,6 +167,8 @@ substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
\textknit{(} and \textknit{)} are meant to indicate biased stitches, that is, stitches worked between increases and decreases. These are needed in charts for machine knitting; they also can make the chart easier to visualize.
+%If you use bobbles, be sure to define ssp tbl somewhere.
+
\medskip
\fi
@@ -173,6 +186,11 @@ substitute \textknit{\knitbox{B}{1}} for \textknit{b}.
\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.}
+\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.}
+\dblkeyrow{\textknit{[} or \textknit{]}}{Slip one as if to knit with yarn held to the wrong side.}
+\dblkeyrow{\textknit{\purlbackground{[}} or \textknit{\purlbackground{]}}}{Slip one as if to knit with yarn held to the right side.}
\keyrow{\textknit{\bobble{3}}}
{(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}
@@ -184,23 +202,19 @@ If you use bobbles, be sure to define ssp tbl somewhere.
\keyrow{\textknit{\bobble{5}}}
{(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.}
-\dblkeyrow{\textknit{[} or \textknit{]}}{Slip one as if to knit with yarn held to the wrong side.}
-\dblkeyrow{\textknit{\purlbackground{[}} or \textknit{\purlbackground{]}}}{Slip one as if to knit with yarn held to the right side.}
\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 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.}
+\keyrow{\textknit{\widesymbol{*}{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.}
+\keyrow{\textknit{111}}{Slip 1 as if to knit, knit 2, pass slipped stitch over both knitted stitches}{Slip 1 as if to purl, purl 2, pass slipped stitch over both purled stitches}
+\dblkeyrow{\textknit{???}}{Wrapped stitches: Knit 3 (RS) or purl 3 (WS) and then slide these three stitches to a cable needle. Move yarn to the right side and wrap yarn from left to right across these three stitches, then move yarn to wrong side and wrap yarn from right to left across these three stitches. You have just wrapped the yarn all the way around these three stitches once. Wrap yarn in this direction 2 more times, then slip stitches from cable needle to right needle and continue knitting.}
\hrule
\clearpage
\setcolwidths{3\stitchwd}
-\keyrow{\textknit{111}}{Slip 1 as if to knit, knit 2, pass slipped stitch over both knitted stitches}{Slip 1 as if to purl, purl 2, pass slipped stitch over both purled stitches}
-\dblkeyrow{\textknit{???}}{Wrapped stitches: Knit 3 (RS) or purl 3 (WS) and then slide these three stitches to a cable needle. Move yarn to the right side and wrap yarn from left to right across these three stitches, then move yarn to wrong side and wrap yarn from right to left across these three stitches. You have just wrapped the yarn all the way around these three stitches once. Wrap yarn in this direction 2 more times, then slip stitches from cable needle to right needle and continue knitting.}
+
\keyrow{\textknit{+++}}
{Horizontal cable (worked throughout with yarn held to back):
\par\emph{First stitch}: 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.
@@ -222,7 +236,7 @@ A horizontal cable should (usually) be preceded by a yarn over and followed by a
\medskip
\setcolwidths{\stitchwd}
-{\knitgrid
+{\ifgrid\else \knitgrid\fi
\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.}{Purl 2 together}
@@ -239,7 +253,8 @@ A horizontal cable should (usually) be preceded by a yarn over and followed by a
\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``}}}.
+\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|\widesymbol{W}{3}|.
+The symbols \textknit{0} and \textknit{\#} have no predetermined definitions; use them for whatever you need.
\medskip
@@ -267,6 +282,7 @@ A horizontal cable should (usually) be preceded by a yarn over and followed by a
\dblkeyrow{\textknit{w}}{Make 3 from 1: Knit (RS) or purl (WS) 1 through back loop, then through front loop of the same stitch, and slide stitch off the left needle. Then pick up the front strand of the stitch just worked, twist it and knit or purl it.}
\dblkeyrow{\textknit{W}}{As for \textknit{w}, but purl all stitches on RS and knit all stitches on WS.}
\keyrow{\textknit{E}}{(Knit 1, purl 1, knit 1) in next stitch}{(Purl 1, knit 1, purl 1) in next stitch}
+\keyrow{\textknit{\&}}{(Purl 1, knit 1, purl 1) in next stitch}{(Knit 1, purl 1, knit 1) in next stitch}
\keyrow{\textknit{Y}}{(Knit 1, yarn over, knit 1) in next stitch}{(Purl 1, yarn over, purl 1) in next stitch}
\hrule
@@ -321,7 +337,7 @@ first stitch, return first stitch on right needle to left needle.* Repeat from *
\ifdesigner
This is a comprehensive list of the cable symbols available in the grid
-fonts; more non-grid cable symbols are possible. (A few examples are at the end of this document.
+fonts; more non-grid cable symbols are possible. (A few examples are at the end of this document.)
\medskip
@@ -333,9 +349,9 @@ fonts; more non-grid cable symbols are possible. (A few examples are at the end
% These macros make it easy to change our keys to show more than one set of definitions.
% Key showing two or three symbols
-%\newcommand\cableset[3]{\textknit{#1}\ifgrid\par\vspace{3pt}\textknit{#2}\par\vspace{3pt}\textknit{#3}\fi}
-\newcommand\cableset[3]{\textknit{#1}\ifgrid\hspace{3pt}\textknit{#2}\fi}
-\newcommand\twistset[2]{\textknit{#1}\ifgrid\hspace{3pt}\textknit{#2}\fi}
+%\newcommand\cableset[3]{\textknit{#1}\ifknitsymbol\else\par\vspace{3pt}\textknit{#2}\par\vspace{3pt}\textknit{#3}\fi}
+\newcommand\cableset[3]{\textknit{#1}\ifknitsymbol\else\hspace{3pt}\textknit{#2}\fi}
+\newcommand\twistset[2]{\textknit{#1}\ifknitsymbol\else\hspace{3pt}\textknit{#2}\fi}
% Most basic key
%\newcommand\cableset[3]{\textknit{#1}}
@@ -428,7 +444,7 @@ fonts; more non-grid cable symbols are possible. (A few examples are at the end
\setcolwidths{6\stitchwd}
%\newcommand\cablepair[2]{\textknit{#1}}
-\newcommand\cablepair[2]{\textknit{#1}\ifgrid \par\vspace{7pt}\par\textknit{#2}\fi}
+\newcommand\cablepair[2]{\textknit{#1}\ifknitsymbol\else \par\vspace{7pt}\par\textknit{#2}\fi}
\noindent
\keyrow{\cablepair{Kpk}{Kpd}}{
diff --git a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.pdf
index f8d154687dd..c721277ffee 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 bf6d09ab5bc..da025bef971 100644
--- a/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex
+++ b/Master/texmf-dist/doc/fonts/knitting/knitting-doc.tex
@@ -1,10 +1,10 @@
% knitting-doc.tex
%
-% Provides documentation for the knitting package (knitting.sty)
+% Provides documentation for the knitting package
%
% author: Ariel Barton
%
-% Copyright Ariel Barton, 2010
+% Copyright Ariel Barton, 2010-2019
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -20,12 +20,12 @@
% The complete list of files considered part of this work is in
% the file `knitting-doc.pdf' and later in this file.
%
-% Date: 2010/08/29
+% Date: 2019/04/03
%
-% Version: 2
+% Version: 3
\documentclass[draft]{amsart}
-% Do not remove the [draft] option; we need it to explain something
+% Do not remove the [draft] option; we need it to explain something
% in Section 5.
\usepackage{knitting}
@@ -39,6 +39,7 @@
\hyphenation{auto-number-chart}
\usepackage[draft=false,pdfborder={0 0 0}]{hyperref}
+\DeclareRobustCommand{\SkipTocEntry}[5]{}
\title{The \textsf{knitting} package}
@@ -51,6 +52,12 @@
\maketitle
+\tableofcontents
+
+%\listoffigures
+
+%\listoftables
+
This package was written to make knitting charts using \LaTeX\ or plain
\TeX. It consists of several PostScript fonts of knitting symbols,
font-support documents, and packages of commands.
@@ -58,7 +65,7 @@ font-support documents, and packages of commands.
Here's an example of the code and output:
\begin{center}
\begin{minipage}[b]{108pt}
-\obeylines\parindent=0pt\tt
+\obeylines\parindent=0pt\tt
\verb|\chart{|
=CCppggKKCCppggKK=
===KKkk====KKkk===
@@ -86,13 +93,13 @@ Here's an example of the code and output:
\end{minipage}
\end{center}
-More examples may be found in the file \texttt{knitexamples.tex} and in
+More examples may be found in the file \texttt{knitexamples.tex} and in
later sections of this document.
\section{License}
-This work (the \textsf{knitting} package) consists of all files listed
-in \autoref{se:manifest}. It is copyright Ariel Barton, 2010.
+This work (the \textsf{knitting} package) consists of all files listed
+in \autoref{sec:manifest}. It is copyright Ariel Barton, 2011--2019.
This work may be distributed and/or modified under the
conditions of the \LaTeX\ Project Public License, either
@@ -100,7 +107,7 @@ version 1.3 of this license or (at your option) any
later version.
The latest version of the license is in
\begin{quote}
-\href {http://www.latex-project.org/lppl.txt}
+\href {http://www.latex-project.org/lppl.txt}
{http://www.latex-project.org/lppl.txt}
\end{quote}
and version 1.3 or later is part of all distributions of
@@ -110,12 +117,12 @@ 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
-\autoref{se:manifest}. This license (loosely speaking) allows you to
+\autoref{sec: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
-files only}, may be freely copied, verbatim or modified, into any
-document you write, without restriction.
+entirety. In addition, any part, no matter how large or small, of the
+files \texttt{knitkey.tex} and \texttt{knitexamples.tex}, \emph{and
+these two files only}, may be freely copied, verbatim or modified, into
+any document you write, without restriction.
As per the conditions of the LPPL, no restrictions are placed on running
this package (i.e., compiling \LaTeX\ documents that use this package).
@@ -125,7 +132,7 @@ all \LaTeX\ packages may be used in commercial products; if you use
other packages to produce a PDF or paper document, you must check their
documentation to see if you are allowed to sell the result.
-Suggestions and questions may be sent to the package author at
+Suggestions and questions may be sent to the package author at
\texttt{origamist@\allowbreak gmail.com}.
\section{Installation}
@@ -142,15 +149,15 @@ there, create it.
If you're using MiK\TeX, it is possible to designate any folder you like
as the root of your local tree, that is, the place where you store
-supporting files. Instructions may be found at
+supporting files. Instructions may be found at
\href{http://docs.miktex.org/manual/localadditions.html\#id573803}
{\texttt{http:/\slash docs.miktex.org\slash manual\slash localadditions.html\allowbreak\#id573803}}
or through the manual which should have come with MiKTeX.
Any time you add supporting files to a local MiKTeX root, you have to
-refresh the file name database; see
+refresh the file name database; see
\href{http://docs.miktex.org/manual/configuring.html\#fndbupdate}
-{\texttt{http:/\slash docs.miktex.org\slash manual\slash configuring.html\allowbreak\#fndbupdate}}. }
+{\texttt{http:/\slash docs.miktex.org\slash manual\slash configuring.html\allowbreak\#fndbupdate}}. }
All supporting files should be sorted into specific subfolders of
\texttt{texmf}. The sorting rules are:
\begin{itemize}
@@ -176,29 +183,24 @@ documentation should tell you where.
If you really can't figure out where to put the files, if you're in a
hurry, or if you're using someone else's computer and don't want to mess
with their \texttt{texmf} folder, just dump every file you think you
-might need into the same folder as the document that uses the package. (This is probably all the \texttt{.tfm}, \texttt{.pfb}, and \texttt{.map} files, plus the \texttt{.sty} and \texttt{.fd} files if you are using \LaTeX\ or the \texttt{.tex} file if you are using plain \TeX.)
-
-You aren't done! \TeX\ now knows everything it needs to do its job and \emph{arrange} the characters in the font, and so your document will compile, but the postprocessing software (your DVI viewer, your printer, or the PDF files that pdf\/\TeX\ produces) don't know about the fonts themselves.
+might need into the same folder as the document that uses the package.
+(This is probably all the \texttt{.tfm}, \texttt{.pfb}, and
+\texttt{.map} files, plus the \texttt{.sty} and \texttt{.fd} files if
+you are using \LaTeX\ or the \texttt{.tex} file if you are using plain
+\TeX.)
+
+You aren't done! \TeX\ now knows everything it needs to do its job and
+\emph{arrange} the characters in the font, and so your document will
+compile, but the postprocessing software (your DVI viewer, your printer,
+or the PDF files that pdf\/\TeX\ produces) don't know about the fonts
+themselves.
There's a simple way to tell pdf\/\TeX\ about the fonts: use the command
\begin{quote}\verb|\pdfmapfile{+knitfont.map}|\end{quote}
-or the lines
-\begin{quote}
-\verb|\pdfmapline{+knitgn\space <knitgn.pfb}|\\
-\verb|\pdfmapline{+knitwn\space <knitwn.pfb}|\\
-\verb|\pdfmapline{+knitnn\space <knitnn.pfb}|\\
-\verb|\pdfmapline{+knitgp\space <knitgp.pfb}|\\
-\verb|\pdfmapline{+knitwp\space <knitwp.pfb}|\\
-\verb|\pdfmapline{+knitnp\space <knitnp.pfb}|\\
-\verb|\pdfmapline{+knitnl\space <knitnl.pfb}|\\
-\verb|\pdfmapline{+knitnr\space <knitnr.pfb}|\\
-\verb|\pdfmapline{+knitgg\space <knitgg.pfb}|\\
-\verb|\pdfmapline{+knitwg\space <knitwg.pfb}|
-\end{quote}
-These map lines can go in \texttt{uknit.fd},
-\texttt{knitting.sty}, or the file that uses the package.
+This map line can go in
+\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
+%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}
@@ -207,11 +209,7 @@ These map lines can go in \texttt{uknit.fd},
%It goes in \texttt{texmf/fonts/enc}.
The advantage to this is that it involves nothing outside of the
-document you are compiling. Also, the \verb.\pdfmapline. command is
-part of pdf\/\TeX, and has been since 2004 (and \verb.\pdfmapfile. is
-even older); any distribution of \TeX\ installed or updated in the last
-five years will be able to deal with the exact syntax above.
-
+document you are compiling.
On the other hand, it can be annoying to have to say that everywhere.
And this doesn't work at all if you decide you want to produce DVI files
and use a postprocessor such as \textsf{dvips}.
@@ -221,235 +219,548 @@ cause \textsf{dvips}, \textsf{dvipdfm}, and pdf\/\TeX\ to know about
these fonts by opening a Terminal window (command prompt) and typing
{\tt updmap -{}-enable Map=knitfont.map}.
-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.
+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.
+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:
+Here is a minimal \LaTeX\ document that will produce a knitting pattern with a chart:
-\begin{itemize}
+\bigskip
-\item \verb|\chart|, the command that draws a chart.
+\begin{minipage}{0.45\textwidth}
+\begin{verbatim}
+\documentclass{article}
+\usepackage{knitting}
+\begin{document}
+Here is my chart:
+\chart{
+--OAO--
+<O---O>
+-<O-O>-
+}
+\end{document}
+\end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}{0.45\textwidth}
+Here is my chart:
+\chart{
+--OAO--
+<O---O>
+-<O-O>-
+}
+\end{minipage}
-\item \verb|\textknit|. This command is meant to be used for writing chart keys. It typesets its argument using knitting symbols and puts it in an unbreakable box, which may appear in a table or even in the middle \textknit{Kp} of a paragraph.
+\bigskip
-\end{itemize}
+Here is a minimal plain \TeX\ document that will do the same thing:
-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.
+\bigskip
-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.
+\begin{minipage}{0.45\textwidth}
+\begin{verbatim}
+\input knitting
+Here is my chart:
+\chart{
+--OAO--
+<O---O>
+-<O-O>-
+}
+\bye
+\end{verbatim}
+\end{minipage}
+\hfill
+\begin{minipage}{0.45\textwidth}
+Here is my chart:
+\chart{
+--OAO--
+<O---O>
+-<O-O>-
+}
+\end{minipage}
-These redefined commands do \emph{not} work in concert with \verb|\textknit|.
+\bigskip
-\subsection{Commands affecting overall appearance}
+\begin{figure}
+\caption{The normal symbols}\label{fig:symbols}
+\newcommand\knitrow[1]{\texttt{#1}&\knitgrid\textknit{#1}&\knitnogrid \textknit{#1}\\}
+\newcommand\displaypair[2]{\texttt{#2}&\knitgrid\textknit{#1}&\knitnogrid \textknit{#1}\\}
+\begin{tabular}[t]{|ccc|}
+\hline
+\knitrow{-}
+\knitrow{=}
+\knitrow{<}
+\knitrow{>}
+\knitrow{;}
+\knitrow{:}
+\knitrow{L}
+\knitrow{R}
+\knitrow{l}
+\knitrow{r}
+\knitrow{A}
+\knitrow{a}
+\knitrow{!}
+\knitrow{2}
+\knitrow{3}
+\knitrow{4}
+\knitrow{5}
+\knitrow{m}
+\knitrow{M}
+\knitrow{O}
+\knitrow{*}
+\hline
+\end{tabular}
+\hfill
+\begin{tabular}[t]{|ccc|}
+\hline
+\knitrow{t}
+\knitrow{T}
+\knitrow{x}
+\knitrow{X}
+\knitrow{b}
+\knitrow{B}
+\knitrow{q}
+\knitrow{Q}
+\knitrow{v}
+\knitrow{V}
+\knitrow{y}
+\knitrow{u}
+\knitrow{0}
+\knitrow{\#}
+\knitrow{w}
+\knitrow{W}
+\knitrow{E}
+\knitrow{\&}
+\knitrow{Y}
+\knitrow{6}
+\knitrow{@}
+%\knitrow{0}
+\hline
+\end{tabular}
+\hfill
+\begin{tabular}[t]{|ccc|}
+\hline
+\knitrow{(}
+\knitrow{)}
+\knitrow{i}
+\knitrow{I}
+\knitrow{j}
+\knitrow{J}
+\knitrow{h}
+\knitrow{H}
+\knitrow{s}
+\knitrow{S}
+\knitrow{[}
+\knitrow{]}
+\knitrow{z}
+\knitrow{Z}
+\knitrow{9}
+\knitrow{U}
+\knitrow{f}
+\knitrow{F}
+\knitrow{7}
+\knitrow{8}
+\knitrow{"}
+\hline
+\end{tabular}
+\hfill
+\begin{tabular}[t]{|ccc|}
+\hline
+\knitrow{""}
+\knitrow{,.,}
+\knitrow{'`'}
+\knitrow{111}
+\knitrow{???}
+\knitrow{+++}
+\knitrow{+/+}
+\displaypair{\|}{\char`\\|}
+\displaypair{\!}{\char`\\!}
+\knitrow{kK}
+\knitrow{pK}
+\displaypair{\bobble 5}{\char`\\\char`\@5}
+\displaypair{\narrowincrease 5}{\char`\\<5}
+\displaypair{\narrowdecrease 5}{\char`\\>5}
+\displaypair{\pnarrowincrease 5}{\char`\\[5}
+\displaypair{\pnarrowdecrease 5}{\char`\\]5}
+\displaypair{\wideincrease{4}}{}
+\displaypair{\widedecrease{4}}{}
+&\knitgrid\textknit{\knitbox{3}{3}}&\knitmixed\textknit{\Knit{3}{3}}\\
+\hline
+\multicolumn{3}{p{1.85in}}{\rule{0pt}{10pt}See \autoref{sec:fancystitches} for the commands for the last eight rows.}
+\end{tabular}
+\end{figure}
-\begin{itemize}
+To draw your own chart, you first need access to various knitting symbols. They are produced inside charts using normal letters: \texttt{A} produces \textknit{A}, \texttt{O} produces \textknit{O}, and so on. An almost-complete typing key is provided in \autoref{fig:symbols}. The file \texttt{knitkey.tex} contains my suggested meanings for all the available symbols.
-\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.
+Ways to modify these symbols are described in \autoref{sec:fancystitches}.
-\item In \LaTeX, you can change the sizes of the chart symbols with the usual commands \verb|\small|, \verb|\large|, etc.
+Some commands to change the overall appearance of the charts or the document are given in \autoref{sec:fourfonts}.
-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.
+Sometimes a part of a knitting chart (usually a repeat) should be outlined; the machinery to do so is described in \autoref{sec:outline}.
-\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.
+Some miscellaneous commands, including control over the various grays and colors used in knitting charts, are described in \autoref{sec:color}. The behavior of spaces and carriage returns in the input is described in \autoref{sec:spacein}.
-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).
+Cable symbols such as {\knitgrid\textknit{Kk} or \knitmixed\textknit{Kk}} are complicated; they are described in \autoref{sec:cables}.
-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).
+Finally, \textsf{knitting} will count rows and stitches for you automatically; the machinery to do so is described in
+\autoref{sec:rowcount} and
+\autoref{sec:counting}.
-For some reason, \verb|smallpage| won't work if your small page only has one line. Also, your PDF viewer may cut off a few pixels around the edges.
-This command doesn't work with dvi-\TeX; this is a pdf\/\TeX\ command only.
+These sections describe the commands defined by \textsf{knitting}.
+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.
-\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.)
+The command \verb|\chart| is fairly complicated, and as such, may be prone to strange behavior when used with other commands. An alternative command, \verb|\textknit|, may be used inside of, for example, a tabular environment with less risk of unexpected behavior. This is useful for writing chart keys.
-\end{itemize}
+Most of the commands labeled with $\star$ do \emph{not} work in concert
+with \verb|\textknit|. Also, \textknit{\#} and
+\textknit{\&} must be accessed with \verb|\textknit{\#}| and
+\verb|\textknit{\&}|, not \verb|\textknit{#}| and \verb|\textknit{&}|.
+(Unadorned \verb|#| and~\verb|&| may be used with \verb|\chart|.)
-\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}
+\subsection{Stitch symbols produced or modified with commands}
+\label{sec:fancystitches}
+
+You can generate new symbols with the command \verb|\knitbox|: \textknit{\knitbox{a}{1}} \textknit{\knitbox{Cable 6 left}{6}}. A great many strange symbols are available by using math symbols:
+\begin{quote}
+\verb|\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}| \chart{\knitbox{$\vspace{-1.5pt}\heartsuit$}{1}}. \end{quote}
+However, these may look a little incongruous with the rest of the font, so use with care.
+
+Here are some other commands that produce particular symbols:
+
+\medskip
+
+\newcommand\myminitable[1]{\begin{tabular}[t]{@{}lc@{}}#1
+\end{tabular}}
+
+
+\noindent
+\begin{tabular}{lcc}
+Command&\texttt{\char`\\chart}-only shorthand&Symbol\\
+\texttt{\char`\\wideincrease\char`\{3\char`\}}& & \textknit{\wideincrease{3}}\\
+\texttt{\char`\\widedecrease\char`\{3\char`\}}& & \textknit{\widedecrease{3}}\\
+\texttt{\char`\\bobble\char`\{3\char`\}}&\verb|\@| & \textknit{\bobble{3}}\\
+\texttt{\char`\\narrowincrease\char`\{3\char`\}}&\verb|\<| & \textknit{\narrowincrease{3}}\\
+\texttt{\char`\\narrowdecrease\char`\{3\char`\}}&\verb|\>| & \textknit{\narrowdecrease{3}}\\
+\texttt{\char`\\pnarrowincrease\char`\{3\char`\}}&\verb|\[| & \textknit{\pnarrowincrease{3}}\\
+\texttt{\char`\\pnarrowdecrease\char`\{3\char`\}}&\verb|\]| & \textknit{\pnarrowdecrease{3}}\\
+& $\sim$& Empty space
+\end{tabular}
+
+\medskip
+
+The arguments to \verb|\wideincrease| and \verb|\widedecrease| must be numbers; they are the width (in stitches). The arguments to \verb|\bobble| and so on may be any text (although you will probably use numbers). The \texttt{\char`\\chart}-only shorthand may be used inside \verb|\chart|s but not inside \verb|\textknit|.
+
+The $\sim$ should be used on the edges of non-rectangular charts:
+\bigskip
+
+\begin{minipage}{0.45\textwidth}
+\begin{verbatim}
+====
+~===
+~~==
+~~~=
+\end{verbatim}
\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}
+\begin{minipage}{0.45\textwidth}
+\chart{
+====
+~===
+~~==
+~~~=
}
\end{minipage}
-\end{figure}
+
+\bigskip
+You can also use $\sim$ inside a chart, although \verb|`|, \verb|'| or \verb|.| may be better choices. (Do not use $\sim$ on its own line; if you need a blank line in a cable chart, use~\verb|`|.)
+
+Here are some commands that modify or reaarrange existing symbols in odd ways:
\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}.
-For better results, use \verb|\rnleft| on the left edge and \verb|\rnright| on
-the right edge.
+\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}|.
-If you want to skip a few row numbers, you can say
-\verb|\addtocounter|\allowbreak\verb|{rownumber}{-3}| (\LaTeX) or \verb|\global|
-\verb|\advance| \verb|\rownumber| \verb|by -3| (plain \TeX).
+\item \verb|\widesymbol| places a symbol or sequence of symbols in a box of a given width: {\knitgrid \verb|\widesymbol{W}{2}| \textknit{\widesymbol{W}{2}}}. In other words, \verb|\widesymbol| behaves like \verb|\knitbox|, but typesets its first argument using the knit symbol font rather than a Roman font.
-\verb|\chart| will usually automatically arrange things so that the
-last \verb|\rn| produces a~1. If you want numbers in different charts
-to be numbered consecutively (e.g., if they are pieces of one big
-chart), you can turn this behavior off with \verb|\resetrnfalse| and
-back on with \verb|\resetrntrue|. You can then reset the row numbers
-with \verb|\setcounter{rownumber}{20}|; all future charts will count
-down from there.
+\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{sec: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}}}. \verb|\cableforeground| and \verb|\cablebackground| may be used for similar effects.
-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.)
+\end{itemize}
-\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.
+\noindent
+And here are some commands designed to deal with long sequences of knits and purls in a chart, although \verb|\knitbox| can be used to generate other symbols:
-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.
+\begin{itemize}
-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.
+\item \verb|\knit| and \verb|\purl|. These macros take one argument each and type out that many plain knit or plain purl symbols.
-\item[$\star$] Inside an auto-numbered chart, \verb|\nonumber| skips the next row number.
+\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''. The first argument is text to appear inside the box; the second is the desired width of the box (in units of one stitch).
-\item[$\star$] To number the stitches (by producing a \emph{row} of stitch numbers), you can use the command \verb|\numberrow|. It takes three arguments: the first number to be printed, the countdown (how often to print intermediate numbers), and the last number to be printed.
+They look like this:
+\begin{quote}\raggedright
+\knitgrid
+\verb|\knitgrid|\\
+\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}}
+\knitmixed
+\verb|\knitmixed|\\
+\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|\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}
-\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.
+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.
-\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.
+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
+\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}
\end{itemize}
-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}
+\subsection[Overall appearance]{The four knitting fonts and other commands affecting overall appearance}
-\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.
+\label{sec:fourfonts}
+\begin{itemize}
+
+\item There are four available knitting fonts. They are selected with
+the commands \verb|\knitgrid|, \verb|\knitnogrid|, \verb|\knitwide|,
+\verb|\knitmixed|. These commands should be used outside the chart they
+are to affect. See \autoref{fig:fourfonts} or the end of this section for a discussion of when each
+font should be used.
+
+\item In \LaTeX, you can change the sizes of the chart symbols with the
+usual commands \verb|\small|, \verb|\large|, etc.
+
+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.
+
+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).
+
+For some reason, \verb|smallpage| won't work if your small page only has
+one line. Also, your PDF viewer may cut off a few pixels around the
+edges.
+
+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 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.)
+
+The \textsf{geometry} package now has the ability to change page
+dimensions mid-document, which affords much more flexibility than the
+\texttt{fullpages} environment; the \texttt{fullpages} environment is
+retained only for reasons of backwards compatibility.
+
+\end{itemize}
+
+\begin{figure}
+\caption{Suggested use of the fonts}
+\label{fig:fourfonts}
+\medskip
+\small
+\begin{tabular}[b]{lcp{220pt}}
+Font & Example & Suggested use \\
+\texttt{\char`\\knitgrid} & \knitgrid \textknit{A-Kp-} & Most simple patterns\\
+\texttt{\char`\\knitwide} & \knitwide \textknit{AKp-} & Colorwork\\
+\texttt{\char`\\knitmixed} & \knitmixed \textknit{A-Kp-} & Patterns with complicated cables; patterns that use \texttt{\char`\\Knit} and \texttt{\char`\\Purl} to deal with altered stitch counts \\
+\texttt{\char`\\knitnogrid} & \knitnogrid \textknit{A-Kp-} & Patterns that use empty squares (``no stitch'' symbols) to deal with altered stitch counts\\
+\end{tabular}
+\end{figure}
+
+
+The suggested uses of the four knitting fonts are summarized in \autoref{fig:fourfonts}.
+I prefer to draw most charts with \texttt{\char`\\knitgrid}. However, there are some situations where each of the other four fonts is more useful.
-\subsection{Repeat outlines}
+The cells in the \texttt{\char`\\knitwide} fonts are the approximate dimensions of a knit stitch, so a colorwork chart done using the \texttt{\char`\\knitwide} font will look more like the finished piece than a colorwork chart done using \texttt{\char`\\knitgrid}.
+However, if a chart does not display wrong-side rows, the chart will not have the same proportions as the finished result. Also, lace is often blocked severely, and cables pull in. Thus, such charts will not have the same proportions as the finished piece, even if drawn with \texttt{\char`\\knitwide}; \texttt{\char`\\knitgrid} is probably a better choice.
+
+The \texttt{\char`\\knitgrid} cables look better than the \texttt{\char`\\knitnogrid} cables; however, wide cables, as well as cables involving increases, decreases, ribbing, and so on, can be expressed much more clearly with \texttt{\char`\\knitnogrid} or \texttt{\char`\\knitmixed}.
+
+Finally, many knitting patterns exist that have more stitches in some rows than in others. This is usually expressed by using special ``no stitch'' symbols:
+
+\bigskip
+
+\noindent
+\begin{minipage}[t]{60pt}
+\knitnogrid
+\chart{
+-.A.-
+-----
+-.w.-}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{60pt}
+\knitmixed
+\chart{
+-.A.-
+-----
+-.w.-}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{60pt}
+\knitgrid
+\chart{
+-.A.-
+-----
+-.w.-}
+\end{minipage}
+
+\bigskip
+
+It is my feeling that the empty gaps of \texttt{\char`\\knitnogrid} are the clearest way to express this, and thus \texttt{\char`\\knitnogrid} should be preferred in charts that involve ``no stitch'' blocks.
+
+However, in some patterns, we can omit knit or purl symbols to keep the chart the same width. This is best done using \texttt{\char`\\purlbox} or \texttt{\char`\\Purl}:
+
+\bigskip
+
+\noindent
+\begin{minipage}[t]{108pt}
+\knitnogrid
+\chart{
+====A====
+\purlbox{4}{3}---\purlbox{4}{3}
+====w====}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{108pt}
+\knitmixed
+\chart{
+====A====
+\Purl{4}{3}---\Purl{4}{3}
+====w====}
+\end{minipage}
+\hfill
+\begin{minipage}[t]{108pt}
+\knitgrid
+\chart{
+====A====
+\purlbox{4}{3}---\purlbox{4}{3}
+====w====}
+\end{minipage}
+
+\bigskip
+
+You may feel that such things look better if a grid is involved. (I do.) This is a way to avoid ``no stitch'' boxes with \texttt{\char`\\knitgrid} or \texttt{\char`\\knitmixed}; again, the presence of complicated cables probably determines which you should use.
+
+
+\clearpage\subsection{Repeat outlines}
+\label{sec:outline}
+
+As illustrated in \autoref{fig:outlineex}, there are ways to outline part of a knitting chart.
\begin{figure}
\caption{Outline examples}\label{fig:outlineex}
+%\renewcommand \printrightrownumber[1]{\knitleftarrowhead\smash{\rule[-\stitchdp]{1pt}{\stitchht}}{\color{rncolor}\textnormal{#1}}}
+
+\medskip
+
\advance\hsize 60pt
\noindent \hskip -30pt
-\begin{minipage}[b]{3in}
+\begin{minipage}[b]{3.2in}
\obeylines
-\verb?\definecolor{knitlinecolor}{rgb}{0,0,0.8}?
-\verb?\setcounter{rownumberskip}{2}?
-\verb?\chart{?
+\rlap{\texttt{\char`\\definecolor\char`\{knitlinecolor\char`\}\char`\{rgb\char`\}\char`\{0,0.5,0.8\char`\}}}
+\verb?\chart[right]{?
\verb? ---|---|- ?
\verb? -\overline{--|---|-}?
\verb?~\={2}~\={2}~ \\ -|---|--- ?
\verb?~\={2}~\={2}~ \\ ---|---|- ?
\verb?\vspace{12pt}?
-\verb? ---\!---\!-?
-\verb? -\overline*{--\!---\!-}?
-\verb?~\_\_~\_\_~ \\ -\!---\!--- ?
-\verb?~\_\_~\_\_~ \\ ---\!---\!- ?
+\verb? -\cableleft{--\!}{--}--?
+\verb? \-{7} \\ ---\!---\!-?
+\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{
- ---|---|-
+\definecolor{knitlinecolor}{rgb}{0,0.5,0.8}
+\chart[right]{
+ ---|---|-
-\overline{--|---|-}
-~\={2}~\={2}~ \\ -|---|---
-~\={2}~\={2}~ \\ ---|---|-
-\vspace{12pt} ---\!---\!-
- -\overline*{--\!---\!-}
-~\_\_~\_\_~ \\ -\!---\!---
-~\_\_~\_\_~ \\ ---\!---\!-
-\nonumber``}
+~\={2}~\={2}~ \\ -|---|---
+~\={2}~\={2}~ \\ ---|---|-
+\vspace{12pt}
+ -\cableleft{--\!}{--}--
+ \-{7} \\ ---\!---\!-
+ -\overline*{--\!---\!-}
+~\_\_~\_\_~ \\ -\!---\!---
+~\_\_~\_\_~ \\ ---\!---\!-
+\vspace{12pt}
+}
+\chart{}
\vspace{0pt}
\end{minipage}%
\hfill
\begin{minipage}[b]{110pt}
\knitgrid
-\definecolor{knitlinecolor}{rgb}{0,0,0.8}
-\setcounter{rownumberskip}{2}
-\chart{ ---|---|-
+\definecolor{knitlinecolor}{rgb}{0,0.5,0.8}
+\chart[right]{
+ \\ ---|---|-
-\overline{--|---|-}
-~\={2}~\={2}~ \\ -|---|---
-~\={2}~\={2}~ \\ ---|---|-
-\vspace{12pt} ---\!---\!-
- -\overline*{--\!---\!-}
-~\_\_~\_\_~ \\ -\!---\!---
-~\_\_~\_\_~ \\ ---\!---\!-
-\nonumber``}
+~\={2}~\={2}~ \\ -|---|---
+~\={2}~\={2}~ \\ ---|---|-
+\vspace{12pt}
+\vspace{12pt}
+ \-{7} \\ ---\!---\!-
+ -\overline*{--\!---\!-}
+~\_\_~\_\_~ \\ -\!---\!---
+~\_\_~\_\_~ \\ ---\!---\!-
+\vspace{12pt}
+}
\vspace{0pt}
\end{minipage}
\end{figure}
@@ -461,102 +772,51 @@ You can change the appearance of the rownumbers by renewing the commands \texttt
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.
+\item[$\star$] A line that goes across the chart can be specified with \verb|\-|, which takes an argument (the width of the overlining in stitches). This has starred forms and unstarred forms, like \verb|\overline|.
+
\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*|.
\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.
-You can get short horizontal lines to go with \verb?\!? by using \verb|\_|; it should be positioned using tildes~\texttt{\char`\~}.
-
-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.
+You can get short horizontal lines to go with \verb?\!? by using \verb|\_|; it should be positioned using tildes~\texttt{\char`\~}.
-If you use your horizontal lines on the edge of the chart, you should use \verb|\-|, which like \verb|\=| takes an argument.
+If you want to use short horizontal lines between two \verb?\|?s, you should use the command \verb|\=|, which like \verb|\-| takes an argument. (This will look wrong if you use it at the edge of a chart; it's better to use \verb|\overline| or \verb|\underline|.)
\end{itemize}
-\subsection{Colors}
-
-\begin{itemize}
+\clearpage
-\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.
+\subsection{Colors and miscellaneous commands}
+\label{sec:color}
-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.
+\textsf{knitting} uses several colors and shades of gray to draw charts. You can customize these.
-\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.
+The \LaTeX\ package \texttt{knitting.sty} loads the \textsf{color} package and uses it to define colors; so the color of purl stitches is accessed via \verb|\color{purlgray}|. 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 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.
-
-\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.)
-
-\end{itemize}
-
-\subsection{Stitch symbols produced or modified with commands}
+\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. Redefining colors in plain \TeX\ is complicated and driver-dependent; read \texttt{knitting.tex} itself to get an idea of the color definition syntax.
\begin{itemize}
-\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 \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}
+\item \verb|purlgray| is the color of the purl background.
-\item[$\star$] Inside a knitting chart (but not after \verb|\textknit|), the shorter commands \verb|\@|, \verb|\<|, \verb|\>|, \verb|\[|, and \verb|\]| are available.
+\item \texttt{gridcolor} is the color of the grid lines in the grid fonts.
-\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}}}.
+\item \texttt{knitlinecolor} controls the lines produced by \verb?\!?,~\verb?|?, \verb|\=|, \verb|\_|, \verb|\-|, \verb|\overline|, and \verb|\underline|.
-\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
-\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}
-
-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.
-
-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
-\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}
+\item \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. See \autoref{sec:rowcount} and \autoref{sec:counting}.
\end{itemize}
-\subsection{Miscellaneous commands}
+There are also some commands you might want to use:
\begin{itemize}
-\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:
+\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 fonts do 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}
-\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 \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. 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.}
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|.
@@ -564,209 +824,36 @@ You can change \verb|\knitlinewd| with \verb|\setlength|; however, \verb|\knitli
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.
-\item The boolean variables \verb|\ifgrid| and \verb|\ifchartsonly| are standard \TeX\ conditionals: they may be used as
+\item The boolean variables \verb|\ifgrid|, \verb|\ifknitsymbol| 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}
-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.
+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. (\verb|\ifgrid| distinguishes between \verb|\knitnogrid| and the other three options; \verb|\ifknitsymbol| distinguishes between \verb|\knitnogrid|\slash\verb|\knitmixed| and \verb|\knitgrid|\slash\verb|\knitwide|.)
\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|.
\end{itemize}
-%\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}\\}
-\newcommand\displaypair[2]{\texttt{#2}&\knitgrid\textknit{#1}&\knitnogrid\textknit{#1}\\}
-\begin{tabular}[t]{|ccc|}
-\hline
-\knitrow{-}
-\knitrow{=}
-\knitrow{<}
-\knitrow{>}
-\knitrow{;}
-\knitrow{:}
-\knitrow{L}
-\knitrow{R}
-\knitrow{l}
-\knitrow{r}
-\knitrow{A}
-\knitrow{a}
-\knitrow{!}
-\knitrow{2}
-\knitrow{3}
-\knitrow{m}
-\knitrow{M}
-\knitrow{O}
-\knitrow{9}
-\hline
-\end{tabular}
-\hfill
-\begin{tabular}[t]{|ccc|}
-\hline
-\knitrow{t}
-\knitrow{T}
-\knitrow{x}
-\knitrow{X}
-\knitrow{b}
-\knitrow{B}
-\knitrow{q}
-\knitrow{Q}
-\knitrow{v}
-\knitrow{V}
-\knitrow{y}
-\knitrow{u}
-\knitrow{4}
-\knitrow{5}
-\knitrow{w}
-\knitrow{W}
-\knitrow{E}
-\knitrow{Y}
-\knitrow{6}
-%\knitrow{0}
-\hline
-\end{tabular}
-\hfill
-\begin{tabular}[t]{|ccc|}
-\hline
-\knitrow{(}
-\knitrow{)}
-\knitrow{i}
-\knitrow{I}
-\knitrow{j}
-\knitrow{J}
-\knitrow{h}
-\knitrow{H}
-\knitrow{s}
-\knitrow{S}
-\knitrow{[}
-\knitrow{]}
-\knitrow{z}
-\knitrow{Z}
-\knitrow{U}
-\knitrow{f}
-\knitrow{F}
-\knitrow{7}
-\knitrow{8}
-\hline
-\end{tabular}
-\hfill
-\begin{tabular}[t]{|ccc|}
-\hline
-\knitrow{@}
-\knitrow{"}
-\knitrow{""}
-\knitrow{*}
-\displaypair{\bobble 5}{\char`\\\char`\@5}
-\displaypair{\narrowincrease 5}{\char`\\<5}
-\displaypair{\narrowdecrease 5}{\char`\\>5}
-\displaypair{\pnarrowincrease 5}{\char`\\[5}
-\displaypair{\pnarrowdecrease 5}{\char`\\]5}
-\knitrow{,.,}
-\knitrow{'`'}
-\knitrow{111}
-\knitrow{???}
-\knitrow{+++}
-\knitrow{+/+}
-\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 \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}
+\subsection{Spaces in the input}
+\label{sec:spacein}
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|.)
+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.) (Similarly, \verb?|? and \verb?#? are redefined inside knitting charts, so that \verb?|? produces a colored bar \textknit{\|} and \verb?#? produces a symbol \textknit{\#}. If your chart ends up inside a command, \verb?|? will produce a plain black bar and \verb?#? will produce an error; use \verb?\|? and \verb?\#? instead.)
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}
+\begin{figure}[h]
\caption{The effects of embedding charts in commands and environments}
\par\bigskip\par
\begin{minipage}[b]{2.5in}
\begin{verbatim}
-\newdimen\knitlinewd
+\newdimen\knitlinewd
\setlength{\knitlinewd}{4pt}
\parbox{77pt}{
\chart{
@@ -779,7 +866,7 @@ AA\|%
\end{minipage}%
\hskip -108pt
\begin{minipage}[b]{80pt}
-\newdimen\knitlinewd
+\newdimen\knitlinewd
\setlength{\knitlinewd}{4pt}
\parbox{80pt}{
\chart{
@@ -792,7 +879,7 @@ AA\|%
\hskip 12pt
\begin{minipage}[b]{2.5in}
\begin{verbatim}
-\newdimen\knitlinewd
+\newdimen\knitlinewd
\setlength{\knitlinewd}{4pt}
\begin{center}
\chart{
@@ -805,7 +892,7 @@ AA\|%
\end{minipage}%
\hskip -84pt
\begin{minipage}[b]{55pt}
-\newdimen\knitlinewd
+\newdimen\knitlinewd
\setlength{\knitlinewd}{4pt}
\begin{center}
\chart{
@@ -820,27 +907,23 @@ AA\|%
\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}
+\section{Ligatures and cables}
+\label{sec:cables}
\TeX\ has a built-in ligature mechanism that lets it get {?`fire--fly?} instead of {?{}`f{}ire-{}-f{}ly?} when you type \texttt{?{}`fire--fly?}. \textsf{knitting} uses this for wide horizontal sequences such as \textknit{???}. The ligature mechanism also lets you generate the reverse of \textknit{"}: \texttt{-"}, \texttt{="} and \texttt{""} produce \textknit{-"}, \textknit{="}, and \textknit{""}, respectively.
However, the ligature mechanism really comes into its own when making cable symbols.
+\subsection{Symbolic cables}
\knitnogrid
-In the non-grid font, cables look like this: \textknit{kkKK}. The keys \texttt{k},~\texttt{p}, \texttt{K}, and \texttt{P} produce raised or lowered knit and purl symbols, and the ligature mechanism adds in the underbars or slant connectors automatically.
+In the fonts which represent ``knit 1'' by a vertical bar symbol (\verb|\knitnogrid|\slash\verb|\knitmixed|), cables look like this: \textknit{kkKK} or {\knitmixed\textknit{kkKK}}. The symbols are a stylized representation of what you must do to produce the cables.
+
+The keys \texttt{k},~\texttt{p}, \texttt{K}, and \texttt{P} produce raised or lowered knit and purl symbols, and the ligature mechanism adds in the underbars or slant connectors automatically.
-So:
+So:
\begin{quote}
\noindent\hfil\parbox{108pt}{
\tt kkKK\\
@@ -853,16 +936,48 @@ kpkpKPKP}}
\end{quote}
Some allowance for peculiar cables has been made. You can get a front increase or decrease with \texttt{N}~or \texttt{D}, or a back increase or decrease with \texttt{n}, \texttt{d}, \texttt{e}, or~\texttt{o}:
-\texttt{nedoND} \textknit{nedoND}. All of the symbols present in the font can be used in cables with the help of \verb|\cableleft| and \verb|\cableright|: \verb|\cableleft{AOA}{=*=}| \textknit{\cableleft{AOA}{=*=}}
+\texttt{nedoND} \textknit{nedoND}.
-Explaining to \textsf{knitting} when one cable starts and another ends can be hard: \texttt{pKKKKp} probably means \textknit{pKK KKp}, but it could mean \textknit{pK KKKp} or \textknit{pKKK Kp}, and the ligature mechanism isn't smart enough to default to \textknit{pKK KKp}, let alone read your mind. So you have to tell it what you want. (Or you'll get \textknit{pKKKKp}, which is not what you want.)
+All of the symbols present in the font can be used in cables with the help of \verb|\cableleft| and \verb|\cableright|: \verb|\cableleft{AOA}{=*=}| \textknit{\cableleft{AOA}{=*=}}.
+
+If you have a lot of cables involving the same obscure symbol, you may wish to use the commands \verb|\cableforeground| and \verb|\cablebackground| instead:
+
+\begin{center}
+\begin{minipage}[b]{224pt}
+\obeylines
+\verb?\renewcommand\${\cableforeground{b}}?
+\verb?\renewcommand\#{\cablebackground{b}}?
+\verb?\chart{?
+\verb? -\$\$\#\#-?
+\verb? -\$\$kk- ?
+\verb? \$\#--\#\$}?
+\end{minipage}
+\quad
+\begin{minipage}[b]{108pt}
+ \renewcommand\${\cableforeground{b}}
+ \renewcommand\#{\cablebackground{b}}
+ \chart{
+ -\$\$\#\#-
+ -\$\$kk-
+ \$\#--\#\$
+ }
+\end{minipage}
+\end{center}
+
+Be aware that the implementation of \verb|\cablebackground| is such that only cable connectors are drawn in the main pass; the symbols are drawn during the purl pass, and so \verb|\cablebackground| interacts in unexpected ways with color effects and with \verb|\purlpass|.
+
+Explaining to \textsf{knitting} when one cable starts and another ends can be hard: \texttt{pKKKKp} probably means \textknit{pKK KKp}, but it could mean \textknit{pK KKKp} or \textknit{pKKK Kp}, and the ligature mechanism isn't smart enough to default to \textknit{pKK KKp}, let alone read your mind. So you have to tell it what you want.
There are two ways to do this. You can put a space in: \texttt{ppKK KKpp}. You can also use the characters \texttt{c},~\texttt{g}, \texttt{C}, and~\texttt{G}: these behave just like \texttt{k},~\texttt{p}, \texttt{K}, and~\texttt{P}, except that they are only allowed to show up in the left part of a cable.
-So:
+Some limited debugging mechanisms are available. A sequence of background cables \texttt{kkp} which is not paired with a sequence of foreground stitches is not a cable; it is an orphaned half-cable. If for some reason you want an orphaned half-cable \textknit{\cableright{==}{}}, use \verb|\cableleft| or \verb|\cableright| with an empty argument.
+
+Orphaned half-cables produced by other methods (unaccompanied \texttt{pp}) are probably due to a typographical error which must be fixed. So they are made obvious. If you have an orphaned half-cable somewhere, the last square will be shaded: \texttt{ppKKKKpp} produces \textknit{ppKKKKpp} since the terminal \texttt{p}s are not part of a full cable.
+
+So:
\begin{center}
\begin{minipage}[b]{108pt}
-\obeylines\parindent=0pt\tt
+\obeylines\parindent=0pt\tt
=DKp,,pKD DKp,,pKD=
===----====----===
===KKkk====KKkk===
@@ -891,11 +1006,16 @@ So:
\end{minipage}
\end{center}
+\subsection{Stylized cables}
\knitgrid
-In the grid fonts, cables look like this: \textknit{kkKK}. The letters \texttt{kpcgKPCG} work for simple cables as in the non-grid font.
+In the fonts which represent ``knit 1'' by an empty box (\verb|\knitgrid|\slash\verb|\knitwide|), cables look like this: \textknit{kkKK}. The symbols are a stylized sketch of how the cables actually look.
-Grid cables are fairly limited. You can cross 1, 2, or 3 stitches over 1, 2, or 3 stitches, going left or right. The letters \texttt{kpcgKPCG} will let you draw purl-over-purl, knit-over-purl, or knit-over-knit cables.
+The letters \texttt{kpcgKPCG} work for simple cables as in the non-grid
+font. These cables are fairly limited. You can cross 1, 2, or 3 stitches
+over 1, 2, or 3 stitches, going left or right. The letters
+\texttt{kpcgKPCG} will let you draw purl-over-purl, knit-over-purl, or
+knit-over-knit cables.
Twelve special cable symbols are also possible:
\begin{center}
@@ -906,12 +1026,12 @@ You get these by putting \texttt{p}s (not \texttt{g}s) between the \texttt{k}s a
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.
-The keys \texttt{N},~\texttt{n}, \texttt{e}, \texttt{o}, \texttt{d} and~\texttt{D} have a different function here.
+The keys \texttt{N},~\texttt{n}, \texttt{e}, \texttt{o}, \texttt{d} and~\texttt{D} have a different function here.
-If a knit-over-knit cable ends with a \texttt{d} or \texttt{D} instead of \texttt{k} or \texttt{K}, the result will have a solid white background instead of a gray one. The letters \texttt{n}, \texttt{N}, \texttt{e} and \texttt{o} produce symbols that are hybrids of twist and cable symbols.\footnote{A \texttt{k}, \texttt{p}, \texttt{K}, pr \texttt{P} after a \texttt{n}, \texttt{e}, \texttt{o}, \texttt{d}, \texttt{N}, or \texttt{D} starts a new cable; you don't need to use \texttt{C}, \texttt{G}, \texttt{c}, \texttt{g} or spaces to separate them.}
+If a knit-over-knit cable ends with a \texttt{d} or \texttt{D} instead of \texttt{k} or \texttt{K}, the result will have a solid white background instead of a gray one. The letters \texttt{n}, \texttt{N}, \texttt{e} and \texttt{o} produce symbols that are hybrids of twist and cable symbols.\footnote{A \texttt{k}, \texttt{p}, \texttt{K}, or \texttt{P} after a \texttt{n}, \texttt{e}, \texttt{o}, \texttt{d}, \texttt{N}, or \texttt{D} starts a new cable; you don't need to use \texttt{C}, \texttt{G}, \texttt{c}, \texttt{g} or spaces to separate them.}
\begin{center}
\begin{minipage}[b]{108pt}
-\obeylines\parindent=0pt\tt
+\obeylines\parindent=0pt\tt
kkDD~kkNN~ppNN
KKdd~KKnn~KKoo
\end{minipage}
@@ -925,6 +1045,8 @@ KKdd~KKnn~KKoo
\end{center}
\texttt{e} and \texttt{o} have the same effect.
+Again, orphaned half-cables are indicated with diagonal hash marks \textknit{kk}.
+
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
@@ -958,42 +1080,143 @@ ppKK}
\bigskip
-This is enough for most cable patterns.
+This is enough for most cable patterns.
+
+
+\section{Counting rows}
+\label{sec:rowcount}
+
+This section describes how to get and modify the little red numbers shown here.
+
+\par\bigskip\par
+\begin{minipage}[b]{3.2in}
+\obeylines
+\verb?\chart{?
+\verb? \rnleft ======?
+\verb? \rnleft ======\addtocounter{rownumber}{-1}?
+\verb? \rnleft ======?
+\verb? \addtocounter{rownumber}{-5}}?
+\end{minipage}%
+\hfill
+\begin{minipage}[b]{1.33in}
+\knitgrid
+\chart{
+\rnleft======
+\rnleft======\addtocounter{rownumber}{-1}
+\rnleft======
+\addtocounter{rownumber}{-5}
+``\nonumber}
+\end{minipage}
+\par\bigskip\par
+\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}
+\knitgrid
+\hskip\stitchwd\chart[right]{
+======
+====== \nonumber
+======
+======
+\numberrow{6}{2}{2}
+}
+\end{minipage}
+
+\bigskip
+
+\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}.
+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
+\verb|\addtocounter|\allowbreak\verb|{rownumber}{-3}| (\LaTeX) or \verb|\global|
+\verb|\advance| \verb|\rownumber| \verb|by -3| (plain \TeX).
+
+\verb|\chart| will usually automatically arrange things so that the
+last \verb|\rn| produces a~1. If you want numbers in different charts
+to be numbered consecutively (e.g., if they are pieces of one big
+chart), you can turn this behavior off with \verb|\resetrnfalse| and
+back on with \verb|\resetrntrue|. You can then reset the row numbers
+with \verb|\setcounter{rownumber}{20}|; all future charts will count
+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 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|. 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.
+
+\item[$\star$] Inside an auto-numbered chart, \verb|\nonumber| skips the next row number.
+
+\item[$\star$] To number the stitches (by producing a \emph{row} of stitch numbers), you can use the command \verb|\numberrow|. It takes three arguments: the first number to be printed, the countdown (how often to print intermediate numbers), and the last number to be printed.
+
+\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.
+
+\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{sec:counting} for more details.
+
+\end{itemize}
+
+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}
+
+\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.
\section{Counting stitches}
-\label{se:counting}
+\label{sec: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.
+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 \emph{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
+\bigskip
\noindent\begin{minipage}[t]{224pt}
-\obeylines\parindent=0pt\tt
-\verb?\chart{\countstitches{->-}}?
+\obeylines\parindent=0pt\tt
+\verb?\chart{\countstitches{->-} ->-}?
\verb?stitchcountout: \thestitchcountout?
\verb?stitchcountin: \thestitchcountin?
\end{minipage}
\quad
\begin{minipage}[t]{108pt} \obeylines
-\chart{\countstitches{->-}}
+\chart{\countstitches{->-}{->-}}
stitchcountout: \thestitchcountout
stitchcountin: \thestitchcountin
\end{minipage}
-\bigskip
+\bigskip
This can be used to automatically label each row with its stitch count.
-\bigskip
+\bigskip
\noindent\begin{minipage}[b]{350pt}
-\obeylines\parindent=0pt\tt
+\obeylines\parindent=0pt\tt
\verb?\newcommand{\mystitchcount}[1]{\countstitches{#1}#1?
\verb? \mainpass{{\color{rncolor}%?
\verb? \textnormal{ (\thestitchcountout\ sts)}}}}?
@@ -1013,7 +1236,7 @@ This can be used to automatically label each row with its stitch count.
\mystitchcount{~-w-~}}
\end{minipage}
-\bigskip
+\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.)
@@ -1024,14 +1247,14 @@ By using the command \verb|\stitchcountwarningbar|, we can check to see that sti
\bigskip
\noindent\begin{minipage}[b]{\textwidth}
-\obeylines\parindent=0pt\tt
+\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
+\obeylines\parindent=0pt\tt
\verb?\chart{?
\verb? \setcounter{stitchcountin}{-100}?
\verb? \mystitchcount{~-A-~}?
@@ -1048,7 +1271,7 @@ By using the command \verb|\stitchcountwarningbar|, we can check to see that sti
\mainpass{ (\thestitchcountout\ sts)\stitchcountwarningbar}}}
\chart{
\setcounter{stitchcountin}{-100}
- \mystitchcount{~-A-~}
+ \mystitchcount{~-\>3-~}
\mystitchcount{-----}
\mystitchcount{-->--}
\mystitchcount{-----}
@@ -1065,49 +1288,141 @@ All of this gives you a lot of control over the stitch-counting mechanism in you
\bigskip
-\noindent\begin{minipage}[b]{350pt}
-\obeylines\parindent=0pt\tt
+\noindent\begin{minipage}[b]{300pt}
+\obeylines\parindent=0pt\tt
\verb?\rnoddonly?
\verb?\stitchcountchart[right]{?
-\verb? -----?
-\verb? ---\adjuststitchcount{2}?
-\verb? ---"\adjuststitchcount{2}?
-\verb? -----?
+\verb? -O-----O-?
+\verb? ~-O---O-?
+\verb? ~~-O-O-?
+\verb? ~~~---?
\verb? }?
\end{minipage}
\hskip -108pt
-\begin{minipage}[b]{108pt}
+\begin{minipage}[b]{158pt}
\rnoddonly
\stitchcountchart[right]{
- -----
- ---\adjuststitchcount{2}
- ---"\adjuststitchcount{2}
- -----
- }
+ -O-----O-
+ ~-O---O-
+ ~~-O-O-
+ ~~~---
+ }
\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
+You can customize this with the optional argument (which places row numbers as usual), the command \texttt{\char`\\ knitdebug} (which shows the stitch counts both before and after knitting the row), 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}
+\texttt{\char`\\ knitdebug} redefines \texttt{\char`\\ printleftstitchcount} to
+\begin{quote}
+\verb?\renewcommand \printleftstitchcount{{\color{rncolor}%?\\
+\verb? \textnormal{(\thestitchcountout\ out, ?\\
+\verb? \thestitchcountin\ in) }}}?\\
+\end{quote}
+
+\bigskip
+
+\noindent\begin{minipage}[b]{250pt}
+\obeylines\parindent=0pt\tt
+\verb?\rnoddonly?
+\verb?\knitdebug?
+\verb?\stitchcountchart[right]{?
+\verb? -O-----O-?
+\verb? ~-O---O-?
+\verb? ~~-O-O-?
+\verb? ~~~---?
+\verb? }?
+\end{minipage}
+\hskip -108pt
+\begin{minipage}[b]{208pt}
+\rnoddonly
+\knitdebug
+\stitchcountchart[right]{
+ -O-----O-
+ ~-O---O-
+ ~~-O-O-
+ ~~~---
+ }
+\par\strut
+\end{minipage}
+\bigskip
+
+
+
+The commands \verb|\narrowincrease| and so on, when used with the stitch-counting mechanism, do require that their arguments be numbers: if your chart involves the symbol \textknit{\narrowincrease{Z}}, that symbol cannot be counted.
-\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.
+The commands \verb|\Knit|, \verb|\Purl|, \verb|\knitbox| and \verb|\purlbox| by default are assumed to be as many stitches wide as they take up stitches on the chart: so \verb|\knitbox{A}{2}| is assumed to be two stitches wide.
-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:
+This means that \verb|\Knit{4}{3}| is assumed to be three, not four, stitches wide. You can change this behavior by redefining the commands \verb|\Knitstitchcount|, \texttt{\char`\\Purl\-stitch\-count}, \verb|\knitboxstitchcount|, \verb|\purlboxstitchcount|:
+\begin{quote}
+\verb|\renewcommand{\Knitstitchcount}[2]{#1}|
+\end{quote}
+Redefining \verb|\Knitstitchcount| does mean that you must give \verb|\Knit| a number as its first argument.
+
+Similarly, \verb|\widesymbol| normally is assumed to be as many stitches as its contents: \textknit{\widesymbol{w}{3}} represents one in-stitch and three out-stitches, just like \textknit{w}. If you prefer for \textknit{\widesymbol{*}{3}} to represent three stitches, redefine \verb|widesymbolspacer|:
+\begin{quote}
+\verb|\renewcommand{\widesymbolspacer}[2]{\hskip #2\stitchwd}|
+\end{quote}
+The arguments of \verb|\widesymbolspacer| are the two arguments of \verb|\widesymbol|; the default value is just
\begin{quote}
-\verb?\newcommand{\myknit}[2]{\Knit{Knit #1}{#2}%?\\
-\verb? \adjuststitchcount{-#2}\adjuststitchcount{#1}}?
+\verb|\newcommand{\widesymbolspacer}[2]{#1}|.
\end{quote}
+There is a way to deal with a series of short rows: put the rows inside the command \verb|\shortrows|, or use the command \verb|\nostitchcount| to omit a stitch count.
+
+\bigskip
+
+\noindent\begin{minipage}[b]{300pt}
+\obeylines\parindent=0pt\tt
+\verb?\rnevenonly?
+\verb?\stitchcountchart[right]{?
+\verb? \nostitchcount-------?
+\verb? -------?
+\verb? -------?
+\verb? \shortrows{~~~~---?
+\verb? ~~~"---}?
+\verb? -------?
+\verb? \shortrows{-----?
+\verb? ~~---"?
+\verb? ~"-----}?
+\verb? -------?
+\verb? }?
+\end{minipage}
+\hskip -108pt
+\begin{minipage}[b]{158pt}
+\rnevenonly
+\stitchcountchart[right]{
+ \nostitchcount-------
+ -------
+ -------
+ \shortrows{
+ ~~~~---
+ ~~~"---}
+ -------
+ \shortrows{
+ -----
+ ~~---"
+ ~"-----}
+ -------
+ }
+\par\strut
+\end{minipage}
+\bigskip
+
+
+
+
+\addtocontents{toc}{\SkipTocEntry}\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.
+
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}
+\addtocontents{toc}{\SkipTocEntry}\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|).
@@ -1119,17 +1434,48 @@ I've added the starred forms of \verb|\overline| and \verb|\underline| and the o
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}.
+\addtocontents{toc}{\SkipTocEntry}\subsection*{\today}
+
+The fonts \verb|knitw_sc_in| and \verb|knitw_sc_out| have been removed, because I realized that \verb|knitg_sc_in| and \verb|knitg_sc_out| could be used instead.
+
+The commands \verb?\|? and \verb?\!? now work with \verb|\textknit|.
+
+The following have been added:
+
+\begin{itemize}
+\item The characters \textknit{0}, \textknit{\&} and \textknit{\#}.
+
+\item The commands
+\\
+\verb|\Knitstitchcount|, \verb|\Purlstitchcount|, \\\verb|\knitboxstitchcount|, \verb|\purlboxstitchcount|;
+\\
+\verb|\cableforeground|, \verb|\cablebackground|;
+\\\verb|\widesymbol|.
+
+\item The \verb|\knitmixed| fonts.
+
+\item Support for counting stitches in short rows.
+
+\item Hash marks to show errors in cables.
+
+\item Some tweaks to the appearance of cables in the grid font.
+\end{itemize}
+
\section{List of files that are considered part of this package}
-\label{se:manifest}
+\label{sec:manifest}
This package should have come with all the following files, organized into the directories listed.
\medskip
\begingroup \ttfamily
+\noindent README
+
\noindent knitting/docs
\begin{itemize}
+ \item knitexamples.pdf
\item knitexamples.tex
+ \item knitkey.pdf
\item knitkey.tex
\item knitting-doc.pdf
\item knitting-doc.tex
@@ -1137,22 +1483,25 @@ This package should have come with all the following files, organized into the d
\noindent knitting/fonts/afm
\begin{itemize}
- \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
+ \item knitg_sc_in.afm
+ \item knitg_sc_out.afm
+ \item knitgg.afm
+ \item knitgn.afm
+ \item knitgp.afm
+ \item knitmg.afm
+ \item knitml.afm
+ \item knitmn.afm
+ \item knitmp.afm
+ \item knitmr.afm
+ \item knitn_sc_in.afm
+ \item knitn_sc_out.afm
+ \item knitnl.afm
+ \item knitnn.afm
+ \item knitnp.afm
+ \item knitnr.afm
+ \item knitwg.afm
+ \item knitwn.afm
+ \item knitwp.afm
\end{itemize}
\noindent knitting/fonts/map
@@ -1162,66 +1511,74 @@ This package should have come with all the following files, organized into the d
\noindent knitting/fonts/source
\begin{itemize}
- \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
+ \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 knitmg.mf
+ \item knitml.mf
+ \item knitmn.mf
+ \item knitmp.mf
+ \item knitmr.mf
+ \item knitn_sc_in.mf
+ \item knitn_sc_out.mf
+ \item knitnl.mf
+ \item knitnn.mf
+ \item knitnp.mf
+ \item knitnr.mf
+ \item knitwg.mf
+ \item knitwn.mf
+ \item knitwp.mf
\end{itemize}
\noindent knitting/fonts/tfm
\begin{itemize}
- \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
+ \item knitg_sc_in.tfm
+ \item knitg_sc_out.tfm
+ \item knitgg.tfm
+ \item knitgn.tfm
+ \item knitgp.tfm
+ \item knitmg.tfm
+ \item knitml.tfm
+ \item knitmn.tfm
+ \item knitmp.tfm
+ \item knitmr.tfm
+ \item knitn_sc_in.tfm
+ \item knitn_sc_out.tfm
+ \item knitnl.tfm
+ \item knitnn.tfm
+ \item knitnp.tfm
+ \item knitnr.tfm
+ \item knitwg.tfm
+ \item knitwn.tfm
+ \item knitwp.tfm
\end{itemize}
\noindent knitting/fonts/type1
\begin{itemize}
- \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
+ \item knitg_sc_in.pfb
+ \item knitg_sc_out.pfb
+ \item knitgg.pfb
+ \item knitgn.pfb
+ \item knitgp.pfb
+ \item knitmg.pfb
+ \item knitml.pfb
+ \item knitmn.pfb
+ \item knitmp.pfb
+ \item knitmr.pfb
+ \item knitn_sc_in.pfb
+ \item knitn_sc_out.pfb
+ \item knitnl.pfb
+ \item knitnn.pfb
+ \item knitnp.pfb
+ \item knitnr.pfb
+ \item knitwg.pfb
+ \item knitwn.pfb
+ \item knitwp.pfb
\end{itemize}
\noindent knitting/tex/latex