×

[edit] ShareLaTeX guides

[edit] LaTeX Basics

[edit] Mathematics

[edit] Figures and tables

[edit] References and Citations

[edit] Languages

[edit] Document structure

[edit] Formatting

[edit] Fonts

[edit] Presentations

[edit] Commands

[edit] Field specific

[edit] Class files

LaTeX provides a special document class to make easier typesetting documents with knitting patterns and pictures. This article explains how to use the package knittingpatern.

Contents

[edit] Introduction

Using knitting patterns is straightforward. You just have to declare the right document class

\documentclass{knittingpattern}
 
\begin{document}
 
\title{Knitting patterns}
\author{ShareLaTeX team}
\date{\today}
\maketitle
 
\cpyrght{ShareLaTeX team}
 
\intro{
    Introductory text here. It will look better if it has the
    same height as the image next to it. 
    Introductory text here. It will look better if it has the
    same height as the image next to it... 
}{lion-logo}

KnittingPatternsEx1.png

The command on top of the document

\documentclass{knittingpattern}

enables several commands to make easier to change the layout of some elements by means of some commands. For instance

  • \cpyrgth{ } Removes the page numbers and add a footnote. Intended for copyright notes.
  • \intro{}{} Takes two parameters inside braces. The first one is some (introductory) text, the second one is an image. The text is printed on the left and the image next to it.

  Open an example of the knitpattern package in ShareLaTeX

[edit] Diagrams

To add an image containing a diagram knittingpattern provides a special command

\diagram{lion-logo}

KnittingPatternsEx2.png

The command \diagram prints a centred, bordered image whose width is a half of the page.

  Open an example of the knitpattern package in ShareLaTeX

[edit] Notes and remarks

If you need to highlight a special block of text within the document, there are two commands to add boxed notes and remarks to the document.


\definecolor{colour0}{HTML}{000000}
\definecolor{colour2}{HTML}{97DE76}
\definecolor{colour4}{HTML}{EDB668}
 
\begin{document}
 
\note{colour0}{colour2}{Materials}{
    Wool, some wool, and you may also need wool for the 
    wool parts.
}
 
There's also this special command
 
\important{colour0}{colour4}{This note is very important. 
That's why it's highlighted}
\end{document}

KnittingPatternsEx3.png

The command \note{}{}{}{} takes 4 parameters:

  • the colour for the border,
  • the background colour,
  • a title and
  • the text to be printed inside the box.

The colours use xcolor HTML syntax. See Using colours in LaTeX for more information.

The second command, \important, has essentially the same syntax as \note, but the title is omitted.

  Open an example of the knitpattern package in ShareLaTeX


[edit] Adding knitting instructions

The main purpose of a document about knitting is to actually provide directions about a knitting pattern. The package knittingpatern provides an environment that prints a table of instructions.

\documentclass{knittingpatern}
\definecolor{colour3}{HTML}{99CCFF}
\definecolor{colour5}{HTML}{CCFFCC}
 
\begin{document}
\begin{pattern}{colour3}{colour5}
Cast on & (st)\\
Instruction 1 & (st)\\
Instruction 2 & (st)\\
Instruction 3 & (st)\\
Instruction 4 & (st)\\
Instruction 5 & (st)\\
Instruction 6 & (st)\\
Instruction 7 & (st)\\
Instruction 8 & (st)\\
Instruction 9 & (st)\\
Instruction 10 & (st)\\
\quad\vdots & \quad\vdots\\
\end{pattern}
\end{document}

KnittingPatternsEx4.png

The environment takes two parameters that determine the alternating colours used in the table to improve readability. See Using colours in LaTeX for more information about colour manipulation in LaTeX.

  Open an example of the knitpattern package in ShareLaTeX

[edit] Further reading

For more information see: