summaryrefslogtreecommitdiff
path: root/Build/tools/etc/reindent-workingtpm.pl
blob: 0c42b724b3e680e9bc2a79e71589ca883200313d (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

my @WorkingTPM = qw(
        12many
        a0poster aastex abbr abc abstract accfonts acmtrans acronym
          active-conf aguplus algorithm2e algorithmicx algorithms
          alnumsec ams amscls amsldoc-it amsltx2 amsmath amsrefs
          amsthdoc-it apacite appendix arabtex archaic arcs arev
          armenian arrayjob arydshln ascii assignment attachfile
          aurical
        babelbib beamer beamer-tut-pt beebe begriff betababel bezos
          bghyphen bibhtml bibleref bibtopic bibunits bigfoot
          birthday bitfield blacklettert1 blindtext booklet bophook
          boxhandler breakurl bussproofs bytefield
        caption carlisle cbcoptic ccaption cdpbundl cellspace
          changebar chappg chem-journal chemcompounds cherokee circ
          citeref cjhebrew clefval clock cmdtrack cmll colorinfo
          colortbl commath compactbib complexity comprehensive
          computational-complexity cool coollist coolstr cooltooltips
          coordsys courier-scaled courseoutline coursepaper coverpage
          crop csquotes ctable cursolatex curve curve2e curves
          custom-bib cvsty cyrillic
        dancers dashbox dateiliste datetime dcpic decimal digiconfigs
          dinat dingbat directory dk-bib doipubmed dottex
          draftwatermark dramatist dtxtut dvdcoll dvipsconfig dyntree
        ebong eCards economic ednotes eemeir egameps egplot eijkhout
          ellipsis elpres elsevier emulateapj endfloat endheads
          engrec enumitem envbig epiolmec epsf eqparbox es-tex-faq
          ESIEEcv esint esint-type1 eskd eskdx eso-pic etaremune
          ethiop ethiop-t1 euro europecv eurosans everypage exam
          examdesign examplep exercise expressg extarrows exteps
          extpfeil extsizes
        faktor fancyhdr fancynum fax featpost filecontents fixme
          flagderiv flippdf floatflt floatrow flowfram fltpoint
          fmtcount fncychap foekfont fontch fontspec forloop formular
          fourier fp free-math-font-survey frenchle fribrief functan
        galois gatech-thesis genmisc genmpage germbib ginpenc
          glossary gnuplottex gost graphics graphicx-psmin greenpoint
          grnumalt GuIT
        HA-prosper hands hepthesis hhtensor hitec hrlatex hvfloat
          hyperref hyperxmp hyphen-base hyphen-basque hyphen-german
          hyphen-greek hyphen-norwegian hyphen-ukenglish
          hyphen-usorbian hyplain
        ibygrk icsv IEEEconf IEEEtran ifxetex inlinebib invoice
          iopart-num isorot isotope
        jneurosci jpsj juramisc
        kalender kerkis keystroke koma-script
        l2picfaq l2tabu-english labelcas labels latex latex-tds
          layouts lcd lcg leaflet leawood ledmac lewis lfb lgreek lh
          limap linearA lineno lipsum listings listliketab lkproof
          logpap lsc lshort-bulgarian lshort-dutch lshort-english
          lshort-finnish lshort-french lshort-german lshort-italian
          lshort-japanese lshort-korean lshort-mongolian
          lshort-polish lshort-portuguese lshort-slovak
          lshort-spanish lshort-thai lshort-turkish lshort-ukrainian
          lshort-vietnamese ltablex ltabptch ltxindex ltxmisc
        mafr magyar mailing makebox makecell makecirc makeglos
          makeplot maple marginnote mathdots mathmode maybemath
          mcaption mceinleger mdwtools memoir MemoirChapStyles mentis
          menu metaobj metaplot metatex metauml mfpic mftinc mhchem
          mhs microtype minipage-marginpar minitoc minitoc mla-paper
          moderncv movie15 msg multicap munich muthesis mwcls mwrite
        nag natbib nath nature ncclatex ncctools newlfm nih noitcrul
          nomencl nomentbl ntgclass ntheorem-vn numline numprint
        oberdiek ocr-latex octavo ofs ogham oldstyle opcit
        papercdcase paresse parrun pauldoc pdf-trans pdfcprot
          pdfpages pdfscreen pdftex-def perception perltex permute
          pgf phaistos pict2e pictex pittetd placeins plari plates
          poemscol polynom powerdot ppr-prv pracjourn preprint
          prettyref preview probsoln program protocol pseudocode
          psfrag psnfss pspicture pst-3d pst-3dplot pst-bar
          pst-barcode pst-blur pst-eucl pst-fr3d pst-func pst-labo
          pst-lens pst-math pst-optic pst-osci pst-pdf pst-pdgr
          pst-slpe pst-uml pstricks pstricks-add
        qcm qtree
        randbild rccol rcsinfo refstyle resume robustcommand
          robustindex rsc rtkinenc rtklage
        sae sauerj sauterfonts savefnmark savesym savetrees scale
          scalebar scientificpaper sciposter screenplay script
          sectionbox sectsty semantic semaphor seminar semioneside
          seqsplit setspace sf298 sffms sgame shadbox shapepar
          shorttoc showdim showexpl showlabels sidecap sides siggraph
          SIstyle SIunits skaknew slideshow smalltableof smartref
          snapshot songbook sort-by-letters soul sparklines spie
          splines splitbib splitindex spotcolor sprite srcltx sseq
          ssqquote stack stage stdclsdv stdpage stellenbosch struktex
          sttools subeqn subeqnarray subfig subfloat substr sudoku
          sudokubundle sugconf supertabular svn svn-multi svninfo
          swebib syntax syntrace synttree
        t-angles Tabbing tableaux tabulary tabvar talk tamethebeast
          tengwarscript tensor teubner tex-refs texmate texshade
          textcase textfit textopo textpos thesis-titlepage-fhac
          thumb thumbpdf ticket titlefoot titlesec titling tocbibind
          tocloft todo tokenizer toolbox tools totpages tracking
          trajan trfsigns trsym tugboat twoup Type1fonts typedref
          typogrid
        ucthesis uhrzeit uiucthesis umich-thesis umlaute underlin
          undertilde units unitsdef upquote ushort
        vancouver variations varindex vector velthuis verse versions
          vhistory visualfaq vmargin volumes vpe
        wallpaper warning warpcol williams wordlike wrapfig
        xcolor xifthen xkeyval xltxtra xq xtab xyling xypic-tut-pt
          xytree
        york-thesis
    ); 



my @foo = sort {uc($a) cmp uc($b)} @WorkingTPM;

print_foo(@foo);


sub firstletter {
  my ($bar) = @_;
  my @foo = split //, $bar;
  return(uc($foo[0]));
}
  
sub print_foo {
  my(@foo) = @_;
  my $newletter = 1;
  my $curline = "";
  my $curletter = "";
  my $initshift = "        ";
  my $medshift = "  ";
  foreach $t (@foo) {
     my $fl = firstletter($t);
     if ($fl eq $curletter) {
         if (length($curline) + 1 + length($t) >= 70) {
             print "$curline\n";
	     $curline = "$initshift$medshift$t";
	 } else {
	     $curline .= " $t";
	 }
     } else {
         print "$curline\n";
	 $curline = "$initshift$t";
	 $curletter = $fl;
     }
  }
  print $curline;
}