| 1 |
### file tab-clash-svg-dvips.awk |
| 2 |
### Copyright 2009, 2011 Stephan Hennig |
| 3 |
# |
| 4 |
# This work may be distributed and/or modified under the conditions of |
| 5 |
# the LaTeX Project Public License, either version 1.3 of this license |
| 6 |
# or (at your option) any later version. The latest version of this |
| 7 |
# license is in http://www.latex-project.org/lppl.txt |
| 8 |
# |
| 9 |
BEGIN { |
| 10 |
FS = ":=|(|)|," |
| 11 |
} |
| 12 |
/^[^:]+:=[(]*[0-9.,]+[)]*);$/ { |
| 13 |
name = $1 |
| 14 |
color[$1] = color[$1] + 1 |
| 15 |
# print name |
| 16 |
} |
| 17 |
END { |
| 18 |
# Build file tab-clash-dvips-svg.tex. |
| 19 |
file = "tab-clash-svg-dvips.tex" |
| 20 |
print "%%% file " file > file |
| 21 |
print "\\vspace{\\floatsep}" >> file |
| 22 |
print "\\begin{multicols}{4}[\\noindent\\parbox{\\textwidth}{%" >> file |
| 23 |
print " \\captionof{table}{Color names clashing in SVG (left) and DVIPS (right) specifications.}%" >> file |
| 24 |
print " \\label{tab:clash-svg-dvips}%" >> file |
| 25 |
print " }]" >> file |
| 26 |
print " \\raggedcolumns" >> file |
| 27 |
print " \\setlength{\\parindent}{0pt}" >> file |
| 28 |
print " \\ttfamily\\small\\color{mpcolor}" >> file |
| 29 |
ncolors = asorti(color, sortcolor)# requires gawk |
| 30 |
n = 0 |
| 31 |
for (i = 1; i <= ncolors; i++) { |
| 32 |
name = sortcolor[i] |
| 33 |
if (color[name] > 1) { |
| 34 |
n++ |
| 35 |
print "\\colorproof{" name "}\\par" >> file |
| 36 |
} |
| 37 |
} |
| 38 |
print "\\end{multicols}" >> file |
| 39 |
print "Found " n " color names clashing in SVG and DVIPS specs." |
| 40 |
} |