Debian Codegraph @

texmf-dist/doc/latex/eigo/README.md

raw
1 # The `eigo` Package
2
3 **Enhanced Go diagrams for LaTeX**
4
5 Version: 1
6 Date: 2025-09-06
7 Author: Marc Levivier (with AI assistance)
8 License: LaTeX Project Public License v1.3c or later
9
10 ## Description
11
12 The `eigo` package provides comprehensive tools for creating Go (Weiqi/Baduk) game diagrams in LaTeX documents. It offers enhanced features including:
13
14 - **Full and partial board displays** with automatic zone detection and enhanced borders
15 - **Multiple stone colors** (black, white, red, blue, green) with full RGB customization
16 - **Two custom colors** (customone, customtwo) with dedicated commands and default styling
17 - **Automatic numbering systems** with alternating colors or monochrome sequences
18 - **Symbol placement** (triangles, squares, circles, crosses, custom text)
19 - **Geometric transformations** (rotations, mirrors, color swapping)
20 - **Flexible sizing** with extended predefined sizes and validation
21 - **Coordinate display** with customizable formatting
22 - **Multiple board support** for variations and analysis
23 - **LuaLaTeX compatibility** with enhanced UTF-8 handling
24 - **borders** for publication-quality diagrams
25
26 ## Key Features
27
28 ### Stone Placement and Customization
29 - Basic commands: `\blackstones`, `\whitestones`, `\redstones`, `\bluestones`, `\greenstones`
30 - Custom colors: `\customonestones`, `\customtwostones`
31 - Full color customization: `\eigoblackcolor{R,G,B}`, `\eigowhitecolor{R,G,B}`, etc.
32 - Automatic numbering: `\autoblackfirst`, `\autowhitefirst`, `\blackn`, `\whiten`
33 - Position format: letter+number (e.g., `d4`, `k10`, `q16`)
34
35 ### Enhanced Board Display
36 - Full board: `\showfullgoban` with **enhanced 2pt borders**
37 - Zones: `\showgoban[a1,s19]` or `\showgoban[k10]` (auto 5×5)
38 - Frame control: `\eigoframe`, `\eigonoframe`
39 - Extended sizing: `\tinygoban`, `\smallgoban`, `\normalgoban`, `\largegoban`, `\hugegoban`, `\massivegoban`
40 - Custom size with validation: `\eigounitsize{10mm}`
41
42 ### Transformations
43 - Rotations: `\eigorotate{90}`, `\eigorotate{180}`, `\eigorotate{270}`
44 - Mirrors: `\eigomirrorh`, `\eigomirrorv`, `\eigomirrordiag`
45 - Color swap: `\eigoswapcolors`
46
47 ### Symbols and Markup
48 - Geometric symbols: `\gobansymbol{d4,k10}{\eigotriangle}`
49 - Custom text: `\gobansymbol{d4}{A}`
50 - Available symbols: `\eigotriangle`, `\eigosquare`, `\eigocircle`, `\eigocross`
51
52 ## Quick Start
53
54 ```latex
55 \documentclass{article}
56 \usepackage[frame,coords]{eigo} % Enable enhanced borders and coordinates
57
58 \begin{document}
59 % Customize colors if desired
60 \eigocustomonecolor{255,0,255} % Bright magenta
61 \eigocustomtwocolor{0,255,255} % Cyan
62
63 % Set up a position
64 \blackstones{d4,k10,q16}
65 \whitestones{d16,k4,q4}
66 \customonestones{d10} % Use custom color
67
68 % Show the full board with enhanced borders
69 \showfullgoban
70
71 % Show just a corner
72 \showgoban[a1,j10]
73
74 % Add numbered sequence with color alternation
75 \autoblackfirst[1]{e4,f5,g6}
76
77 % Show the result
78 \showgoban[e4]
79 \end{document}
80 ```
81
82 ## Color Customization
83
84 **NEW FEATURE**: Full control over all stone colors:
85
86 ```latex
87 % Customize standard colors
88 \eigoblackcolor{50,50,50} % Dark gray instead of black
89 \eigowhitecolor{240,240,240} % Off-white instead of pure white
90 \eigoredcolor{180,0,0} % Deep red
91 \eigobluecolor{0,0,180} % Deep blue
92 \eigogreencolor{0,120,0} % Dark green
93
94 % Customize additional colors
95 \eigocustomonecolor{128,0,128} % Purple (default)
96 \eigocustomtwocolor{255,165,0} % Orange (default)
97
98 % Use all colors in your diagrams
99 \blackstones{d4}
100 \whitestones{d5}
101 \redstones{e4}
102 \bluestones{e5}
103 \greenstones{f4}
104 \customonestones{f5}
105 \customtwostones{g4}
106 ```
107
108 ## Package Options
109
110 - `color` / `bw`: Enable/disable colored stones and backgrounds
111 - `frame` / `noframe`: Show/hide enhanced board frame and background
112 - `coords` / `nocoords`: Show/hide coordinate labels
113 - `debug`: Enable debug output with detailed logging
114
115 Example: `\usepackage[frame,coords,color]{eigo}`
116
117 ## Board Sizes
118
119 Supports boards from 2×2 to 25×25 with **extended size options**:
120 - `\gobansize{19}` - Standard 19×19 board
121 - `\gobansize{13}` - 13×13 board
122 - `\gobansize{9}` - 9×9 board
123
124 **Extended size presets with validation**:
125 - `\tinygoban` - 4mm per intersection (for overviews)
126 - `\smallgoban` - 6mm per intersection
127 - `\normalgoban` - 8mm per intersection (default)
128 - `\largegoban` - 12mm per intersection
129 - `\hugegoban` - 16mm per intersection
130 - `\massivegoban` - 20mm per intersection (maximum practical)
131
132 The package automatically validates sizes and issues warnings for very small (<2mm) or very large (>20mm) unit sizes.
133
134 ## Enhanced Features
135
136 ### Border Display
137 When using `\eigoframe` with full board display:
138 - **Thick 2pt borders** around the complete board
139 - Colored background in color mode
140 - Appearance suitable for publication
141 - Automatic detection of full vs partial board display
142
143 ### Advanced Automatic Numbering
144 - **Skip positions**: Use `-` in position lists to skip numbering while maintaining sequence
145 - **Alternating colors**: `\autoblackfirst[1]{d4,d5,-,e5}` (skips d5, continues with correct numbers)
146 - **Monochrome sequences**: `\blackn[1]{d4,e4,f4}` creates sequence 1,3,5
147 - **Flexible starting numbers**: Begin sequences at any number
148
149 ### Size Information Commands
150 ```latex
151 \theeigountisize % Get current unit size
152 \eigosizeinfo % Display current size information
153 ```
154
155 ## Multiple Boards
156
157 Use `\usegoban{n}` to work with board number n, each with independent color settings:
158 ```latex
159 \usegoban{1}
160 \eigoblackcolor{0,0,0} % Standard black for main line
161 \blackstones{d4,k10}
162
163 \usegoban{2}
164 \eigoblackcolor{100,100,100} % Gray for variation
165 \blackstones{d4,k10,q16}
166 ```
167
168 ## Requirements
169
170 - LaTeX with TikZ and xcolor packages
171 - Optional: LuaLaTeX for enhanced UTF-8 support
172 - Recommended: Modern TeX distribution (TeX Live 2020+)
173
174 ## Installation
175
176 ### From CTAN (when available)
177 ```bash
178 tlmgr install eigo
179 ```
180
181 ### Manual Installation
182 1. Download `eigo.sty`
183 2. Place in your local texmf tree or document directory
184 3. Run `texhash` if installed system-wide
185
186 ## Documentation
187
188 See `eigo.pdf` for complete documentation with examples, advanced usage, and troubleshooting guide.
189
190 ## Advanced Examples
191
192 ### Publication-Quality Problem Diagram
193 ```latex
194 \usepackage[frame,coords]{eigo}
195
196 \cleargoban
197 \eigoframe % Enable borders
198 \blackstones{f3,g3,h3,g4,h4,g5}
199 \whitestones{f4,f5,g6,h5,h6}
200 \gobansymbol{f6}{A}
201 \gobansymbol{h7}{B}
202 \showgoban[e2,j8] % Show with enhanced border
203 ```
204
205 ### Multi-Color Game Analysis
206 ```latex
207 \eigoblackcolor{0,0,0} % Black for actual moves
208 \eigoredcolor{200,0,0} % Red for good moves
209 \eigobluecolor{0,0,200} % Blue for questionable moves
210 \eigocustomonecolor{0,150,0} % Green for best moves
211
212 \blackstones{d4,k10} % Actual game
213 \redstones{d10} % Good alternative
214 \bluestones{q4} % Questionable move
215 \customonestones{k4} % Best move
216 ```
217
218 ### Variation Tree with Color Coding
219 ```latex
220 % Main line (Board 1)
221 \usegoban{1}
222 \eigoblackcolor{0,0,0}
223 \blackstones{d4,q16,d16,q4}
224
225 % Variation A (Board 2)
226 \usegoban{2}
227 \eigoblackcolor{100,0,0} % Slightly red tint
228 \blackstones{d4,q16,d16}
229 \customonestones[1]{q3} % Variation move in custom color
230
231 % Variation B (Board 3)
232 \usegoban{3}
233 \eigoblackcolor{0,0,100} % Slightly blue tint
234 \blackstones{d4,q16,d16}
235 \customtwostones[1]{o17} % Different variation
236 ```
237
238 ## Troubleshooting
239
240 ### Color Issues
241 - **Colors not changing**: Ensure color commands are called before stone placement
242 - **Custom colors reverting**: Color changes affect only subsequent stone placements
243 - **Colors too similar**: Use high contrast RGB values for clarity
244
245 ### Display Issues
246 - **Borders not showing**: Enable frame mode with `\eigoframe` and use full board display
247 - **Board too small/large**: Use size validation - package warns about extreme sizes
248 - **Coordinates misaligned**: Adjust `\eigocoorddistance{0.7}` as needed
249
250 ### Debug Mode
251 Enable comprehensive debugging:
252 ```latex
253 \usepackage[debug]{eigo}
254 ```
255
256 Provides detailed console output about position parsing, color changes, size validation, and rendering decisions.
257
258 ## License
259
260 This package is released under the LaTeX Project Public License v1.3c or later.
261 See http://www.latex-project.org/lppl.txt
262
263 ## Support
264
265 For bug reports and feature requests, please contact the maintainer or visit the package homepage.
266
267 ---
268
269 *The `eigo` package - Go diagrams for LaTeX with full customization*