.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Games::Go::Sgf2Dg 3pm" .TH Games::Go::Sgf2Dg 3pm "2019-10-27" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Games::Go::Sgf2Dg \- convert Smart Go Format (SGF) files to diagrams similar to those seen in Go books and magazines. .SH "SYNOPSIS" .IX Header "SYNOPSIS" sgf2dg [ option ... ] file[.sgf|.mgt] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBGames::Go::Sgf2Dg\fR takes a Smart Go Format (\s-1SGF\s0) file \fIfilename\fR or \&\fIfilename\fR.sgf or \fIfilename\fR.mgt and produces a diagram file \&\fIfilename\fR.suffix where suffix is determined by the \fBconverter\fR (see below). .PP \&\fBGames::Go::Sgf2Dg\fR modualizes the sgf2dg script. As such, it parses the command line (\fB\f(CB@ARGV\fB\fR) directly, and has only one callable method: \fBrun\fR, called as follows (by the sgf2dg script): .PP .Vb 1 \& Games::Go::Sgf2Dg\->run; .Ve .PP The default \fBconverter\fR is Dg2TeX which converts the Diagram to TeX source code (sgf2dg is a superset replacement for the sgf2tex script and package). If you have the \s-1GOOE\s0 fonts (provided in the same package as sgf2dg) correctly installed on your system you will be able to tex \fIfilename\fR.tex to produce a .dvi file. You can of course embed all or parts of \fIfilename\fR.tex into other TeX documents. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-h \fR | \fB\-help\fR" 4 .IX Item "-h | -help" Print a help message and quit. .IP "\fB\-i\fR | \fB\-in\fR | .sgf | .mgt" 4 .IX Item "-i | -in | .sgf | .mgt" Specifies the input filename. (\s-1STDIN\s0 or none for standard input.) This option is not needed in ordinary use. .IP "\fB\-o\fR | \fB\-out\fR " 4 .IX Item "-o | -out " Specifies the output file. ('\s-1STDOUT\s0' for standard output.) If the input file is , .sgf or .mgt, then .\fIconverter\fR is the default (see the \fBconverter\fR option). This option is not needed in ordinary usage. .IP "\fB\-t\fR | \fB\-top\fR " 4 .IX Item "-t | -top " Specifies the top line to print. Default is 1. .IP "\fB\-b\fR | \fB\-bottom\fR " 4 .IX Item "-b | -bottom " Specifies the bottom line to print. Default is 19. .IP "\fB\-l\fR | \fB\-left\fR " 4 .IX Item "-l | -left " Specifies the leftmost line to print. Default is 1. .IP "\fB\-r\fR | \fB\-right\fR " 4 .IX Item "-r | -right " Specifies the rightmost line to print. Default is 19. .IP "\fB\-break\fR | \fB\-breakList\fR " 4 .IX Item "-break | -breakList " \&'break list' is a list of moves, separated by comma, with no spaces. These are breakpoints: each will be the last move in one diagram. .IP "\fB\-m\fR | \fB\-movesPerDiagram\fR " 4 .IX Item "-m | -movesPerDiagram " \&'moves per diagram' is a positive integer, specifying the maximal number of moves per diagram. Default is 50 unless \fB\-break\fR or \fB\-breakList\fR is set, in which case the default is set to a very large number (10,000). The two options \&\fB\-breakList\fR and \fB\-movesPerDiagram\fR may be used together. .IP "\fB\-n\fR | \fB\-newNumbers\fR" 4 .IX Item "-n | -newNumbers" Begin each diagram with the number 1. The actual move numbers are still used in the label. .Sp \&\fB\-newNumbers\fR and \fB\-doubleDigits\fR are alternative schemes for avoiding three-digit numbers in the diagrams. They should probably not be used together. .IP "\fB\-d\fR | \fB\-doubleDigits\fR" 4 .IX Item "-d | -doubleDigits" If the first move of a diagram exceeds 100, the move number is reduced modulo 100. The actual move numbers are still used in the label. \fB\-newNumbers\fR and \&\fB\-doubleDigits\fR are alternative schemes for avoiding three-digit numbers in the diagrams. They should probably not be used together. .IP "\fB\-rl\fR | \fB\-repeatLast\fR" 4 .IX Item "-rl | -repeatLast" The last move in each diagram is the first move in the next. This emulates a common style for annotating Go games. .IP "\fB\-ic\fR | \fB\-ignoreComments\fR" 4 .IX Item "-ic | -ignoreComments" Comments embedded in the \s-1SGF\s0 with the C property are ignored. .IP "\fB\-il\fR | \fB\-ignoreLetters\fR" 4 .IX Item "-il | -ignoreLetters" Letters embedded in the \s-1SGF\s0 with the L or \s-1LB\s0 property are ignored. .IP "\fB\-im\fR | \fB\-ignoreMarks\fR" 4 .IX Item "-im | -ignoreMarks" Marks embedded in the \s-1SGF\s0 with the M or \s-1MA\s0 property are ignored. .IP "\fB\-ip\fR | \fB\-ignorePass\fR" 4 .IX Item "-ip | -ignorePass" Passes are ignored. In sgf, a pass is a move at the fictitious point tt. Without this option, sgf2dg indicates passes in the diagram comments. .IP "\fB\-ia\fR | \fB\-ignore all\fR" 4 .IX Item "-ia | -ignore all" Ignore \s-1SGF\s0 letters, marks, variations and passes. .IP "\fB\-firstDiagram\fR " 4 .IX Item "-firstDiagram " Specifies the first diagram to print. Default is 1. .IP "\fB\-lastDiagram\fR " 4 .IX Item "-lastDiagram " Specifies the last diagram to print. Default is to print all diagrams until the end. .IP "\fB\-coords\fR" 4 .IX Item "-coords" Adds coordinates to right and bottom edges. .IP "\fB\-verbose\fR" 4 .IX Item "-verbose" Print diagnostic messages as the conversion proceeds. Most \s-1SGF\s0 properties produce some kind of message. .IP "\fB\-converter\fR | \fB\-convert\fR" 4 .IX Item "-converter | -convert" Selects different output converter plugins. Converters available with the current distribution package are: .RS 4 .IP "Games::Go::Sgf2Dg::Dg2TeX TeX source (default)" 4 .IX Item "Games::Go::Sgf2Dg::Dg2TeX TeX source (default)" .PD 0 .IP "Games::Go::Sgf2Dg::Dg2Mp MetaPost embedded in TeX" 4 .IX Item "Games::Go::Sgf2Dg::Dg2Mp MetaPost embedded in TeX" .IP "Games::Go::Sgf2Dg::Dg2ASCII simple \s-1ASCII\s0 diagrams" 4 .IX Item "Games::Go::Sgf2Dg::Dg2ASCII simple ASCII diagrams" .IP "Games::Go::Sgf2Dg::Dg2PDF Portable Document Format (\s-1PDF\s0)" 4 .IX Item "Games::Go::Sgf2Dg::Dg2PDF Portable Document Format (PDF)" .IP "Games::Go::Sgf2Dg::Dg2Ps PostScript" 4 .IX Item "Games::Go::Sgf2Dg::Dg2Ps PostScript" .IP "Games::Go::Sgf2Dg::Dg2Tk Perl/Tk NoteBook/Canvas" 4 .IX Item "Games::Go::Sgf2Dg::Dg2Tk Perl/Tk NoteBook/Canvas" .IP "Games::Go::Sgf2Dg::Dg2TkPs PostScript via Dg2Tk (Dg2Ps is prefered)" 4 .IX Item "Games::Go::Sgf2Dg::Dg2TkPs PostScript via Dg2Tk (Dg2Ps is prefered)" .IP "Games::Go::Sgf2Dg::Dg2SL Sensei's Library (by Marcel Gruenauer)" 4 .IX Item "Games::Go::Sgf2Dg::Dg2SL Sensei's Library (by Marcel Gruenauer)" .RE .RS 4 .PD .Sp \&\fBconverter\fRs are quite easy to write \- should take just a few hours if you are already conversant with the conversion target. If you would like to create a \fBconverter\fR plugin module, the easiest way is probably to grab a copy of Dg2Ps.pm (for example) and modify it. Once it's working, please be sure to send us a copy so we can add it to the distribution. .Sp Converters are always prepended with 'Games::Go::Sgf2Dg::Dg2', so to select the \s-1ASCII\s0 converter instead of the default TeX converter, use: .Sp .Vb 1 \& \-converter ASCII .Ve .Sp Converter names are case sensitive. .Sp The default output filename suffix is determined by the converter: the converter name is lower-cased to become the suffix, so the \s-1ASCII\s0 converter produces .ascii from .sgf. .Sp You can also select different \fBconverter\fRs by changing the name of the sgf2dg script (or better, make symbolic links, or copies if your system can't handle links). The \fBconverter\fR name is extracted from the name with this regular expression: .Sp .Vb 1 \& m/sgf2(.*)/ .Ve .Sp Anything after 'sgf2' is assumed to be the name of a \fBconverter\fR module. For example, let's create a link to the script: .Sp .Vb 2 \& $ cd /usr/local/bin \& $ ln \-s sgf2dg sgf2Xyz .Ve .Sp Executing: .Sp .Vb 1 \& $ sgf2Xyz foo.sgf [ options ] .Ve .Sp attempts to use Games::Go::Sgf2Dg::Dg2Xyz as the \fBconverter\fR. The \&\fBconverter\fR name extracted from the script name is case sensitive. .Sp Note that three extracted names are treated specially: .IP "tex" 4 .IX Item "tex" .PD 0 .IP "diagram" 4 .IX Item "diagram" .IP "dg" 4 .IX Item "dg" .RE .RS 4 .PD .Sp These three names (when extracted from the script name) always attempt to use Games::Go::Sgf2Dg::Dg2TeX as the \fBconverter\fR. .RE .SH "CONVERTER OPTIONS" .IX Header "CONVERTER OPTIONS" Converters may be added dynamically as plugins, so this list only includes converter plugin modules that are included with the Sgf2Dg distribution. .PP Converter options are prepended with the converter name so that option xyz for converter Games::Go::Sgf2Dg::Dg2Abc is written on the command line as: .PP .Vb 1 \& $ sgf2dg ... \-Abc\-xyz ... .Ve .PP Converter options that take arguments must be quoted so that the shell passes the option and any arguments as a single \s-1ARGV.\s0 For example, if the xyz option for converter Dg2Abc takes 'foo' and \&'bar' as additional arguments, the command line would be: .PP .Vb 1 \& $ sgf2dg ... "\-Abc\-xyz foo bar" ... .Ve .PP or a more realistic example of changing the background color: .PP .Vb 1 \& $ sgf2dg genan\-shuwa \-converter Tk "\-Tk\-bg #d2f1b4bc8c8b" .Ve .PP Since Sgf2Dg is a super-set replacement for the Sgf2TeX package, TeX holds the default position for converters. Because of this historically priviledged position, the Dg2TeX options below do not need to be prepended with 'TeX\-'. All of the following options apply to the Dg2TeX converter. .PP Other plugins available at the time of release are Dg2Mp, Dg2ASCII, Dg2PDF, Dg2Ps, Dg2Tk and Dg2TkPs. Dg2ASCII and Dg2TkPs take no additional options. Dg2Tk doesn't explicitly accept options, but it attempts to pass unrecognized options to the Tk::Canvas widgets at creation time (which is why the example above works). .PP For more information about converter-specific options, please refer to the perldoc or manual pages: .PP .Vb 1 \& $ perldoc Games::Go::Sgf2Dg::Dg2PDF .Ve .PP or .PP .Vb 1 \& $ man Games::Go::Sgf2Dg::Dg2Ps .Ve .SS "Dg2TeX options" .IX Subsection "Dg2TeX options" .IP "\fB\-simple\fR" 4 .IX Item "-simple" (Dg2TeX) This generates very simple TeX which may not look so good on the page, but is convenient if you intend to edit the TeX. .IP "\fB\-mag number\fR" 4 .IX Item "-mag number" (Dg2TeX) Changes the default \e\emagnification from 1000 to number. .IP "\fB\-twoColumn\fR" 4 .IX Item "-twoColumn" (Dg2TeX) This generates a two-column format using smaller fonts. .IP "\fB\-bigFonts\fR" 4 .IX Item "-bigFonts" (Dg2TeX) Use fonts magnified 1.2 times. .IP "\fB\-texComments\fR" 4 .IX Item "-texComments" (Dg2TeX) If this option is \s-1NOT\s0 used then the characters {, } and \&\e found in comments are replaced by [, ] and /, since TeX roman fonts do not have these characters. If this option is used, these substitutions are not made, so you can embed TeX source (like {\ebf change fonts}) directly inside the comments. .IP "\fB\-floatControl 'control_string'\fR" 4 .IX Item "-floatControl 'control_string'" (Dg2TeX) Dg2TeX can float the diagram to the left or the right of the accompanying text. \fB\-floatControl\fR allows you to specify the position of each diagram. \fBcontrol_string\fR is a sequence of letters which specify where each diagram should be positioned. The letters may be: .RS 4 .IP "'l': left" 4 .IX Item "'l': left" .PD 0 .IP "'r': right" 4 .IX Item "'r': right" .IP "'a': alternate" 4 .IX Item "'a': alternate" .IP "other: random" 4 .IX Item "other: random" .RE .RS 4 .PD .Sp \&\fBcontrol_string\fR letters are consumed, one per diagram, until there is only one letter left. The final letter is used for all remaining diagrams. .Sp The default \fBcontrol_string\fR is 'rx' which places the first diagram on the right (text on the left) and all remaining diagrams are placed randomly. .RE .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "o \fBsgfsplit\fR\|(1) \- splits a .sgf file into its component variations" 4 .IX Item "o sgfsplit - splits a .sgf file into its component variations" .SH "AUTHOR" .IX Header "AUTHOR" sgf2dg was written by Reid Augustin, .PP The \s-1GOOE\s0 fonts and TeX macros were designed by Daniel Bump (bump@math.stanford.edu). Daniel hosts the \s-1GOOE\s0 and sgf2dg home page at: .Sp .RS 4 .RE