% 2-column format for sgf2tex. See the TeXBook (Knuth: Addison Wesley, 1986)
% p.256. Two column formats sometimes are used in Go books and magazines, 
% such as INVINCIBLE: The Games of Shusaku by John Power. Knuth describes
% a more elaborate 2-column format in Appendix E to the TeXBook.
% 
%
% \setGoFonts sets all the go fonts to size of #1
\def\setGoFonts at #1 {
    \font\gooa=gooa at #1
    \font\goea=goea at #1
    \font\goob=goob at #1
    \font\goeb=goeb at #1
    \font\gooc=gooc at #1
    \font\goec=goec at #1
    \font\good=good at #1
    \font\goed=goed at #1
    \font\gobl=gobl at #1
    \font\gowl=gowl at #1
    \font\gooegb=gooegb at #1
    \font\gooemt=gooemt at #1
}
\setGoFont at 8.33333pt
\font\eighti=cmti8
\newdimen\goIntWd % width of a goboard intersection
\newdimen\goIntHt % height of a goboard intersection
\newdimen\goTextAdj % amount to lower stones in \textstone macro, or raise labels on boards
\def\goo{\offinterlineskip\parindent=0pt\parskip=0pt\obeylines%     black odd, white even
\setbox0\hbox{\gooegb +}\global\goIntWd=\wd0\global\goIntHt=\ht0\global\goTextAdj=2pt%
  \def\0##1##2##3{\if##1?\gooegb ##3 \else \gooa\char##1##2 \fi}%
  \def\1##1##2##3{\if##1?\gooegb ##3 \else \goob\char##1##2 \fi}%
  \def\2##1##2##3{\if##1?\gooegb ##3 \else \gooc\char##1##2 \fi}%
  \def\3##1##2##3{\if##1?\gooegb ##3 \else \good\char##1##2 \fi}%
  \def\4##1##2##3{\if##1?\gooegb ##3 \else \gobl\char##1##2 \fi}%
  \def\5##1##2##3{\if##1?\gooegb ##3 \else \gowl\char##1##2 \fi}%
  \def\-##1##2{\gooegb ##1}%
  \def\!##1{\leavevmode\hbox to \goIntWd{\hss\raise\goTextAdj\hbox{\rm ##1}\hss}}% #1 on empty intersections
}
\def\goe{\offinterlineskip\parindent=0pt\parskip=0pt\obeylines%     black even, white odd
\setbox0\hbox{\gooegb +}\global\goIntWd=\wd0\global\goIntHt=\ht0\global\goTextAdj=3pt%
  \def\0##1##2##3{\if##1?\gooegb ##3 \else \goea\char##1##2 \fi}%
  \def\1##1##2##3{\if##1?\gooegb ##3 \else \goeb\char##1##2 \fi}%
  \def\2##1##2##3{\if##1?\gooegb ##3 \else \goec\char##1##2 \fi}%
  \def\3##1##2##3{\if##1?\gooegb ##3 \else \goed\char##1##2 \fi}%
  \def\4##1##2##3{\if##1?\gooegb ##3 \else \gobl\char##1##2 \fi}%
  \def\5##1##2##3{\if##1?\gooegb ##3 \else \gowl\char##1##2 \fi}%
  \def\-##1##2{\gooegb ##1}%
  \def\!##1{\leavevmode\hbox to \goIntWd{\hss\raise\goTextAdj\hbox{\rm ##1}\hss}}% #1 on empty intersections
}
\def\textstone#1{\lower\goTextAdj\hbox{#1}}
\def\\{{\char'134}}
\newdimen\fullhsize
\fullhsize=460pt\hsize=210pt
\def\fullline{\hbox to\fullhsize}
\let\lr=L
\newbox\leftcolumn
\output={\if L\lr
  \global\setbox\leftcolumn=\columnbox\global\let\lr=R
  \else\doubleformat\global\let\lr=L\fi
  \ifnum\outputpenalty>-20000\else\dosupereject\fi}
\def\doubleformat{\shipout\vbox{\makeheadline
  \fullline{\box\leftcolumn\hfil\columnbox}
  {\baselineskip=24pt\fullline{\the\footline}}}
  \advancepageno}
\def\columnbox{\leftline{\pagebody}}
