summaryrefslogtreecommitdiff
path: root/indexing/texindex/ix.format
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /indexing/texindex/ix.format
Initial commit
Diffstat (limited to 'indexing/texindex/ix.format')
-rw-r--r--indexing/texindex/ix.format33
1 files changed, 33 insertions, 0 deletions
diff --git a/indexing/texindex/ix.format b/indexing/texindex/ix.format
new file mode 100644
index 0000000000..eb2b389ad5
--- /dev/null
+++ b/indexing/texindex/ix.format
@@ -0,0 +1,33 @@
+# ix.format : awk - script
+# entfernt Sortierschluessel, fuegt \item etc. ein
+BEGIN {
+ FS = OFS = "\t"
+ printf "\\begin{theindex}"
+ }
+ {
+ n = split($2,feld,", ")
+ if (n > 3)
+ {
+ for (i=4; i <=n; i++)
+ feld[3] = feld[3] ", " feld[i]
+ n = 3
+ }
+ for (i = 1; feld[i]==altfeld[i] && i<=n ; i++)
+ ;
+ for (k=i; k <=n; k++)
+ {
+ printf "\n\\"
+ for (j=1; j<k; j++)
+ printf "sub"
+ printf "item %s ",feld[k]
+ }
+ nzahl = split($3,zahlfeld," ")
+ for (j=1; j<nzahl; j++)
+ printf"%s, ",zahlfeld[j]
+ printf "%s",zahlfeld[nzahl]
+ for (j=1; j<=i; j++)
+ altfeld[i] = feld[i]
+ }
+END {
+ printf "\n\\end{theindex}\n"
+ }