summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/isodoc/listkeys
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-04-09 21:50:10 +0000
committerKarl Berry <karl@freefriends.org>2007-04-09 21:50:10 +0000
commit37978e7887833a19ccf0729dc2a8ccdd5eb246c7 (patch)
treed38ad363b25777984df12f6985ae817a6c1c2405 /Master/texmf-dist/doc/latex/isodoc/listkeys
parent8b900ccf26a7b6d6ff353536ecf8799983450b6c (diff)
new latex package isodoc
git-svn-id: svn://tug.org/texlive/trunk@4141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/isodoc/listkeys')
-rw-r--r--Master/texmf-dist/doc/latex/isodoc/listkeys50
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/isodoc/listkeys b/Master/texmf-dist/doc/latex/isodoc/listkeys
new file mode 100644
index 00000000000..d6728cf6d03
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/isodoc/listkeys
@@ -0,0 +1,50 @@
+#!/usr/local/bin/ruby
+
+# after the addition of new options, two regions of the documentation in
+# isodoc.dtx need to be updated:
+# 1. the body of the definition of \showkeys
+# listkeys will print that body with the argument `show'
+# 2. The body of the tabular (in the section `Commands'), which shows
+# the options having a corresponding command.
+# listkeys will print that body with the argument `defs'
+#
+# An easy way to replace the data in isodoc.dtx is, using the vim editor:
+# 1. select the lines (the contents of \def\showkeys, say) with V and then
+# 2. type :!listkeys show
+
+def usage
+ raise(ArgumentError,"Usage: listkeys defs|show",$0)
+end
+usage if ARGV.size != 1
+
+type = ARGV.pop
+ARGV.push('isodoc.dtx')
+
+a = []
+a.push($1) if ~ /\\define@key\{isodoc\}\{(.*)\}\s*\{\\def\\/ while gets
+a.sort!
+case type
+ when 'show'
+ a.each { |v| puts "%20s & \\%s\\NN" % [v,v] }
+ when 'defs'
+ n = (a.size + 5) / 5 # n rows, 5 columns each
+ aa = Array.new(n)
+ maxlen = [0,0,0,0,0]
+ 0.upto(n) do |y|
+ aa[y] = []
+ 0.upto(4) do |x|
+ el = a[y+x*(n+1)]||''
+ maxlen[x] = [maxlen[x],el.size].max
+ aa[y].push(el)
+ end
+ end
+ format = "%% "
+ maxlen.each { |l| format << "%-#{l}s &" }
+ format.chop!
+ format << "\\NN"
+ aa.each { |row| puts format % row }
+ else
+ usage
+end
+
+# $Id: listkeys,v 1.1.1.1 2006/09/15 21:27:36 wybo Exp $