# How to draw non square Go board in latex?

As the title says, the square Go board is easy to draw with lots of Go board packages, such as igo or psgo. But there is no way to draw a non square Go board support. How do I draw rectangular Go boards?

I have found a paper that draw these Go boards, but don't know how it was done...

The paper is:

van der Werf, Erik CD, and Mark HM Winands. "Solving Go for rectangular boards." Icga Journal 32.2 (2009): 77-88.

• Welcome to TeX.Se Please post an MWE showing what you've tried – Thorbjørn E. K. Christensen Apr 4 '18 at 9:38
• the igo package is not currently in my LaTeX distrubution, but As far as I can tell, you wan't to redefine the places where the goban is defined. I think you wan't to change the command \gobansize{n} to \gobansize{n}{m} To draw a rectangular board. – Thorbjørn E. K. Christensen Apr 4 '18 at 9:48
• looking at the source I see that igo is plain TeX, I have no idea how to create an optional argument to have non-square go boards. – Thorbjørn E. K. Christensen Apr 4 '18 at 9:52
• I think the best way is to use psgo as it seems like it has the ability to draw the boards you wan't just not a way of doing it for the end user. – Thorbjørn E. K. Christensen Apr 4 '18 at 10:05

This is really easy to do using tikz. Here is a really quick mock-up of a macro \GoBoard for drawing beads on a go board to produce:

The syntax for the macro is:

 \GoBoard[x-dim][y-dim]{list of white pieces}{list of black pieces}


where the lists of white and black pieces are comma separated lists of coordinates. The y-dimension of the board is optional, defaulting to the x-dimension. The image above was drawn using

\GoBoard{7}[6]{(2,1),(2,2),(2,3),(2,4),(3,4),(4,3),(5,3),(5,2),(5,1)}
{(3,1),(3,2),(3,3),(4,4),(5,4),(6,4),(6,3),(6,2),(6,1)}


There is almost no styling in the code below, but it would be easy to add this, for example, by consulting the comprehensive tikz manual.

Here is the full MWE:

\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}

% \GoBoard[x-dim][y-dim]{list of white pieces}{list of black pieces}
\NewDocumentCommand\GoBoard{ m O{#1} m m}{%
\begin{tikzpicture}[
black/.style={ball color=black}
]
% first draw the grid
\foreach \x in {0,...,#1} {
\draw[thick](\x,0)--++(0,#2);
}
\foreach \y in {0,...,#2} {
\draw[thick](0,\y)--++(#1,0);
}
% now draw the white pieces
\foreach \wh in {#3} {
}
% now draw the black pieces
\foreach \bl in {#4} {