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