\section{The board}
\label{sec:tablero}

When we speak of the ``board'', we mean the |goban| environment: the grid, the background, the coordinates and everything drawn on it.

\begin{environment}{{goban}\opt{\oarg{options}}}

	Starts the goban environment. By default, it draws a square board of 9×9 intersections, with a visible border, a white background and no labels on the sides.

	\begin{codeexample}[width=5cm]
		\begin{goban}
		\end{goban}
	\end{codeexample}

	|goban| is a |tikzpicture|, so \tikzname\ can be used inside it. Each intersection is a point of its coordinate system, with A1 at |(1,1)|, or it is written as in the commands, with |(go cs:A1)| (p.~\pageref{subsec:tikz}).

	\begin{codeexample}[width=5.85cm]
		\begin{goban}[19, partial = K1:T9,
			label = {at = {north, east}}]
			\stones[b] {L8,S8,R5,S5,P4,R4,M3,P3,N2,O2}
			\mark[black, circle] {L8}
			\stones[white] {L6,S4,S3,Q3,O1,P2,R2}

			\tikzset{myarrow/.style = {-{latex[]}, line width = 2pt, blue}}
			\draw[myarrow] (12,8)--(17,8);
		\end{goban}
	\end{codeexample}

	\label{subsec:usei}\begin{key}{/pgfgo/goban/use i=\meta{boolean} (default true, initially false)}

		Uses the letter ``I'' in the coordinates and in the labels of the board. By default it is not used, as is customary in Go: the columns go from ``H'' to ``J'', and any reference to ``I'' is read as ``J''.

		\begin{codeexample}[]
			\pgfgoset{goban = {13, label = {at = north}}}

			\begin{goban}[use i, label = {at = west}, partial = H1:M3]
				\stone[b]{J2}
			\end{goban}

			\begin{goban}[partial = H1:N3]
				\stone[b]{J2}
			\end{goban}

			\begin{goban}[label = {at = east}, partial = H1:N3]
				\stone[white, mark = {custom = !}] {I2} % If it is I, it becomes J.
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/size=\meta{nlines or nlines |x| nlines} (initially 9)}

		Sets the number of vertical and horizontal lines of the board. The word ``size'' can be left out and the value given directly. With a single integer (such as |9|), the board is square (9×9). With an expression such as |5x3|, the board is rectangular, with 5 columns and 3 rows.

		\begin{codeexample}[width=6.5cm]
			\begin{goban}[5]
			\end{goban}

			\begin{goban}[5x3]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/sgf size=\meta{file}}
		Takes the size of the board from an SGF game (its property |SZ|). Only with the Lua kernel (p.~\pageref{subsec:kernel}).

		\begin{codeexample}[]
			\begin{goban}[sgf size = variations, label = {at = {north, west}}]
				\sgf{variations}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/sgf view=\meta{file}}
		Like |sgf size| and, if the file has a view (|VW|), shows only that part of the board, like |partial|. The view can change during the game; the one of the move |sgf view move| is used.
	\end{key}

	\begin{key}{/pgfgo/goban/sgf view move=\meta{number} (initially 0)}
		The move from which |sgf view| takes the view. A |VW| holds from the move of its node (or from the next one, if the node has no move) to the next |VW|, and |VW[]| shows the whole board again. With 0, it is the view at the beginning. It can go before or after |sgf view|. |\sgfdiagrams|, |\sgfanimation| and |\sgfproblem| choose the view by themselves.

		\begin{codeexample}[code only]
			\begin{goban}[sgf view = game, sgf view move = 120]
				\sgf[from = 101, to = 120]{game}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/scale=\meta{float} (initially 1)}

		Scale of the board: the sizes and also the width of the lines.

		\begin{codeexample}[width=5.5cm]
			\begin{goban}[2, scale = 2]
				\stone[b, mark]{A1}
			\end{goban}

			\begin{goban}[2, scale = 1]
				\stone[b, mark]{A1}
			\end{goban}

			\begin{goban}[2, scale = 0.5]
				\stone[b, mark]{A1}
			\end{goban}
		\end{codeexample}
	\end{key}

	\subsection{Grid}

	The grid is the lines of the board.

	\begin{key}{/pgfgo/goban/grid=\meta{options} (default true)}
		Options of the grid.
	\end{key}

	\begin{stylekey}{/pgfgo/goban/grid/true}

		Draws the grid again after a |grid = false| (for example, a global one set with |\pgfgoset|).
	\end{stylekey}

	\begin{stylekey}{/pgfgo/goban/grid/false}

		Removes the grid and the star points.

		\begin{codeexample}[]
			\begin{goban}[3]
				\stone[b]{A1}
				\stone[w]{B2}
			\end{goban}

			\begin{goban}[3, grid = false]
				\stone[b]{A1}
				\stone[w]{B2}
			\end{goban}
		\end{codeexample}

		The first board shows the default grid.
	\end{stylekey}

	\begin{key}{/pgfgo/goban/grid/line=\meta{options} (default true)}
		Options of the lines of the grid.
	\end{key}

	\begin{stylekey}{/pgfgo/goban/grid/line/true}
		Draws the lines. It is the initial value.
	\end{stylekey}

	\begin{stylekey}{/pgfgo/goban/grid/line/false}
		Does not draw the lines, but does draw the star points (unlike |grid = false|).

		\begin{codeexample}[]
			\begin{goban}[9, grid = {line = false}, hoshi = {radius = 2pt}]
				\stones[b]{C3, E5}
			\end{goban}
		\end{codeexample}
	\end{stylekey}

	\begin{key}{/pgfgo/goban/grid/line/color =\meta{color} (initially black)}

		Color of the lines of the grid.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[grid = {line = {color = blue}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[grid = {line = {color = red}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/line/opacity =\meta{float} (initially 1)}

		Opacity of the lines of the grid.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[grid = {line = {opacity = 0.2}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/line/width =\meta{dimension} (initially 0.55pt)}

		Width of the lines of the grid.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[grid = {line = {width = 1.5pt}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/x sep =\meta{dimension} (initially 1.25em)}
		Distance between the vertical lines.
	\end{key}

	\begin{key}{/pgfgo/goban/grid/y sep =\meta{dimension} (initially 1.25em)}
		Distance between the horizontal lines.
	\end{key}

	\begin{key}{/pgfgo/goban/grid/sep =\meta{dimension} (initially 1.25em)}
		Both distances at once.

		\begin{codeexample}[]
			\begin{goban}[5, grid = {x sep = 1.8em}]
				\stones[b]{B2, C3}
				\stone[w]{D3}
			\end{goban}

			\begin{goban}[5, grid = {sep = 0.9em}]
				\stones[b]{B2, C3}
				\stone[w]{D3}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/image =\meta{options}}
		Draws an image instead of the lines of the grid, with the opacity of |grid/line/opacity|. With |partial| the corresponding part is seen. The star points are still drawn (see |hoshi|).

		\begin{codeexample}[]
			\begin{goban}[9, grid = {image = {file = pgfgo-grid.png}}, hoshi = false]
				\stones[b]{C3}\stone[w]{D4}
			\end{goban}

			\begin{goban}[9, grid = {image = {file = pgfgo-grid.png}}, hoshi = false, partial = C3:G7]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/image/file =\meta{file \opt{, file, ...}}}
		The file of the image. With several files and |fit = tile|, each tile uses one, chosen by its place in the mesh: always the same one in each place, in every diagram. With |fit = stretch|, the first one is used.

		\begin{codeexample}[]
			\begin{goban}[5, hoshi = false,
				grid = {image = {file = {pgfgo-cell.png, pgfgo-tile.png}, fit = tile}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/image/fit =\meta{stretch or tile} (initially stretch)}
		With |stretch|, the image is stretched from A1 to the opposite corner of the whole board, so the outer lines have to be on the edges of the image. With |tile|, it is drawn once in each square of the grid (between four intersections), stretched to the size of the square: with the image of one square the whole board is built.

		\begin{codeexample}[]
			\begin{goban}[9, grid = {image = {file = pgfgo-cell.png, fit = tile}}, hoshi = false]
				\stones[b]{C3}\stone[w]{D4}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/image/tiles =\meta{columns}|x|\meta{rows} (initially one per square)}
		With |fit = tile|, the mesh in which the image is repeated, over the area that goes from A1 to the opposite corner of the whole board; each image is stretched to the size of its cell. A single number holds for both directions. Without this \emph{key}, there is one image per square.

		\begin{codeexample}[]
			\begin{goban}[9, grid = {image = {file = pgfgo-cell.png, fit = tile, tiles = 4}}, hoshi = false]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/grid/image/rotate =\meta{angle}, |random| or \meta{minimum}|:|\meta{maximum} (initially 0)}
		Turns the image, like |background/fill/image/rotate|: in quarter turns, and with |random| or a range, each tile with its own.
	\end{key}

	\begin{stylekey}{/pgfgo/goban/grid/image/false}
		Removes the image: the lines come back.
	\end{stylekey}

	\subsection{Star points}
	\label{subsec:hoshi}

	The star points (\emph{hoshi}) are drawn on the grid, with its color. By default they are the usual ones: on each side, the fourth line from the edge (the third on boards of fewer than 13 lines); the center if the size is odd; and, from 15 lines on, the middle of the sides. A 19 board has nine, and a 13 or a 9 board, five. Boards of fewer than 7 lines have none. Stones cover them.

	\begin{key}{/pgfgo/goban/hoshi=\meta{options} (default true)}
		Options of the star points.

		\begin{codeexample}[]
			\begin{goban}[9]
				\stones[b]{C3, E5}
			\end{goban}

			\begin{goban}[9, hoshi = false]
				\stones[b]{C3, E5}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{stylekey}{/pgfgo/goban/hoshi/true}
		Draws the star points. It is the initial value.
	\end{stylekey}

	\begin{stylekey}{/pgfgo/goban/hoshi/false}
		Does not draw the star points.
	\end{stylekey}

	\begin{key}{/pgfgo/goban/hoshi/radius=\meta{dimension} (initially 1.5pt)}
		Radius of the points.
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/color=\meta{color}}
		Color of the points. Without this \emph{key}, they take the color of the grid.

		\begin{codeexample}[]
			\begin{goban}[9, hoshi = {radius = 2.5pt, color = red}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/opacity=\meta{float}}
		Opacity of the points (also of their image). Without this \emph{key}, they take the opacity of the grid.

		\begin{codeexample}[]
			\begin{goban}[9, hoshi = {radius = 3pt, opacity = 0.3}]
				\stones[b]{C3}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/at=\meta{coordinates}}
		Chooses the points, with the same syntax as |\stones|. Empty, the usual ones are used.

		\begin{codeexample}[]
			\begin{goban}[9, hoshi = {at = {C3, G7}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/image=\meta{options}}
		Draws an image on each star point, instead of the circle.

		\begin{codeexample}[]
			\begin{goban}[9, hoshi = {image = {file = pgfgo-hoshi.png}, radius = 3pt}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/image/file=\meta{file}}
		The file of the image.
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/image/width=\meta{dimension} (initially $2 \times$ |radius|)}
		The width of the image; the height keeps the proportion.
	\end{key}

	\begin{key}{/pgfgo/goban/hoshi/image/rotate=\meta{angle}, |random| or \meta{minimum}|:|\meta{maximum} (initially 0)}
		Turns the image, like |stone/image/rotate| (p.~\pageref{subsec:piedrasimagen}): with |random| or a range, each point with a different angle, always the same.

		\begin{codeexample}[]
			\begin{goban}[9, hoshi = {image = {file = pgfgo-hoshi.png, width = 8pt}}]
			\end{goban}

			\begin{goban}[9, hoshi = {image = {file = pgfgo-hoshi.png, width = 8pt, rotate = 45}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{stylekey}{/pgfgo/goban/hoshi/image/false}
		Removes the image: the circles come back.
	\end{stylekey}

	\subsection{Border}

	The background of the board is the rectangle that goes under the grid, with its fill and its border. By default, the fill is white and the border, black.

	\begin{key}{/pgfgo/goban/background=\meta{options} (default true)}
		Options of the background and of the border.
	\end{key}

	\begin{stylekey}{/pgfgo/goban/background/true}

		Draws the background and the border again after a |background = false|.
	\end{stylekey}

	\begin{stylekey}{/pgfgo/goban/background/false}

		Removes the background: the fill and the border.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = false, resume = a]
			\end{goban}
		\end{codeexample}
	\end{stylekey}

	\begin{key}{/pgfgo/goban/background/fill=\meta{options} (default true)}
		Options of the fill.
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill=\meta{boolean} (initially true)}

		With |false|, the background is transparent and only the border remains.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {line = {color = red}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {line = false}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/color =\meta{color} (initially white)}

		Color of the fill.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {fill = {color = orange!40}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {fill = {color = olive!30}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/opacity =\meta{float} (initially 1)}

		Opacity of the fill.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {fill = {color = orange!40}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[resume = a,
				background = {fill = {color = orange!40}, fill = {opacity = 0.5}}]
			\end{goban}
		\end{codeexample}

	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image =\meta{options}}
		A background image (for example, the wood of a board), over the fill color and with its same opacity. The image is placed according to the whole board: with |partial| the corresponding part is seen, cut by the border and its rounded corners. The marks on empty points, which cover the grid with the color of the background, show the part of the image underneath, and so does the mark |dim|. The halo of arrows and lines is still the color of the background.

		\begin{codeexample}[]
			\begin{goban}[9,
				background = {fill = {image = {file = pgfgo-board.jpg}}}]
				\stones[b]{C3}\stone[w]{D4}
				\marks[circle]{E5, C3}
			\end{goban}

			\begin{goban}[9, partial = A1:E5,
				background = {fill = {image = {file = pgfgo-board.jpg}},
					rounded corners = 6pt}]
				\marks[triangle]{C3}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/file =\meta{file \opt{, file, ...}}}
		The file of the background image. With several files and |fit = tile|, each tile uses one, chosen by its place: always the same one in each place, also with |partial|. That way the board does not look repeated. The tiles have the size of the first image (or that of their cell, with |tiles|). With |stretch| and |cover|, the first one is used.

		\begin{codeexample}[]
			\begin{goban}[9, background = {fill = {image = {
				file = {pgfgo-tile.png, pgfgo-cell.png, pgfgo-board.jpg},
				fit = tile, width = 1cm}}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/fit =\meta{stretch, cover or tile} (initially cover)}
		How the image fills the background of the whole board. |stretch| stretches it to fill the whole background, without keeping the proportion. |cover| enlarges or reduces it, keeping the proportion, until it covers the background, centered: what is left over is not seen. |tile| repeats it as tiles, from a corner, an edge or the center of the whole board (see |anchor|).

		\begin{codeexample}[]
			\begin{goban}[9, background = {fill = {image = {
				file = pgfgo-tile.png, fit = tile, width = 1cm}}}]
			\end{goban}

			\begin{goban}[9, partial = D4:H8, background = {fill = {image = {
				file = pgfgo-tile.png, fit = tile, width = 1cm}}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/anchor =\meta{position} (initially south west)}
		With |fit = tile|, where the tiles start, on the background of the whole board. With a corner (|south west|, |south east|, |north west| or |north east|), a whole tile is in that corner. With an edge (|north|, |south|, |east| or |west|), the first tile is against that edge, centered along it. With |center|, a tile is in the center of the board.

		\begin{codeexample}[]
			\begin{goban}[5, background = {fill = {image = {
				file = pgfgo-tile.png, fit = tile, width = 1cm, anchor = north east}}}]
			\end{goban}

			\begin{goban}[5, background = {fill = {image = {
				file = pgfgo-tile.png, fit = tile, width = 1cm, anchor = north}}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/width =\meta{dimension} (initially the natural width)}
		With |fit = tile|, the width of each tile; the height keeps the proportion.
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/tiles =\meta{columns}|x|\meta{rows}}
		With |fit = tile|, instead of tiles of width |width| from |anchor|, divides the background of the whole board into that mesh and puts the image in each cell, stretched to its size. A single number holds for both directions.

		\begin{codeexample}[]
			\begin{goban}[9, background = {fill = {image = {
				file = pgfgo-cell.png, fit = tile, tiles = 3x3}}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/fill/image/rotate =\meta{angle}, |random| or \meta{minimum}|:|\meta{maximum} (initially 0)}
		Turns the image in quarter turns: the angle is rounded to 0, 90, 180 or 270 degrees, so that the turned image still fills its place without leaving gaps. With 90 or 270, the width and the height are swapped: with |cover| the image keeps the proportion, but a tile of width |width| that is not square is stretched. With |random| or a range, as in |stone/image/rotate| (p.~\pageref{subsec:piedrasimagen}), each tile has its own turn, always the same.

		\begin{codeexample}[]
			\begin{goban}[5, background = {fill = {image = {
				file = pgfgo-board.jpg, rotate = 90}}}]
			\end{goban}

			\begin{goban}[5, background = {fill = {image = {
				file = pgfgo-board.jpg, fit = tile, width = 1cm, rotate = random}}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{stylekey}{/pgfgo/goban/background/fill/image/false}
		Removes the background image.
	\end{stylekey}

	\begin{key}{/pgfgo/goban/background/line=\meta{options} (default true)}
		Options of the border.
	\end{key}

	\begin{key}{/pgfgo/goban/background/line=\meta{boolean} (initially true)}
		Draws (|true|) or removes (|false|) the border.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {line = {color = red}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {line = false}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/line/color =\meta{color} (initially black)}

		Color of the border.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {line = {color = red}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {line = {color = blue}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/line/opacity =\meta{float} (initially 1)}

		Opacity of the border.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {line = {color = red}}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[resume = a,
				background = {line = {color = red}, line = {opacity = 0.5}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/line/width =\meta{dimension} (initially 0.75pt)}

		Width of the border.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {line = {width = 1.5pt}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/rounded corners =\meta{dimension} (initially 0pt)}

		Radius of the corners of the background. With |0pt|, they are square.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = A1:C3}}

			\begin{goban}[name = a]
				\stones[b]{B1,C2}
				\stone[w]{A3}
			\end{goban}

			\begin{goban}[background = {rounded corners = 10pt}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}


	\begin{key}{/pgfgo/goban/background/rounded corners/outer =\meta{dimension} (initially 0pt)}

		Only that of the outer corners.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = A1:C3}}

			\begin{goban}[background = {rounded corners = 0pt}, name = a]
				\stones[b]{B1,C2}
				\stone[w]{A3}
			\end{goban}

			\begin{goban}[background = {rounded corners = {outer = 10pt}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}


	\begin{key}{/pgfgo/goban/background/rounded corners/inner =\meta{dimension} (initially 0pt)}

		Only that of the inner corners (they are seen on partial boards).

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = A1:C3}}

			\begin{goban}[background = {rounded corners = 0pt}, name = a]
				\stones[b]{B1,C2}
				\stone[w]{A3}
			\end{goban}

			\begin{goban}[resume = a,
				background = {rounded corners = {outer = 8pt, inner = 2pt}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/sep =\meta{dimension} (initially 0.825em)}

		Distance between the grid and the border. By default, 1.5 times the radius of the stones.

		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {sep = 0.625em}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {sep = 1.5em}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow=\meta{options} (default true)}
		Draws a shadow under the board. Without a value, turns it on.
		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {shadow}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {shadow = {color = blue, opacity = 0.3}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow=\meta{boolean} (initially false)}
		Turns the shadow on (|true|) or off (|false|).
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow/angle =\meta{float} (initially -45)}
		Direction of the shadow, in degrees.
		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {shadow}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {shadow = {angle = 45}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow/offset =\meta{dimension} (initially 1.5pt)}
		Distance between the board and its shadow.
		\begin{codeexample}[]
			\pgfgoset{goban = {5, partial = B2:D4}}

			\begin{goban}[background = {shadow}, name = a]
				\stones[b]{C2,D3}
				\stone[w]{B4}
			\end{goban}

			\begin{goban}[background = {shadow = {offset = 4pt}}, resume = a]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow/opacity =\meta{float} (initially 0.5)}
		Opacity of the shadow.
	\end{key}

	\begin{key}{/pgfgo/goban/background/shadow/color =\meta{color} (initially black)}
		Color of the shadow.
	\end{key}

	\subsection{Partial board}
	\label{subsec:parcial}

	Often the whole board is not needed, only a part. The \emph{key} |partial| sets it with two opposite corners of a rectangle, in any order. For example, |partial = A1:D3| is equivalent to |partial = D3:A1|.

	\begin{figure}[H]
		\centering

		\begin{tikzpicture}
			\node[anchor=north] (X) {
				\begin{goban}[label = {at = {north, west}}]
					\coordinate (A) at (4,6);
					\coordinate (B) at (9,9);
					\coordinate (C) at (A|-B);
					\coordinate (D) at (A-|B);

					\tikzset{dot/.style = {circle, fill = #1, draw, inner sep=0.25em, fill opacity=0.5, anchor=center}}

					\node[dot = red] at (A){};
					\node[dot = red] at (B){};
					\node[dot = blue] at (C){};
					\node[dot = blue] at (D){};

					\draw[red, {latex}-{latex}, shorten <=5pt, shorten >= 5pt] (A)--(B);
					\draw[blue, {latex}-{latex}, shorten <=5pt, shorten >= 5pt] (C)--(D);

					\node[fit=(A)(B), draw, inner sep=0.6em, rounded corners, line width=1pt, fill opacity=0.1, fill=orange] {};
				\end{goban}
			};

			\node[anchor=north, xshift=15em] {
				\tikz{
					\node[inner sep=0] (Y) {
						\begin{goban}[label = {at = {north, west}}, partial = J9:D6]
						\end{goban}
					};
					\node[align = left, anchor=north, inner sep=0, yshift=-1em] at (Y.south){
						{\color{blue}\texttt{partial = D9:J6}}\\
						{\color{blue}\texttt{partial = J6:D9}}\\
						{\color{red} \texttt{partial = D6:J9}}\\
						{\color{red} \texttt{partial = J9:D6}}\\
					};
				}
			};
		\end{tikzpicture}
	\end{figure}

	\begin{key}{/pgfgo/goban/partial=\meta{intersection}|:|\meta{intersection}, |auto| or |false|}
		Shows only part of the board: the rectangle that has those two intersections as opposite corners, in any order. It can also be written |partial = {B2, D4}| or |partial = {B2 to D4}|. With |auto|, the board chooses the part: the one used by the stones, moves, marks, arrows, lines and territories that are drawn, with |partial margin| more lines. What is drawn directly with \tikzname\ does not count. With |false|, the whole board is shown again (for example, after a global |partial| set with |\pgfgoset|).
	\end{key}

	\begin{codeexample}[]
		\tikzset{myarrow/.style = {-{latex[]}, line width = 1pt, red}}

		\begin{goban}[partial = A1:D3]
			\draw[myarrow] (1,1)--(4,3); % From A1 to D3
		\end{goban}

		\begin{goban}[partial = A9:J6]
			\draw[myarrow] (1,9)--(9,6); % From A9 to J6
		\end{goban}

		\begin{goban}[partial = E2:B4]
			\draw[myarrow] (5,2)--(2,4); % From E2 to B4
		\end{goban}
	\end{codeexample}

	\begin{key}{/pgfgo/goban/partial margin=\meta{number} (initially 1)}
		Lines that |partial = auto| adds around what is drawn. A side two lines or less from the edge reaches the edge. With nothing drawn, the whole board is seen.

		\begin{codeexample}[]
			\begin{goban}[19, partial = auto]
				\moves{Q16, R14, R16, P17}
			\end{goban}

			\begin{goban}[19, partial = auto, partial margin = 0]
				\stones[b]{J10, K11}\stones[w]{K9}
			\end{goban}
		\end{codeexample}
	\end{key}

	\subsection{Labels of the board}

	The labels are the coordinates written on the sides of the board.

	\begin{key}{/pgfgo/goban/label=\meta{options} (default true)}
		Options of the labels.
	\end{key}

	\begin{key}{/pgfgo/goban/label/true}
		Puts the letters below and the numbers on the left: |A1| is read from the lower left corner. It is the same as |label = {at = {south, west}}|; for the four sides, |label = {at = all}|.

		\begin{codeexample}[]
			\begin{goban}[5, label]
				\stones[b]{A1}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/false}
		Turns off all the labels.
	\end{key}

	\begin{key}{/pgfgo/goban/label/at =\meta{options}}

		On which sides of the board the labels go: one or several cardinal points, |all| or |none|.

		\begin{stylekey}{/pgfgo/goban/label/at/all}

			On the four sides.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/at/none}

			The same as |label = false|.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/at/east}
			On the right (the numbers).
		\end{stylekey}
		\begin{stylekey}{/pgfgo/goban/label/at/right}
			Equivalent to |east|.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/at/north}
			Above (the letters).
		\end{stylekey}
		\begin{stylekey}{/pgfgo/goban/label/at/above}
			Equivalent to |north|.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/at/south}
			Below (the letters).
		\end{stylekey}
		\begin{stylekey}{/pgfgo/goban/label/at/below}
			Equivalent to |south|.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/at/west}
			On the left (the numbers).
		\end{stylekey}
		\begin{stylekey}{/pgfgo/goban/label/at/left}
			Equivalent to |west|.
		\end{stylekey}

		\begin{codeexample}[]
			\begin{goban}[12, label = {at = {all}}]
			\end{goban}

			\begin{goban}[partial = A6:I9, label = {at = north}]
			\end{goban}

			\begin{goban}[partial = B2:E4, label = {at = {north, east}}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/font size = \meta{dimension} (initially the size of the current font)}

		Size of the font of the labels.

		\begin{codeexample}[]
			\begin{goban}[5, label = {at = {south, west}}]
			\end{goban}

			\begin{goban}[5, label = {at = {south, west}, font size = 6pt}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/font = \meta{font commands} (initially \texttt{\string\sffamily})}

		Font of the labels.

		\begin{codeexample}[]
			\begin{goban}[5, label = {at = {south, west}, font = \bfseries}]
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/sep = \meta{dimension} (initially 0.35cm)}

		Distance between the labels and the border of the board.
	\end{key}

	\begin{key}{/pgfgo/goban/label/color = \meta{color} (initially black)}

		Color of the labels.

		\begin{codeexample}[]
			\begin{goban}[5, label = {at = {south, west}, color = red, sep = 0.6cm}]
				\stones[b]{A1}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/columns = \meta{letters, numbers or kanji} (initially letters)}
		How the coordinates of the columns (above and below) are written: with letters (as in the commands, without the I except with |use i|), with numbers or with numbers in kanji ({\pgfgokanji 一, 二, …, 十, 十一}, …).
	\end{key}

	\begin{key}{/pgfgo/goban/label/rows = \meta{letters, numbers or kanji} (initially numbers)}
		The same for the rows (on the sides). The kanji of the rows are aligned on the side of the board, so that those of two characters do not run into it.
	\end{key}

	\begin{key}{/pgfgo/goban/label/columns direction = \meta{left to right or right to left} (initially left to right)}
		In which direction the columns are counted.

		\begin{codeexample}[]
			\begin{goban}[5, label = {at = {north, east},
					columns direction = right to left, rows = letters}]
				\stones[b]{B4}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/rows direction = \meta{bottom to top or top to bottom} (initially bottom to top)}
		In which direction the rows are counted. These four options change only what is written on the border: the coordinates of the commands (|C3|) stay the same. On a partial board the count starts from the edge of the whole board.

		\begin{codeexample}[]
			\begin{goban}[5, label = {at = {north, west}, columns = numbers,
				rows direction = top to bottom}]
				\stones[b]{C4}
			\end{goban}
		\end{codeexample}
	\end{key}

	\begin{key}{/pgfgo/goban/label/style = \meta{western, japanese or chinese} (initially western)}
		Sets the four previous options according to the custom of each place.

		\begin{stylekey}{/pgfgo/goban/label/style/western}
			Columns with letters from the left and rows with numbers from below.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/style/japanese}
			Columns with numbers from the right and rows with kanji from above, as in Japanese books: the upper right corner is 1-{\pgfgokanji 一}.
		\end{stylekey}

		\begin{stylekey}{/pgfgo/goban/label/style/chinese}
			Columns with numbers from the left and rows with kanji from above.
		\end{stylekey}

		Kanji need a font that has them. With Lua\LaTeX, for example, IPAex (included in \TeX\ Live and in MiK\TeX):

		\begin{codeexample}[]
			\font\kanji = {file:ipaexm.ttf} at 8pt
			\begin{goban}[9, label = {at = {north, east}, style = japanese, font = \kanji}]
				\stones[b]{G7}
			\end{goban}
		\end{codeexample}
	\end{key}

\end{environment}
