summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pdfcprot/pdfcprot.dtx
blob: a7d4cb53a7b622795c087f76639e18deb32bf08d (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
% \CheckSum{1342}
% \iffalse
% ======================================================================
% pdfcprot.dtx 
% Copyright (C) 2001/2002 Carsten Schurig
%
% This file is a package to use character protruding of pdftex.
%
% This file can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Version 1.2 or later distributed 
% together with this file. See LEGAL.TXT
% ======================================================================
%
% \charactertable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%<*dtx> 
\ProvidesFile{pdfcprot.dtx}
%</dtx>
%<driver> \ProvidesFile{pdfcprot.drv}
%<*dtx> 
%<*driver>
[2005/05/23 v1.7a pdfcprot
%</driver>
%</dtx>
%<dtx> documented source]
%<*driver>
 bundle]
\documentclass[10pt,a4paper]{ltxdoc}
%\usepackage[a4paper,BCOR20mm,DIV12]{typearea}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array,tabularx}
%\DisableCrossrefs
\EnableCrossrefs
\CodelineIndex
%\OnlyDescription
\RecordChanges
\MakeShortVerb{\|}
\setlength{\paperwidth}{597.50793pt}
\setlength{\textwidth}{405.45183pt}
\setlength{\evensidemargin}{17.83041pt}
\setlength{\oddsidemargin}{29.68571pt}
\setlength{\paperheight}{845.04694pt}
\setlength{\textheight}{634.0pt}
\setlength{\topmargin}{-34.84941pt}
\setlength{\headheight}{15.0pt}
\setlength{\headsep}{18.0pt}
\setlength{\topskip}{10.0pt}
\setlength{\footskip}{42.0pt}
\setlength{\baselineskip}{12.0pt}
\def\MacroFont{\ttfamily\footnotesize}
\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries\raggedright}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries\raggedright}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries\raggedright}}

\newenvironment{Declaration}%
{\par\small\addvspace{1.5\baselineskip plus .5\baselineskip}%
  \vspace{-\baselineskip}%
  \noindent\hspace{-10mm}%
  \begin{tabular}{|l|}\hline\ignorespaces}%
  {\\\hline\end{tabular}\nobreak\par\nobreak
  \vspace{1.5\baselineskip}\vspace{-\baselineskip}%
  \noindent\ignorespacesafterend}
\newcommand{\Macro}[1]{\mbox{\texttt{\char`\\#1}}}
\newcommand{\Option}[1]{\mbox{\texttt{#1}}}
\newcommand{\PName}[1]{\mbox{\texttt{#1}}}
\newcommand{\PValue}[1]{\textit{#1}}
\newcommand{\Parameter}[1]{\texttt{\{}\PName{#1}\texttt{\}}}
\newcommand{\OParameter}[1]{\texttt{[}\PName{#1}\texttt{]}}

 \newcommand{\Value}[1]{\textit{#1}}
\def\SpecialOptionIndex#1{\@bsphack
  \index{#1\actualchar{\protect\ttfamily#1}
    (option)\encapchar usage}%
  \index{options:\levelchar{\protect\ttfamily#1}\encapchar usage}\@esphack}
\def\Describe@Macro#1#2{\endgroup
  \begin{Declaration}
    #2
  \end{Declaration}%
  \SpecialUsageIndex{#1}\@esphack\ignorespaces}
\def\DescribeOption{\leavevmode\@bsphack\begingroup\MakePrivateLetters\Describe@Option}
\def\Describe@Option#1#2{\endgroup
  \begin{Declaration}
    #2
  \end{Declaration}%
  \SpecialOptionIndex{#1}\@esphack\ignorespaces}
\@ifundefined{KOMAScript}{%
  \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
      M\kern.05em A\kern.1em-\kern.1em Script}}}{}
\makeatother
\begin{document} 
 \DocInput{pdfcprot.dtx}
\end{document}
%</driver>
% \fi
% \GetFileInfo{pdfcprot.dtx}
% \makeatletter
% \def\macro{\begingroup
%    \catcode`\\12
%    \MakePrivateLetters \m@cro@ 0}
% \def\environment{\begingroup
%    \catcode`\\12
%    \MakePrivateLetters \m@cro@ 1}
% \def\option{\begingroup
%    \catcode`\\12
%    \MakePrivateLetters \m@cro@ 2}
% \def\Key{\begingroup
%    \catcode`\\12
%    \MakePrivateLetters \m@cro@ 3}
% \def\Counter{\begingroup
%    \catcode`\\12
%    \MakePrivateLetters \m@cro@ 4}
% \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist
%   \edef\saved@macroname{\string#2}%
%   \ifcase #1%
%     \edef\saved@@macroname{\expandafter\@gobble\saved@macroname}
%   \or
%     \edef\saved@@macroname{\expandafter\@gobble\saved@macroname}
%   \or
%     \edef\saved@@macroname{\expandafter\@gobble\saved@macroname}
%   \else
%     \let\saved@@macroname\saved@macroname
%   \fi
%   \def\makelabel##1{\llap{##1}}%
%   \if@inlabel
%     \let\@tempa\@empty \count@\macro@cnt
%     \loop \ifnum\count@>\z@
%       \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
%     \edef\makelabel##1{\llap{\vtop to\baselineskip
%                                {\@tempa\hbox{##1}\vss}}}%
%     \advance \macro@cnt \@ne
%   \else  \macro@cnt\@ne  \fi
%   \edef\@tempa{\noexpand\item[%
%      \ifcase #1%
%        \noexpand\PrintMacroName
%      \or
%        \noexpand\PrintEnvName
%      \or
%        \noexpand\PrintOptionName
%      \or
%        \noexpand\PrintKeyName
%      \or
%        \noexpand\PrintCounterName
%      \fi
%      {\string#2}]}%
%   \@tempa
%   {\advance\c@CodelineNo\@ne
%    \ifcase #1%
%       \SpecialMainIndex{#2}\nobreak
%       \DoNotIndex{#2}%
%    \or
%       \SpecialMainEnvIndex{#2}\nobreak
%    \or
%       \SpecialMainOptionIndex{#2}\nobreak
%    \or
%       \SpecialMainKeyIndex{#2}\nobreak
%    \or
%       \SpecialMainCounterIndex{#2}\nobreak
%    \fi
%    }%
%   \ignorespaces}
% \let\endoption\endtrivlist
% \providecommand*{\PrintOptionName}[1]{\strut \MacroFont #1\ }
% \providecommand*{\PrintKeyName}[1]{\strut \MacroFont #1\ }
% \providecommand*{\PrintCounterName}[1]{\strut \MacroFont #1\ }
% \newcommand*{\ttbksp}{\texttt{\char`\\}}
% \newcommand*{\SpecialMainOptionIndex}[1]{\@bsphack
%   \special@index{#1\actualchar{\string\ttfamily\space#1}
%     (option)\encapchar main}%
%   \special@index{options:\levelchar{\string\ttfamily\space#1}\encapchar
%     main}\@esphack}
% \newcommand*{\SpecialMainKeyIndex}[1]{\@bsphack
%   \special@index{#1\actualchar{\string\ttfamily\space#1}
%     (key)\encapchar main}%
%   \special@index{keys:\levelchar{\string\ttfamily\space#1}\encapchar
%     main}\@esphack}
% \newcommand*{\SpecialMainCounterIndex}[1]{\@bsphack
%   \special@index{#1\actualchar{\string\ttfamily\space#1}
%     (counter)\encapchar main}%
%   \special@index{counter:\levelchar{\string\ttfamily\space#1}\encapchar
%     main}\@esphack}
% \DoNotIndex{\!, \', \(, \), \,, \-, \., \:, \;, \?, \`}
% \DoNotIndex{\@ifundefined, \@onlypreamble, \@tempb, \@tempcnta,
% \@tempcntb, \@tfor}
% \DoNotIndex{\A, \a, \addtocounter, \advance, \and, \AtBeginDocument}
% \DoNotIndex{\bfseries, \B, \b, \boolean}
% \DoNotIndex{\C, \c, \char, \csname, \CurrentOption}
% \DoNotIndex{\D, \d, \DeclareOption, \def, \define@key, \divide, \do}
% \DoNotIndex{\E, \e, \else, \endcsname, \endinput, \equal,
% \expandafter}
% \DoNotIndex{\F, \f, \fi, \font, \fontdimen, \fontencoding,
% \fontfamily, \fontshape, \fontseries, \footnotesize, \f@encoding,
% \f@shape, \f@series, \f@family}
% \DoNotIndex{\G, \g, \gdef, \global}
% \DoNotIndex{\H, \h, \hbox, \Huge, \huge}
% \DoNotIndex{\I, \i, \ifcase, \IfFileExists, \InputIfFileExists,
% \ifnum, \ifthenelse, \ifx, \input, \itshape}
% \DoNotIndex{\J, \j}
% \DoNotIndex{\K, \k, \KV@errx}
% \DoNotIndex{\L, \l, \LARGE, \Large, \large, \let, \loop, \lpcode}
% \DoNotIndex{\M, \m, \mdseries, \MessageBreak, \multiply}
% \DoNotIndex{\N, \n, \NeedsTeXFormat, \newcommand, \newcounter,
% \newboolean, \newif, \normalsize}
% \DoNotIndex{\O, \o, \or}
% \DoNotIndex{\P, \p, \PackageError, \PackageInfo, \PackageWarning,
% \pdfoutput, \pdftexrevision, \pdftexversion, \ProcessOptions,
% \protect,, \protected@edef, \protected@xdef, \pdfprotrudechars, \ProvidesPackage}
% \DoNotIndex{\Q, \q, \quotedblbase}
% \DoNotIndex{\R, \r, \relax, \renewcommand, \repeat, \RequirePackage,
% \rmfamily, \rpcode}
% \DoNotIndex{\S, \s, \scriptsize, \scshape, \selectfont, \setboolean,
% \setbox, \setcounter, \setkeys, \sffamily, \slshape, \small, \space,
% \stepcounter, \string}
% \DoNotIndex{\T, \t, \textquotedblleft, \tiny}
% \DoNotIndex{\U, \u, \undefined, \upshape, \usepackage}
% \DoNotIndex{\V, \v, \value}
% \DoNotIndex{\W, \w, \wd}
% \DoNotIndex{\X, \x, \Y, \y, \Z, \z, \z@}
% \makeatother
% \title{The |pdfcprot.sty| Package.\thanks{This file has version \fileversion{} dated
% \filedate.}}
% \author{Carsten Schurig\thanks{This package depends intensely on
% code originally from H\`{a}n Th\'{\^{e}} Th\`{a}n.},Tobias Schlemmer}
% \maketitle
% \abstract{This package was written to provide the ``normal''
% \LaTeXe{} user an easy way to use the special character protruding
% feature invented by pdf\TeX. Further this package provides an easy
% interface to adjust the character protrusion for different fonts and
% choosing the right adjustment automatically depending on the font.}
% \tableofcontents{}
% \changes{1.0}{2001/10/26}{First submit able version. The package
% seems to work, but the documentation is  incomplete. This version
% was an internal one.}
% \changes{1.1}{2001/10/30}{Some of the code was changed while writing
% the documentation, because the first version had an annoyance: the
% files that contain the setup of the character protruding were loaded
% more than once because of the then used implementation. Now it's just loaded once, even
% if the font setting is used more (because it's the fallback).}
% \changes{1.7a}{2005/05/23}{Fixed a typo}
% \section{Introduction}
% As the abstract stated this package exists to provide a simple user
% interface to the character protruding feature of
% pdf\TeX\footnote{You'll find pdf\TeX{} on
% |CTAN:/sytems/pdftex|.}. This is a special way to do a margin
% kerning. By that it is possible to achieve a visual more ``smooth''
% margin. When not doing a margin kerning, the margins seems to be flattered a bit, especially at
% hyphens and punctuation. Character Protruding is a simple but nevertheless effective
% way to achieve a margin kerning.  For more information
% about margin kerning and especially character protruding see the
% thesis of H\`{a}n Th\'{\^{e}}
% Th\`{a}nh~\cite{hanthethanh:thesis}\footnote{It could be found on the
% web, but I don't remember where I got it.}.
%
% \subsection{A bit of History}
% Why did I write this package, so you can use it now? Well, it all
% started with my diploma thesis. I used \LaTeXe{} on a regular basis
% before that, but here I still had to increase my knowledge, esp. in
% typography. So I read somewhere in a book something about margin
% kerning (some book of Jan Tschichold). So I wanted to test, how
% it would look like.
%
% But my first questions in |de.comp.text.tex| where a bit
% unsuccessful. The only answers where, that it could be achieved with
% \TeX{}, but that it is not without problem. As an example the
% \LaTeX{}-Companion was mentioned, at least the German
% edition\cite{begleiter} was put with a kind of hanging
% punctuation. But in the preface Frank Mittelbach stated, that there
% doesn't exist a ready to use package for \LaTeXe{} and one would have
% to wait for \LaTeX3 very likely. And as you can easily see, only the
% hyphens and the punctuation signs were protruded. That was the
% situation of November 1994.
%
% But the situation seemed to be the same in 2000. I found
% \emph{nothing} really usable with \LaTeXe{} to put a longer text with
% (longer than some paragraphs). Then someone pointed out,
% that character protruding is a feature provided by the new
% pdf\TeX. At first I was a bit sceptical because I didn't want to
% switch, needing the possibility to use |EPS| input (I heavily
% used |psfrag|). But soon it was pointed out, that pdf\TeX{} supports
% |DVI| output and that in this mode pdf\TeX{} has no limitations
% compared to \LaTeX. Shortly after getting this information I found
% |protcode.tex| provided by H\`{a}n Th\'{\^{e}} Th\`{a}nh.
%
% That I transfered to a packaged for my own use and as some people
% showed interests on |de.comp.text.tex| I posted it
% there.\footnote{The first version was named |optrandausgleich.sty|
% and a second |pdftexfeats.sty|.} But it was never what I expected
% by a package to submit it to |CTAN|. It lacked documentation and
% the support of setting the character protruding depending on the
% used font.
%
% First I wanted to write a package adjusting some of the additional
% features of pdf\TeX{} (for instance the security features). But in
% discussions with Heiko Oberdiek he convinced me, that it is better
% to have some smaller packages instead of putting all into
% one. Additionally the resulting |pdfcprot| package grew more complex
% than expected at first. So the code is complex enough for me to
% maintain and Heiko does a really good job with |pdfsec.sty| (he
% supports more than pdf\TeX).
%
% \subsection{Provided Features}
% This package provides a very simple interface to support a font
% dependent selection of the adjustment of the character
% protrusion. You can easily choose, which fonts will be protruded
% depending on high level \LaTeXe{} font selection not knowing which
% font actually will be used. Further on it is very simple to adjust
% the character protrusion for fonts not ``supported''  directly (only
% for Palatino character protrusion adjustment set (|CPA|) is provided and
% that will be used for \emph{all} fonts, not having a special |CPA|).
%
% Further on an option to switch the pdf\TeX{} output to |DVI| and a
% command testing, whether you use |PDF| output or not are
% provided.\footnote{That was originally from \KOMAScript.}
%
% \section{Using this package.}
%
% First you have to invoke it with a |\usepackage{pdfcprot}| in
% the preamble of your document. Of course you have to use pdf\TeX{} to
% get any effect, but the package just gives a warning if you don't.
%
% \subsection{Requirements}
%
% This package need just two packages, which should be part of every
% \LaTeXe{} distribution not too old: |keyval.sty| (part of the
% |graphicx| bundle) and |ifthen.sty|). If they're not installed, get
% them from |CTAN|.
%
% \subsection{Character Protruding}
%
% For using the character protruding two user interfaces are
% implemented. If you just want to activate it for the most common
% used fonts, not thinking much about internals just use the
% \emph{simple} interface.
%
% When you don't like the preselection of the fonts being adjusted for
% character protruding, you may want to use the \emph{advanced} user
% interface. As the usage of many fonts for character protruding is
% very memory consuming, there may be some cases you want to choose
% non-ambiguous the fonts getting character protruding sparing any useless
% font.
%
% \subsubsection{The \emph{Simple} User Interface}
%
% For the ``normal'' \LaTeXe{} user, who just wants to activate the
% character protruding one option is provided. 
% \DescribeOption{activate}{\Option{activate [=none, normal]}}If you
% just want to activate character
% protruding for the most used fonts just say |activate| or
% |activate=normal| (these two forms are synonyms). For which fonts the
% character protrusion will be enabled is shown in
% table~\ref{tab:activate}. 
%
% By default character protruding won't be enabled, but if you want the
% options to reflect it say |activate=none|. 
%
% \begin{table}
% \centering%
% \begin{tabular}{l l l}\hline\hline
% family & series & shape\\\hline
% |\rmfamily| & |\mdseries| & |\upshape|\\
% & & |\itshape|\\
% & |\bfseries| & |\upshape|\\
% |\sffamily| & |\mdseries| & |\upshape|\\
% & & |\itshape| \\
% & & |\slshape| \\
% |\sffamily| & |\bfseries| & |\upshape|\\
% \hline\hline
% \end{tabular}\\[2mm]
% sizes for all fonts: |\footnotesize|, |\small|,
% |\normalsize| and |\large|
% \caption{Fonts for which character protrusion will be enabled
% using the package option
% \texttt{avtivate=normal}.}\label{tab:activate}
% \end{table}
%
% \emph{Some comments:} You may wonder why character protruding is
% activated for so many font types and not just for |\rmfamily||\mdseries||\upshape|
% and maybe |\sffamily| |\mdseries||\upshape| using |activate| or
% |activate=normal| as package option. That is done
% because I don't want to bother the ``normal'' \LaTeXe-user with more
% than passing the one option to the package but I still want to
% catch the fonts, most likely to be used in cases ``needing''
% character protrusion (this means justified text). As this may appear
% not only for the text type (but e.g. also for captions), though the
% two fonts mentioned above are not sufficient.
%
% \subsubsection{The \emph{Advanced} User Interface}
%
% In some cases it may be favourable to have a bit more control over the font
% selection for the character protruding. With the commands described
% in this section a very fine selection is possible.
%
% The first command to be mentioned has a very simple syntax. It
% allows the user to select a specific font encoding to be set up. It
% will perform the same setup for the given fontencodings as the
% |activate=normal| package option does without selection of font
% encoding. As for now |pdfcprot| has no opportunity to automagically
% detect the loaded font encodings, it will be necessary for setting
% up character protuding in cases where more than one font encodings
% are used. 
%
% \newlength{\myT}\settowidth{\myT}{\texttt{textcomp}}
% \DescribeMacro{\setupcharprotrudingforencoding}{\Macro{setupcharprotrudingforencoding}\Parameter{\emph{encodings}}}\begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% \emph{encodings} & This parameter is a comma sepapated list of font
% encodings to be set up. White space is not allowed.\\
% \end{tabularx}
%
% \begin{description}
% \item[Example 1:] The usage of
%
% \begin{quote} 
% |\usepackage[activate=none]{pdfcprot}|\\
% |\setupcharprotrudingforencoding{T1,T2A}|\\
% |\activatecharprotruding|
% \end{quote}
%
% will set up character protruding for both |T1| and
% |T2A| font encodings. This might be nessessary for example, if you
% want to use both German  and Russian text in one document.
% \end{description}
%
% The second command to be mentioned has a high level syntax. For that
% it's possible to choose the font by high level \LaTeXe{} font
% selection commands but only \emph{one} font at a time is
% selectable. To setup the character protruding for more than one
% font, this command has to be called more than once.
% \DescribeMacro{\setupcharprotruding}{\Macro{setupcharprotruding}\Parameter{encoding=\emph{enc},family=\emph{fm}, series=\emph{sr}, shape=\emph{sh}, size=\emph{sz}[, textcomp=\emph{tc}]}}\begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |encoding| & This tag specifies the encodings to be used. Valid
% values are all valid font encodings. If more than one font encoding
% shall be set up, they have to be seperated by commas \emph enclosed
% in braces.
% \emph{This tag is optional. If it is not used, the command will
% behave like in versions prior to v1.7}\\
% \end{tabularx}
% \begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |family| & This tag specifies the family to be used. |rmfamily| and
% |sffamily| are valid values. Any other value will be supposed as a low level
% font name (see below). \emph{This tag is mandatory.}\\
% \end{tabularx}
% \begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |series| & This tag is used to chose the font series. Valid values are
% |mdseries| and |bfseries|. Any other value will be supposed as a low level
% font name (see below). \emph{This tag is mandatory.}\\
% \end{tabularx}
% \begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |shape| & The font shape is chosen using this tag. As for the other
% tags valid values are the high level \LaTeXe{} font selection
% commands without trailing backslash, as are: |upshape|, |itshape|,
% |slshape|, and |scshape|. Any other value will be supposed as a low level
% font name (see below). \emph{This tag is mandatory.}\\
% \end{tabularx}
% \begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |size| & This tag is to select the wanted font sizes. Valid values
% are also the \LaTeXe{} high level font size selection commands
% without trailing backslash, that are: |Huge|, |huge|, |LARGE|,
% |Large|, |large|, |normalsize|, |small|, |footnotesize|,
% |scriptsize|, and |tiny|. \emph{This tag is mandatory.}\\
% \end{tabularx}
% \begin{tabularx}{\linewidth}{@{}p{\myT} X@{}}
% |textcomp| & This is a boolean switch for choosing whether to
% activate character protruding for TS1 encoded fonts also or
% not. Values are |true| (|on|, |yes|, |1|), or |false| (|off|, |no|,
% |0|). \emph{This tag is optional. If this tag is not specified it
% defaults to \emph{|false|}.}\\
% \end{tabularx}
%
% \paragraph{The low level font selection.} The ``normal'' parameters
% for font selection are the high level \LaTeXe{} font selection
% commands without trailing backslash. Using any option other than
% that for the tags |family|, |series|, and |shape|, a low level font
% selection command will be suggested. By that it is possible
% to setup the character protruding for a font with a user defined font
% selection command but without struggling with internal commands of
% |pdfcprot.sty|.
%
% \newlength{\scpw}\settowidth{\scpw}{\ttfamily asetupcharprotrudinga}
% \begin{description}
% \item[Example 1:] The usage of
%
% \begin{quote} 
% |\usepackage[activate=none]{pdfcprot}|\\
% |\setupcharprotruding{encoding=T2A,family=rmfamily,series=elec,|\\ 
% \hspace*{\scpw}|shape=ui,size=normalsize,|\\
% \hspace*{\scpw}|textcomp=false}|\\
% |\activatecharprotruding|
% \end{quote}
%
% will result in a command to setup character protruding like:\\
% |\fontencoding{T2A}\selectfont\rmfamily\fontseries{elec}\selectfont|\\
% |\fontshape{ui}\selectfont\normalsize\CPROT@setprotcodes@font|
%
% This means for the font |\rmfamily| with font series |elec| and font
% shape |ui| character protruding for |T2A| encoding will be adjusted.
% \end{description}
%
% \begin{description}
% \item[Example 2:] Using
%
% \begin{quote}
% |\usepackage[activate]{pdfcprot}|\\
% |\setupcharprotruding{family=rmfamily,series=bfseries,|\\ 
% \hspace*{\scpw}|shape=upshape,size=normalsize,|\\
% \hspace*{\scpw}|textcomp=false}|\\
% |\activatecharprotruding|
% \end{quote}
%
%  will lead to a command to setup character protruding like:\\
%  |{\CPROT@setprotcodes@font}|\\
% |{\rmfamily\bfseries\upshape\normalsize\CPROT@setprotcodes@font}|
% \end{description}
%
% A low level selection of the font size is not possible with
% |\setupcharprotruding|. For setting
% up the character protruding using other font size commands than the
% high level \LaTeXe{} ones, the usage of internal |pdfcprot| commands
% is needed.
%
% To setup more than two or three fonts with the command above
% described would be a bit long-winded. So there's another command
% provided with which it is possible to select more than one font at a
% time (with some limitations).
% \DescribeMacro{\setupcharprotrudingnumeral}{\Macro{setupcharprotrudingnumeral}\Parameter{encoding=\emph{enc},family=\emph{fm}, series=\emph{sr}, shape=\emph{sh}, size=\emph{sz}[, textcomp=\emph{tc}]}}The
% principal meaning of the tags is the same as for
% |\setupcharprotruding|, especially |encoding| and |textcomp| is exactly the
% same. The only thing differing for |family|, |series|, |shape|, and
% |size| is the way the font has to be chosen.
%
% Here a scheme is used similar to the numeral interface of |chmod| on
% UNIX systems. That means every \LaTeXe{} high level font selection
% command got a number assigned. More than one fonts are choose able by
% adding the fitting numbers. The suitable values are
% shown in table~\ref{tab:scpnum}. If one parameter is zero, the actual
% command will have no effect,
%
% \newcommand{\nil}{\textrm{\emph{nil}}}
% \begin{table}\centering
% \begin{tabular}{@{}>{\ttfamily}r >{\ttfamily}l >{\ttfamily}l
% >{\ttfamily}l >{\ttfamily}l@{}}\hline\hline
% \textrm{value} & \textrm{family} & \textrm{series} & \textrm{shape}
% & \textrm{size}\\\hline
% 0 & none & none & none & none\\
% 1 & sffamily & bfseries & scshape & tiny\\
% 2 & rmfamily & mdseries & slshape & scriptsize\\
% 4 & \nil & \nil & itshape & footnotesize\\
% 8 & \nil & \nil & upshape & small \\
% 16 & \nil & \nil & \nil & normalsize \\
% 32 & \nil & \nil & \nil & large \\
% 64 & \nil & \nil & \nil & Large \\
% 128 & \nil & \nil & \nil & LARGE \\
% 256 & \nil & \nil & \nil & huge \\
% 512 & \nil & \nil & \nil & Huge
% \\\hline\hline
% \end{tabular}
% \caption{The numbers to use with
% \texttt{\string\setupcharprotrudingnumeral}.}\label{tab:scpnum}
% \end{table}
%
% \settowidth{\scpw}{\ttfamily asetupcharprotrudingnumerala}
% \begin{description}
% \item[Example 1:] For |\rmfamily||\mdseries| the character
% protruding is to be adjusted for |\upshape| and |\itshape| for the
% sizes |\large|, |\normalsize| and |\footnotesize|. Further for the
% font |\rmfamily||\bfseries||\upshape| with the same font sizes, but
% in T2A encoding,
% character protruding is wanted. To achieve that, one would have to call:
% 
% \begin{quote}
% |\usepackage[activate=none]{pdfcprot}|\\
% |\setupcharprotrudingnumeral{family=2,series=2,shape=12,size=52}|\\
% |\setupcharprotrudingnumeral{encoding=T2A,family=2,series=1,shape=8,size=52}|\\
% |\activatecharprotruding|
% \end{quote}
%
% Explanation: |family| and |series| are directly readable from
% table~\ref{tab:scpnum}, as is |shape| for the second call of
% |\setupcharprotrudingnumeral|. To get the value of |shape| for the
% first command, the values for |shape=upshape| and |shape=itshape| (8
% and 4) must be added. Similar it's for |size|, one has to add the values
% for |size=footnotesize| (4), |size=normalsize| (16), and
% |size=large| (32).
% \end{description}
%
% The setup of character protruding using
% |\setupcharprotrudingnumeral| is just possible for fonts accessed by
% high level \LaTeXe{} font selection commands.
%
% \paragraph{Remarks.} Both commands to select the fonts for which
% character protrusion will be adjusted are \emph{only} usable in the preamble
% of the document.
%
% The attentive reader may have noticed another command needed to
% activate the character protrusion when calling the package with the
% option |activate=none|. That is due to the fact, that the
% |\setupcharprotruding| commands just create a command to call at the
% start of the document to adjust the amount of the character
% protruding for a special font (on a character basis), but does not
% activate the using of character protruding itself.
% \DescribeMacro{\activatecharprotruding}{\Macro{activatecharprotruding}\OParameter{\emph{activate}}}Valid 
% values for \texttt{\emph{activate}} are |true| (|yes|, |on|, |1|),
% false (|no|, |off|, |0|), or |compatible| (|compatibility|). Calling
% |\activatecharprotruding| without any parameter means |true|. With
% |true| and |false| the character protruding is switched on and off
% respectively. Why the parameter |compatible|? As the character
% protrusion moves some character into the margins, the word spaces on a
% line may change. When using |activate=true|, |pdflatex| will take this
% additional space into account and by that the line breaks may
% change compared to the use of ``normal'' |latex|. If the line breaks
% are wanted as got by using |latex| but with a active character
% protruding, you'll have to call |\activatecharprotruding| with the
% parameter |compatible|.
%
% The activation of the character protruding is group specific. So it
% is possible to activate and deactivate the character protrusion for
% some parts of a text (but not the \emph{amount} of the character
% protrusion of a special font).
%
% The package output is very informative when looking at the |log| file,
% but the output to |stdout| is normally not. To change that, there's
% one option
% \DescribeOption{quiet}{\Option{quiet=\emph{qt}}} Possible values for
% this parameter are the booleans used in this package (|true|, |on|,
% |yes|, |1|, |false|, |off|, |no|, and |0|). When saying |quiet=no|
% many of the package info will be warnings instead. That is a good
% method to see, which font character protrusion adjustment actually
% will be used (and for which font).
%
% \subsection{The Character Protruding Adjustment -- Creating and
% Using a New One for a Specific Font}
%
% \emph{This section is a bit technical and a study of the source code
% may be very helpful (and is recommended).}\\
%
% To understand what the purpose of this section is, a description of
% the strategy of the package is needed. So what does the package do?
% The command |\setupcharprotruding| and its numerical equivalent will
% create a command with the fitting font selection commands and a
% command |\CPROT@setprotcodes@font|. The whole command will be called at the
% start of the document. Then the font selection takes place and
% |\CPROT@setprotcodes@font| looks, what font was requested
% actually.\footnote{The commands used to determine which font is loaded
% (\texttt{\string\f@family}, \texttt{\string\f@series},
% \texttt{\string\f@shape}, \texttt{\string\f@encoding}) return the
% font requested to \TeX{} \emph{not} the font actually used, so it
% seems. That means for instance if you request a bold Palatino font
% with \texttt{\string\bfseries}, \TeX{} will try to load \texttt{ppl/bx/n} but will only
% find and use \texttt{ppl/b/n} (at least on my system). So as series the
% actual font will be \texttt{b} and not \texttt{bx} which will be reported by the
% use of \texttt{\string\f@series}. Though one could think it would be needed to
% adjust the character protruding in a \texttt{CPA} for
% \texttt{pplbn}, it will be looked for \texttt{pplbxn} instead.} Then it
% looks if a command named |\f@family| |\f@series||\f@shape\f@encoding| is
% defined (the concatenate values of the commands). If it is, this command will be
% used to setup the character protruding, if not |pdfcrpot| will try
% to load a file named |fontname.cpa| containing this command. If that
% fails as well, a fallback font will be used (by default it will be
% |pplmn| with the appropriate font encoding).
%
% To define the command to set up the character protruding, an
% external file was chosen to get an easier maintenance. Defining it
% in the package would enlarge the package noticeably and the package
% would soon become overcrowded.
%
% So if a special character protruding setting for a
% font is wanted, copy the file |pplmnT1.cpa| (for T1 encoding) to the
% required fontname|.cpa| and change the definition of the command
% accordingly.
%
% \begin{description}
% \item[Example: ] A special character protruding setup for the bold version of Palatino in
% T1 encoding is wanted. As the \LaTeXe{} command
% |\bfseries| selects an bold expanded version (|bx|), the font name would be |pplbxnT1.cpa| and
% the command to define |\pplbxnT1|. That means to copy |pplmnT1.cpa|
% to |pplbxnT1.cpa| and change the definition of |\csname pplmnT1\endcsname|
% to |\csname pplbxnT1\endcsname| and further on to adjust the wanted
% |\rpcode| and |\lpcode| values.
% \end{description}
%
% For the meaning of the commands and values in the |CPA| see the documentation of the code
% below and H\`{a}n Th\'{\^{e}} Th\`{a}nh's
% thesis~\cite{hanthethanh:thesis}. There he writes:
% \begin{quote}
% ``\dots A set of common character protruding factors gave quite reasonable
% results in most cases. Non-typical type faces may require further
% adjustments, which can be done easily.''
% \end{quote}
% So for the most fonts the default values may be acceptable, even
% though they are adjusted for Palatino. By using the |CPA| files and
% defining an extra command per font it is very easy to add setups
% for ``non-typical'' type faces without bothering a ``normal''
% \LaTeXe{} user of choosing the right setup because it gets
% automatically selected.
%
% \subsection{Customising the Package}
%
% There's one command provided to customise the package.
% \DescribeMacro{\setfallbackfont}{\Macro{setfallbackfont}\Parameter{\textit{string}}}As
% described in the section before, this package will look for a
% character protrusion adjustment for a \emph{fallback} font, when not
% finding a |CPA| for the actual font. By default this is
% |pplmn|. That is changeable using |\setfallbackfont|, if a special
% |CPA| was created and suits better. The \emph{|string|} used in
% |\setfallbackfont| specifies the font \emph{without} the character
% encoding. That will be determined by the package.
%
% \subsubsection{System-wide customisation}
%
% For further customisation this package looks for a
% \DescribeOption{pdfcprot.cfg}{\Option{pdfcprot.cfg}}somewhere
% in your \TeX{} paths. If found it'll be included before any option is
% validated. So you can change some settings on a system-wide
% basis. This file is the best place to change some internal commands,
% if needed, for instance to change which fonts will be activated for
% character protruding when using the option |activate=normal| (by
% redefining |\CPROT@setupcharprotruding@normal|).
%
% \subsection{Other Commands and Options}
%
% Belonging not really to character protrusion this package provides
% two other commands and one additional option, that may be useful in
% dealing with pdf\TeX.
%
% First there's is an option to get a |DVI| output using pdf\TeX.
% \DescribeOption{DVIoutput}{\Option{DVIoutput}}This may be useful
% if one can't switch completely to pdf\TeX, because in this mode all
% the additional features of pdf\TeX\footnote{That's not completely
% true though. The supported type of images is in |DVI| mode the same
% as using |latex|.} (as character protruding) are
% available but besides there're no compatibility problems and it
% behaves the same as ``normal'' \LaTeX. So it is for instance possible to include
% |EPS| (and use |psfrag|!). Principally it is not needed to supply
% such an option, because by redefining |\pdfoutput| to |0| you'll get
% |DVI|. The only problem is, that some packages only look if
% |\pdfoutput| is defined to decide, if |PDF| output is
% wanted. So
% this option does an additional
% |\let\pdfoutput\undefined|.\footnote{Most actual versions of packages
% having had problems may treat it correctly by now. But who has all
% packages installed in most recent versions?}
%
% Further on there are two \LaTeXe{}-commands to decide, if pdf\TeX{}
% is used and if |PDF| as output is wanted.
% \DescribeMacro{\ifpdftex}{\Macro{ifpdftex}\Parameter{\emph{\texttt{true}}}\Parameter{\emph{\texttt{false}}}} and
% \DescribeMacro{\ifpdfoutput}{\Macro{ifpdfoutput}\Parameter{\emph{\texttt{true}}}\Parameter{\emph{\texttt{false}}}} 
% The latter one was originally 
% taken from the \KOMAScript{} package. So you can use
% the same |\ifpdfoutput| command with or without \KOMAScript. The
% meaning shouldn't change neither in \KOMAScript{} nor in this
% package and the actual definition is not cruel for using this
% command\footnote{If you want a \TeX{} \texttt{\bslash if} switch, look for \texttt{ifpdf.sty} on
% CTAN written by Heiko Oberdiek.}.
%
% The command |\ifpdftex| is very similar but leads to a decision
% depending on the usage of pdf\TeX{} or not. This is useful for the
% activation of special features of pdf\TeX{} not being special to the
% production of |PDF| itself (as character protruding is).
%
% \section{Bugs and Caveats}
%
% Hopefully there're no bugs left, but only features |;->|. But one
% thing: right now this package contains just character protruding
% settings for OT1 and T1 encoded fonts (and one character of TS1). Further there
% are some (small) problems (two).
%
% First, the creating of the code to do the adjustment of the character
% protruding at the |\begin{document}| is a bit time consuming. The
% more fonts you want to use with character protruding, the longer is the
% time needed. Also the needed memory by pdf\TeX{} can not be
% neglected. Here it's also especially a problem when using many fonts
% (in companion with character expansion it's just increasing). But
% that's not a big problem, because the standard amount of memory for
% pdf\TeX{} is for computer systems of today just a bit small
% adjusted (65535 bytes!). Though you may want to change (or set) the
% parameter |pdf_mem_size| in your |texmf.cnf|.\footnote{That is a
% suggestion of myself. I don't know what the authors of pdf\TeX{} say
% to that!.}
%
% \section{Contributing}
%
% Almost any contribution is welcome. Really needed is the
% contribution of |CPA|'s for other encodings than T1 and OT1. But T1
% and OT1 |CPA|'s may not be perfect. The glyphs are complete for
% German (I hope so) but I don't know for other languages.
%
% Also |CPA| for fonts not looking good with the distributed
% ``default'' values would be nice, even if these fonts are not widely
% used.
%
% Any bug hunting is welcome. Also changes to improve the performance
% are likely to be included, if the performance increase is
% significant and the readability of the package is not distorted too
% much (a good readability was a main focus when writing this package;
% that's one reason why almost on all places where possible \LaTeXe{}
% commands are used.).
%
% If you have some changes, requests, ideas or any other things
% regarding this package feel free to mail to Tobias Schlemmer:
% |keinstein_junior@gmx.net|.
% \changes{1.7}{2004/06/28}{New supporter}
%
% \section{Acknowledgements}
%
% All of the people are already mentioned in the text above, but I
% have to emphasise some things.
%
% For these bundle I used many from \KOMAScript. Particularly the
% boring but needed things around the package (|README.txt|,
% |INSTALL.txt| and the preambles in |pdcprot.ins|) were designed
% using files from \KOMAScript. In some parts I just changed
% \KOMAScript{} to |pdfcprot| (were appropriate). So I owe much to
% Markus Kohm (or the users of this package, because these files would
% be much shorter and maybe indistinct). As already stated there's
% some code taken from \KOMAScript.
%
% Further on some important role played Heiko Oberdiek (I don't think
% he guesses so). As stated in the History I first wanted to create a
% package for many (all) special pdf\TeX{} features (character
% protruding, font expansion, |PDF| security options). But he
% convinced me to write a package just concerning character
% protruding -- luckily, because it's got to more code than I expected
% first.
%
% And last but not least the authors of pdf\TeX{} have to be
% mentioned. Some code comes directly from them.
% 
% \nocite{*}
%\begin{thebibliography}{1}

%\bibitem{hanthethanh:thesis}
%H\`{a}n~Th\'{\^{e}} Th\`{a}nh.
%\newblock {\em Micro-typographic extensions to the {\TeX} typesetting system}.
%\newblock Dissertation, Masaryk University Brno: Faculty of Informatics,
%  October 2000.

%\bibitem{begleiter}
%Michel Goosens, Frank Mittelbach, and Alexander Samarin.
%\newblock {\em Der {\LaTeX}-Begleiter}.
%\newblock Addison-Wesley, 1st edition, 1994.

%\end{thebibliography}
% \StopEventually{}
% \appendix
% \section{The Code Itself}
% 
% First some remarks: the documentation may be inaccurate in some
% places, so look at the code and it'll be very likely that the
% documentation is incomplete.

% The main attention writing this code
% was turned on creating a good human readable code. So I decided to
% use as much \LaTeXe{} control sequences as possible and as less
% \TeX{} commands as needed. This may slow down the code, but I don't
% think that's really important.
%
% \subsection{The Package}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% First the requirement of \LaTeXe{}\footnote{The version needed was
% taken from |ifthen.sty|, because this package does request it. But I
% don't know if |pdfcprot.sty| may require some newer version because
% of some construct being used. If someone finds something which
% requires a newer version of \LaTeXe{} please tell me.} and the
% declaration of the package.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{pdfcprot}[2002/02/27 v1.5 character protruding using
pdflatex (cs)]
%    \end{macrocode}
% Then the required packages are loaded. Only |ifthen.sty| and
% |keyval.sty| are needed. These should be part of any decent
% \LaTeXe-distribution |;->|.
%    \begin{macrocode}
\RequirePackage{ifthen}
\RequirePackage{keyval}
%    \end{macrocode}
% These are the counters to determine for which font character
% protruding will be activate by using |\setupcharprotruding| and
% |\setupcharprotrudingnumeral|. The possible values are listed in
% table~\ref{tab:scpnum}. Further on |CPROT@family|, |CPROT@series|,
% and |CPROT@shape| can be |-1|, which is used for the low level font
% selection by |\setupcharprotruding|. The |...@temp| counters are
% needed when creating |\CPROT@setprotcodes@|.
%    \begin{macrocode}
\newcounter{CPROT@family}
\newcounter{CPROT@family@temp}
\newcounter{CPROT@series}
\newcounter{CPROT@series@temp}
\newcounter{CPROT@shape}
\newcounter{CPROT@shape@temp}
\newcounter{CPROT@size}
\newcounter{CPROT@size@temp}
%    \end{macrocode}
% For determining if the character protruding will be activated for the
% corresponding TS1 encoded font a boolean is used.
%    \begin{macrocode}
\newboolean{CPROT@textcomp}
%    \end{macrocode}
% \begin{option}{quiet}
% For providing the |quiet| option a (global) boolean is used. By
% default it is set to |true|, so there're little warnings (but it
% will be written as info to the logs).
%    \begin{macrocode}
\newboolean{CPROT@quiet}
\setboolean{CPROT@quiet}{true}
%    \end{macrocode}
% \end{option}
% A temporary counter (|\@tempcnta| could be used instead).
%    \begin{macrocode}
\newcounter{CPROT@temp@chars}
%    \end{macrocode}
% \begin{macro}{\CPROT@lowlevel@encoding}
% \begin{macro}{\CPROT@lowlevel@family}
% \begin{macro}{\CPROT@lowlevel@series}
% \begin{macro}{\CPROT@lowlevel@shape}
% Some ``vars'' are needed to store the low level names if some
% low level font was requested using |\setupcharprotruding|. (These are
% just temporary commands only used while creating the command to do
% the actual adjustment of the character protrusion.)
% \changes{1.7}{2004/06/28}{\texttt{\protect\string\string\CPROT@lowlevel@encoding} added}
%    \begin{macrocode}
\newcommand*{\CPROT@lowlevel@encoding}{}
\newcommand*{\CPROT@lowlevel@family}{}
\newcommand*{\CPROT@lowlevel@series}{}
\newcommand*{\CPROT@lowlevel@shape}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\CPROT@resetall}
% This is to reset all the counters to zero, so that a new
% |\setupcharprotruding|\dots command won't activate something
% requested with a former command.
%    \begin{macrocode}
\newcommand*{\CPROT@resetall}{%
  \setcounter{CPROT@family}{0}%
  \setcounter{CPROT@series}{0}%
  \setcounter{CPROT@shape}{0}%
  \setcounter{CPROT@size}{0}%
  \setboolean{CPROT@textcomp}{false}%
  \edef\CPROT@lowlevel@encoding{}%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\CPROT@setprotcodes@}
% \begin{macro}{\CPROT@setprotcodes@add}
% \begin{macro}{\CPROT@setprotcodes@temp}
% These are internal macros regarding the creation of the actual
% command, to adjust the character protruding for the fonts
% wanted. |\CPROT@setprotcodes@| actually will contain the command,
% whereas |\CPROT@setprotcodes@temp| is used to store part of this
% command temporary. |\CPROT@setprotcodes@add| is called by
% |\setupcharprotruding| and |\setupcharprotrudingnumeral|. 
%    \begin{macrocode}
\newcommand*{\CPROT@setprotcodes@}{}
\newcommand*{\CPROT@setprotcodes@add}{%
%    \end{macrocode}
% The counter |CPROT@family@temp| is set, which will be used
% internally to determine which fonts were requested.
%    \begin{macrocode}
  \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
%    \end{macrocode}
% Here the actual evaluation will take place starting with the font
% encoding.
% \changes{1.7}{2004/06/28}{starting with fontencoding}
%    \begin{macrocode}
  \CPROT@aac@encoding%
}
\newcommand*{\CPROT@setprotcodes@temp}{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\CPROT@packageinfo}
% \begin{macro}{\CPROT@packagewarning}
% \begin{macro}{\CPROT@packageerror}
% These are just substitutes for |\PackageInfo|, |\PackageWarning|,
% and |\PackageError|. It's just to spare some writing (esp. \{ snf \}
% are ``difficult'' to reach on a German keyboard) and it's simplier
% to customise if I would want to do something other than normal.
%    \begin{macrocode}
\newcommand{\CPROT@packageinfo}[1]{%
  \PackageInfo{pdfcprot}{#1}%
  }
\newcommand{\CPROT@packagewarning}[1]{%
  \PackageWarning{pdfcprot}{#1}%
  }
\newcommand{\CPROT@packageerror}[1]{%
  \PackageError{pdfcprot}{#1}%
  }
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\CPROT@packageinfo@or@warning}
% To support the Option |quiet| this command is used. It decides on
% the boolean |CPROT@quiet| wether to give out a message as warning or
% as info.
%    \begin{macrocode}
\newcommand{\CPROT@packageinfo@or@warning}[1]{%
  \ifthenelse{\boolean{CPROT@quiet}}{%
    \CPROT@packageinfo{#1}%
    }{%
    \CPROT@packagewarning{#1}%
    }%
  }%
%    \end{macrocode}
% \end{macro}
% \begin{Key}{encoding}
% \changes{1.7}{2004/06/28}{added}
%    \begin{macrocode}
\define@key{CPROT}{encoding}{%
  \ifthenelse{\equal{#1}{encodingdefault}}{%
    \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
  }{% I assume a low level encodingname is given
    \renewcommand*{\CPROT@lowlevel@encoding}{#1}%
  }%
}
%    \end{macrocode}
% \end{Key}
% \begin{Key}{family}
% \changes{1.2}{2001/10/31}{removed value \texttt{all}; if you want all, you
% should use the numeral interface}
%    \begin{macrocode}
\define@key{CPROT}{family}{%
  \ifthenelse{\equal{#1}{rmfamily}}{%
    \setcounter{CPROT@family}{2}% \rmfamily will be set
    }{%
    \ifthenelse{\equal{#1}{sffamily}}{%
      \setcounter{CPROT@family}{1}% \sffamily will be set
      }{% I assume a low level fontname is given
      \setcounter{CPROT@temp@chars}{0}%
      \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
        \stepcounter{CPROT@temp@chars}%
        }%
      \ifthenelse{\value{CPROT@temp@chars}>4}{%
        \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
          'rmfamily' or 'sffamily' was found. I assume you gave a\MessageBreak
          low level font name but it is at least unusual that a\MessageBreak
          TeX-fontname has more than 4 characters. I assume you know\MessageBreak
          what you're doing and continue, but the selection of the\MessageBreak
          font may fail!%
          }%
        \CPROT@packageinfo{It seem's as you want to use a low level\MessageBreak
          command for font selection. -- You're for yourself.%
          }%
        }{}%
      \setcounter{CPROT@family}{-1}%
      \renewcommand*{\CPROT@lowlevel@family}{#1}%
      }%
    }%
  }
%    \end{macrocode}
% \end{Key}
% \begin{Key}{series}
% \changes{1.2}{2001/10/31}{removed value \texttt{all}; if you want all, you
% should use the numeral interface}
%    \begin{macrocode}
\define@key{CPROT}{series}{%
  \ifthenelse{\equal{#1}{mdseries}}{% medium series
    \setcounter{CPROT@series}{2}%
    }{%
    \ifthenelse{\equal{#1}{bfseries}}{% bold series
      \setcounter{CPROT@series}{1}%
      }{% here the low level interface is suspected
      \setcounter{CPROT@temp@chars}{0}%
      \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
        \stepcounter{CPROT@temp@chars}%
        }%
      \ifthenelse{\value{CPROT@temp@chars}>4}{%
        \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
          'mdseries' or 'bfseries' was found. I assume you gave a\MessageBreak
          low level font name but a series identifier should consist\MessageBreak
          of 4 characters at maximum. I assume you know what you're\MessageBreak
          doing and continue, but the selection of the font will\MessageBreak
          very likely fail!%
          }%
        \CPROT@packageinfo{It seem's as you seem want to use a low level\MessageBreak
          command for font selection. -- You're for yourself.%
          }%
        }{}%
      \setcounter{CPROT@series}{-1}%
      \renewcommand*{\CPROT@lowlevel@series}{#1}%
      }%
    }%
  }%
%    \end{macrocode}
% \end{Key}
% \begin{Key}{shape}
% \changes{1.2}{2001/10/31}{removed value \texttt{all}; if you want all, you
% should use the numeral interface}
%    \begin{macrocode}
\define@key{CPROT}{shape}{%
  \ifthenelse{\equal{#1}{upshape}}{%
    \setcounter{CPROT@shape}{8}%
    }{%
    \ifthenelse{\equal{#1}{itshape}}{%
      \setcounter{CPROT@shape}{4}%
      }{%
      \ifthenelse{\equal{#1}{slshape}}{%
        \setcounter{CPROT@shape}{2}%
        }{%
        \ifthenelse{\equal{#1}{scshape}}{%
          \setcounter{CPROT@shape}{1}%
          }{% low lewel format
          \setcounter{CPROT@temp@chars}{0}%
          \expandafter\@tfor\expandafter\@tempb\expandafter:\expandafter=#1\do{%
            \stepcounter{CPROT@temp@chars}%
            }%
          \ifthenelse{\value{CPROT@temp@chars}>2}{%
            \CPROT@packageinfo@or@warning{None of the keywords 'all',\MessageBreak
              'upshape', 'itshape', 'slshape' or 'scshape' was\MessageBreak
              found. I assume you gave a low level font name but it\MessageBreak
              is at least unusual that a shape identifier has more\MessageBreak
              than 2 characters. I assume you know what you're doing\MessageBreak
              and continue, but the selection of the font will very\MessageBreak
              likely fail!%
              }%
            \CPROT@packageinfo{It seem's as you seem want to use a low level\MessageBreak
              command for font selection. -- You're for yourself.%
              }%
            }{}%
          \setcounter{CPROT@shape}{-1}%
          \renewcommand{\CPROT@lowlevel@shape}{#1}%
          }%
        }%
      }%
    }%
  }
%    \end{macrocode}
% \end{Key}
% \begin{Key}{size}
% \changes{1.2}{2001/10/31}{removed value \texttt{all}; if you want all, you
% should use the numeral interface}
%    \begin{macrocode}
\define@key{CPROT}{size}{%
  \ifthenelse{\equal{#1}{Huge}}{%
    \setcounter{CPROT@size}{512}%
    }{%
    \ifthenelse{\equal{#1}{huge}}{%
      \setcounter{CPROT@size}{256}%
      }{%
      \ifthenelse{\equal{#1}{LARGE}}{%
        \setcounter{CPROT@size}{128}%
        }{%
        \ifthenelse{\equal{#1}{Large}}{%
          \setcounter{CPROT@size}{64}%
          }{%
          \ifthenelse{\equal{#1}{large}}{%
            \setcounter{CPROT@size}{32}%
            }{%
            \ifthenelse{\equal{#1}{normalsize}}{%
              \setcounter{CPROT@size}{16}%
              }{%
              \ifthenelse{\equal{#1}{small}}{%
                \setcounter{CPROT@size}{8}%
                }{%
                \ifthenelse{\equal{#1}{footnotesize}}{%
                  \setcounter{CPROT@size}{4}%
                  }{%
                  \ifthenelse{\equal{#1}{scriptsize}}{%
                    \setcounter{CPROT@size}{2}%
                    }{%
                    \ifthenelse{\equal{#1}{tiny}}{%
                      \setcounter{CPROT@size}{1}%
                      }{% low lewel format
                      \CPROT@packageerror{%
                        None of the keywords 'all', 'normal' or any LaTeX2e\MessageBreak
                        font name was found. \MessageBreak
                        \space For more information how to use\MessageBreak
                        \string\setupcharprotrudingnumeral see the
                        pdfcprot manual.%
                        }%
                      }{}%
                    }%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }
%    \end{macrocode}
% \end{Key}
%    \begin{macrocode}
\define@key{CPROT}{textcomp}{%
  \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{1}\or\equal{#1}{yes}}{%
    \setboolean{CPROT@textcomp}{true}%
    }{%
    \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{0}\or\equal{#1}{no}}{%
      \setboolean{CPROT@textcomp}{false}%
      }{%
      \CPROT@packageerror{%
        ``#1'' is no setting for ``textcomp''. Use\MessageBreak
        one of 'true', 'on', 'yes', '1', or 'false', 'off', \MessageBreak
        'no', '0' instead.\MessageBreak
        }%
      }%
    }%
  }
\define@key{CPROTnum}{encoding}{%
  \ifthenelse{\equal{#1}{0}}{%
    \renewcommand*{\CPROT@lowlevel@encoding}{}% No encoding will be set.
  }{%
    \ifthenelse{\equal{#1}{1}}{%
      \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
    }{%
      \ifthenelse{\equal{#1}{encodingdefault}}{%
        \edef\CPROT@lowlevel@encoding{\encodingdefault}% \encodingdefault will be set.
      }{% I assume a low level encodingname is given
        \renewcommand*{\CPROT@lowlevel@encoding}{#1}%
      }%
    }%
  }%
}
\define@key{CPROTnum}{family}{%
  \ifthenelse{#1>0 \and #1<4}{%
    \setcounter{CPROT@family}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font family, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to family in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 3 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{series}{%
  \ifthenelse{#1>0 \and #1<4}{%
    \setcounter{CPROT@series}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font series, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to series in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 15 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{shape}{%
  \ifthenelse{#1>0 \and #1<16}{%
    \setcounter{CPROT@shape}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font shape, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to shape in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 15 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{size}{%
  \ifthenelse{#1>0 \and #1<1024}{%
    \setcounter{CPROT@size}{#1}%
    }{%
    \ifthenelse{#1=0}{%
      \CPROT@packageinfo{%
        As you selected '0' (that means 'none') for\MessageBreak
        selection of the font size, no font will\MessageBreak
        be set up for char protruding.%
        }%
      }{%
      \CPROT@packageerror{%
        Your given value '#1' to size in \string\setupcharprotrudingnumeral\MessageBreak
        is not valid. Sensible values are between 1 and 1023 (inclusive).\MessageBreak
        For further information see the pdfcprot manual.%
        }%
      }%
    }%
  }
\define@key{CPROTnum}{textcomp}[true]{%
  \setkeys{CPROT}{textcomp=#1}%
}
%    \end{macrocode}
% \begin{option}{activate}
% \changes{1.3}{2001/11/01}{option \texttt{texttype} added}
% \changes{1.5}{2002/02/27}{option \texttt{texttype} removed; didn't
% work and is IMHO not needed -- use the numerical interface if
% you don't want to activate char protruding for TS1 characters (and
% load the package \texttt{textcomp})}
% \changes{1.6}{2002/08/14}{removed last references to old option
% \texttt{texttype} in the documentation}
%    \begin{macrocode}
\define@key{CPROTpackage}{activate}[normal]{%
  \ifthenelse{\equal{#1}{normal}}{%
    \CPROT@setupcharprotruding@normal%
    \ifthenelse{\equal{\CPROT@setprotcodes@}{}}{%
    }{% just activate char prot when something was set
      \activatecharprotruding[true]%
    }%
  }{%
    \ifthenelse{\equal{#1}{none}}{%
    }{%
      \CPROT@packageerror{%
        Value of activate can be 'normal' or 'none'.\MessageBreak%
        \space For more low level setup use \string\setupcharprotruding\MessageBreak%
        and see the manual%
        }%
      }%
    }%
  }%
%    \end{macrocode}
% \end{option}
%    \begin{macrocode}
\define@key{CPROTpackage}{quiet}[true]{%
  \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{yes}\or\equal{#1}{1}}{%
    \setboolean{CPROT@quiet}{true}%
    }{%
    \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{no}\or\equal{#1}{0}}{%
      \setboolean{CPROT@quiet}{false}%
      }{%
      \CPROT@packageerror{%
        Value of quiet should be 'true' ('on', 'yes, '1') or\MessageBreak%
        'false' ('off', 'no', '0'). You didn't seem to use any\MessageBreak%
        of them.%
        }%
      }%
    }%
  }%
%    \end{macrocode}
% These are internal fuctions to evaluate the counters used to
% indicate which font variation are to get protruding.
% \changes{1.7}{2004/06/28}{added encoding}
%    \begin{macrocode}
\newcommand{\CPROT@aac@encoding}{%
  \ifthenelse{\equal{\CPROT@lowlevel@encoding}{}}{%
      \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
      \CPROT@aac@family{}%
    }{%
      \@for \CPROT@aac@encoding@first:=\CPROT@lowlevel@encoding \do {%
        \setcounter{CPROT@family@temp}{\value{CPROT@family}}%
        \expandafter\ifx\csname T@\CPROT@aac@encoding@first\endcsname\relax%
          \ifthenelse{\boolean{CPROT@quiet}}{%
            \CPROT@packagewarning{Encoding \CPROT@aac@encoding@first not defined\MessageBreak 
              (see log file for more information)}
          }{}%
          \CPROT@packageinfo@or@warning{%
            You've requested char protruding for \CPROT@aac@encoding@first encoding\MessageBreak
            but \CPROT@aac@encoding@first encoding doesn't seem to be loaded.\MessageBreak
            Maybe you forgot a '\string\usepackage[\CPROT@aac@encoding@first]{fontenc}'.%
          }%
        \else
          \CPROT@aac@family{\protect\fontencoding{\CPROT@aac@encoding@first}\selectfont}%
        \fi
      }%
    }%
  }
% \changes{1.5}{2002/02/27}{added a some more protection for each font
% selection command (new \KOMAScript{} adds something to
% some of the font size selection commands)}
% \changes{1.7}{2004/06/28}{added parameter for using with encodings}
%    \begin{macrocode}
\newcommand{\CPROT@aac@family}[1]{%
  \ifthenelse{\value{CPROT@family@temp}>1}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\rmfamily}%
    \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
    \CPROT@aac@series{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@family@temp}{-2}%
    \CPROT@aac@family{#1}%
    }{%
    \ifthenelse{\value{CPROT@family@temp}>0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\sffamily}%
      \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
      \CPROT@aac@series{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@family@temp}{-1}%
      \CPROT@aac@family{#1}%
    }{%
      \ifthenelse{\value{CPROT@family@temp}<0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\fontfamily{\CPROT@lowlevel@family}\selectfont}%
      \setcounter{CPROT@series@temp}{\value{CPROT@series}}%
      \CPROT@aac@series{\CPROT@setprotcodes@temp}%
    }{}%
      }%
    }%
  }
\newcommand{\CPROT@aac@series}[1]{%
  \ifthenelse{\value{CPROT@series@temp}>1}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\mdseries}%
    \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
    \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@series@temp}{-2}%
    \CPROT@aac@series{#1}%
    }{%
    \ifthenelse{\value{CPROT@series@temp}>0}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\bfseries}%
      \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
      \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@series@temp}{-1}%
      \CPROT@aac@series{#1}%
      }{%
      \ifthenelse{\value{CPROT@series@temp}<0}{%
        \protected@edef\CPROT@setprotcodes@temp{%
          #1\fontseries\expandafter{\CPROT@lowlevel@series}\selectfont}%
        \setcounter{CPROT@shape@temp}{\value{CPROT@shape}}%
        \CPROT@aac@shape{\CPROT@setprotcodes@temp}%
        }{}%
      }%
    }%
  }
\newcommand{\CPROT@aac@shape}[1]{%
  \ifthenelse{\value{CPROT@shape@temp}>7}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\upshape}%
    \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
    \CPROT@aac@size{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@shape@temp}{-8}%
    \CPROT@aac@shape{#1}%
    }{%
    \ifthenelse{\value{CPROT@shape@temp}>3}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\itshape}%
      \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
      \CPROT@aac@size{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@shape@temp}{-4}%
      \CPROT@aac@shape{#1}%
      }{%
      \ifthenelse{\value{CPROT@shape@temp}>1}{%
        \protected@edef\CPROT@setprotcodes@temp{#1\protect\slshape}%
        \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
        \CPROT@aac@size{\CPROT@setprotcodes@temp}%
        \addtocounter{CPROT@shape@temp}{-2}%
        \CPROT@aac@shape{#1}%
        }{%
        \ifthenelse{\value{CPROT@shape@temp}>0}{%
          \protected@edef\CPROT@setprotcodes@temp{#1\protect\scshape}%
          \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
          \CPROT@aac@size{\CPROT@setprotcodes@temp}%
          \addtocounter{CPROT@shape@temp}{-1}%
          \CPROT@aac@shape{#1}%
          }{%
          \ifthenelse{\value{CPROT@shape@temp}<0}{%
            \protected@edef\CPROT@setprotcodes@temp{%
              #1\fontshape\expandafter{\CPROT@lowlevel@shape}\selectfont}%
            \setcounter{CPROT@size@temp}{\value{CPROT@size}}%
            \CPROT@aac@size{\CPROT@setprotcodes@temp}%
            }{}%
          }%
        }%
      }%
    }%
  }
\newcommand{\CPROT@aac@size}[1]{%
  \ifthenelse{\value{CPROT@size@temp}>511}{%
    \protected@edef\CPROT@setprotcodes@temp{#1\protect\Huge}%
    \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
    \addtocounter{CPROT@size@temp}{-512}%
    \CPROT@aac@size{#1}%
    }{%
    \ifthenelse{\value{CPROT@size@temp}>255}{%
      \protected@edef\CPROT@setprotcodes@temp{#1\protect\huge}%
      \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
      \addtocounter{CPROT@size@temp}{-256}%
      \CPROT@aac@size{#1}%
      }{%
      \ifthenelse{\value{CPROT@size@temp}>127}{%
        \protected@edef\CPROT@setprotcodes@temp{#1\protect\LARGE}%
        \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
        \addtocounter{CPROT@size@temp}{-128}%
        \CPROT@aac@size{#1}%
        }{%
        \ifthenelse{\value{CPROT@size@temp}>63}{%
          \protected@edef\CPROT@setprotcodes@temp{#1\protect\Large}%
          \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
          \addtocounter{CPROT@size@temp}{-64}%
          \CPROT@aac@size{#1}%
          }{%
          \ifthenelse{\value{CPROT@size@temp}>31}{%
            \protected@edef\CPROT@setprotcodes@temp{#1\protect\large}%
            \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
            \addtocounter{CPROT@size@temp}{-32}%
            \CPROT@aac@size{#1}%
            }{%
            \ifthenelse{\value{CPROT@size@temp}>15}{%
              \protected@edef\CPROT@setprotcodes@temp{#1\protect\normalsize}%
              \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
              \addtocounter{CPROT@size@temp}{-16}%
              \CPROT@aac@size{#1}%
              }{%
              \ifthenelse{\value{CPROT@size@temp}>7}{%
                \protected@edef\CPROT@setprotcodes@temp{#1\protect\small}%
                \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                \addtocounter{CPROT@size@temp}{-8}%
                \CPROT@aac@size{#1}%
                }{%
                \ifthenelse{\value{CPROT@size@temp}>3}{%
                  \protected@edef\CPROT@setprotcodes@temp{#1\protect\footnotesize}%
                  \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                  \addtocounter{CPROT@size@temp}{-4}%
                  \CPROT@aac@size{#1}%
                  }{%
                  \ifthenelse{\value{CPROT@size@temp}>1}{%
                    \protected@edef\CPROT@setprotcodes@temp{#1\protect\scriptsize}%
                    \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                    \addtocounter{CPROT@size@temp}{-2}%
                    \CPROT@aac@size{#1}%
                    }{%
                    \ifthenelse{\value{CPROT@size@temp}>0}{%
                      \protected@edef\CPROT@setprotcodes@temp{#1\protect\protect\tiny}%
                      \CPROT@aac@textcomp{\CPROT@setprotcodes@temp}%
                      }{}%
                    }%
                  }%
                }%
              }%
            }%
          }%
        }%
      }%
    }%
  }
\newcommand{\CPROT@aac@textcomp}[1]{%
  \ifthenelse{\boolean{CPROT@textcomp}}{%
    \@ifundefined{T@TS1}{%
      \CPROT@packageinfo@or@warning{%
        You've requested char protruding for TS1 encoding\MessageBreak
        but TS1 encoding doesn't seem to be loaded.\MessageBreak
        Maybe you forgot a '\string\usepackage{textcomp}'.%
        }%
      \setboolean{CPROT@textcomp}{false}%
      }{}%
    }{}%
  \ifthenelse{\boolean{CPROT@textcomp}}{%
    \protected@xdef\CPROT@setprotcodes@{%
      \CPROT@setprotcodes@{%
        #1\protect\CPROT@setprotcodes@font{%
          \fontencoding{TS1}\selectfont\protect\CPROT@setprotcodes@font%
          }%
        }%
      }%
    }{%
    \protected@xdef\CPROT@setprotcodes@{%
      \CPROT@setprotcodes@{%
        #1\protect\CPROT@setprotcodes@font%
        }%
      }%
    }%
  }
%    \end{macrocode}
% \changes{1.6}{2002/08/14}{\texttt{pdfcprot} will not activate the
% character protruding only iff a \texttt{pdftex} version larger 0.14f
% is detected; \emph{nobody} should use older versions for documents
% using character protruding, even 0.14f is
% \emph{really} old right now}
% \begin{macro}{\activatecharprotruding}
%    \begin{macrocode}
\newcommand*{\activatecharprotruding}[1][true]{%
  \ifpdftex{%
    \ifthenelse{\equal{#1}{true}\or\equal{#1}{on}\or\equal{#1}{1}\or\equal{#1}{yes}}{%
      \CPROT@good@pdftex@version{%
        \global\pdfprotrudechars=2%
       } 
      }{%
      \ifthenelse{\equal{#1}{compatibility}\or\equal{#1}{compatible}}{%
        \CPROT@good@pdftex@version{%
          \global\pdfprotrudechars=1%
          }%
        }{%
        \ifthenelse{\equal{#1}{false}\or\equal{#1}{off}\or\equal{#1}{0}\or\equal{#1}{no}}{%
          \global\pdfprotrudechars=0%
          }{%
          \CPROT@packageerror{%
            ``#1'' is no setting for \activatecharprotruding. Use\MessageBreak
            one of 'true', 'on', 'yes', '1', or 'false', 'off', \MessageBreak
            'no', '0', or 'compatible', 'compatibility' instead.%
            }%
          }{%
          \CPROT@packageinfo@or@warning{%
            You want to activate char protruding, but it does\MessageBreak
            look as your are NOT using pdftex. So I can't\MessageBreak
            activate it, as ``pdfcprot.sty'' only supports\MessageBreak
            pdftex.}%
          }%
        }%
      }%
    }{}%
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setupcharprotruding}
%    \begin{macrocode}
\newcommand*{\setupcharprotruding}[1]{%
  \ifpdftex{%
    \CPROT@resetall{}%
    \@ifundefined{CPROT@save@KV@errx}{%
      \let\CPROT@save@KV@errx=\KV@errx%
      \renewcommand*{\KV@errx}[1]{%
        \CPROT@packageerror{option ##1 for \string\setupcharprotruding}{%
          You've tried to use the option ##1 with \string\setupcharprotruding.\MessageBreak
          But there is no option with that name.\MessageBreak
          See the manual of ``pdfcprot.sty'' for information 
          about the usage of \string\setupcharprotruding.%
          }%
        }%
      \setkeys{CPROT}{#1}%
      \let\KV@errx=\CPROT@save@KV@errx%
      \let\CPROT@save@KV@errx=\relax%
      }{%
      \setkeys{CPROT}{#1}%
      }%
    \CPROT@setprotcodes@add{}%
    }{%
    \CPROT@packageinfo@or@warning{%
      You want to setup char protruding, but it does\MessageBreak
      look as if you're NOT using pdftex. So I can't\MessageBreak
      setup it, as ``pdfcprot.sty'' only supports\MessageBreak
      pdftex.}%
    }%
  }
\@onlypreamble\setupcharprotruding%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setupcharprotrudingnumeral}
%    \begin{macrocode}
\newcommand*{\setupcharprotrudingnumeral}[1]{%
  \ifpdftex{%
    \CPROT@resetall{}%
    \@ifundefined{CPROT@save@KV@errx}{%
      \let\CPROT@save@KV@errx=\KV@errx%
      \renewcommand*{\KV@errx}[1]{%
        \CPROT@packageerror{option ##1 for \string\setupcharprotrudingnumeral}{%
          You've tried to use the option ##1 with \string\setupcharprotrudingnumeral.\MessageBreak
          But there is no option with that name.\MessageBreak
          See the manual of ``pdfcprot.sty'' for information 
          about the usage of \string\setupcharprotrudingnumeral.%
          }%
        }%
      \setkeys{CPROTnum}{#1}%
      \let\KV@errx=\CPROT@save@KV@errx%
      \let\CPROT@save@KV@errx=\relax%
      }{%
      \setkeys{CPROTnum}{#1}%
      }%
    \CPROT@setprotcodes@add{}%
    }{%
    \CPROT@packageinfo@or@warning{%
      You want to setup char protruding, but it does\MessageBreak
      look as if you're NOT using pdftex. So I can't\MessageBreak
      setup it, as ``pdfcprot.sty'' only supports\MessageBreak
      pdftex.}%
    }%
  }
\@onlypreamble\setupcharprotrudingnumeral
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpdftex}
% \changes{1.7}{2004/08/13}{changed to new definition proposed by
% Heiko Oberdiek} 
%    \begin{macrocode}
\newcommand{\ifpdftex}{%
  \ifx\pdftexversion\@undefined
    \expandafter\@secondoftwo
  \else
    \ifx\pdftexversion\relax
      \expandafter\expandafter\expandafter\@secondoftwo
    \else
      \expandafter\expandafter\expandafter\@firstoftwo
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\CPROT@good@pdftex@version}
% \changes{1.6}{2002/08/14}{added a macro to do something iff a
% ``good'' version of \texttt{pdftex} is used}
%    \begin{macrocode}
\newcommand{\CPROT@packageerror@bad@pdftex}{%
  \CPROT@packageerror{You used a pdftex version older than 0.14f.\MessageBreak
    pdfcprot does not support such old versions of pdftex. \MessageBreak
    Please install a new version of pdftex.}%
}
\newcommand{\CPROT@good@pdftex@version}[1]{%
  \ifnum\pdftexversion < 14
    \CPROT@packageerror@bad@pdftex %
  \else
    \ifnum\pdftexversion = 14
      \ifnum \expandafter`\pdftexrevision < `f
        \CPROT@packageerror@bad@pdftex %
      \else
        #1
      \fi
    \else
      #1
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpdfoutput}
% \changes{1.4a}{2001/11/13}{changed to new definition in
% \KOMAScript{} version 2.8q (2001/11/13)}
% This was taken from KOMA-Script and is provided for convenience.
% \changes{1.7}{2004/08/13}{changed to new definition proposed by
% Heiko Oberdiek} 
%    \begin{macrocode}
\newcommand*{\CPROT@ifpdfoutput}{%
  \ifcase 0%
          \ifx\pdfoutput\@undefined 1%
          \else
            \ifx\pdfoutput\relax    1%
            \else
              \ifcase\pdfoutput     1%
              \fi
            \fi
          \fi
          \space
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\@ifundefined{ifpdfoutput}{\let\ifpdfoutput\CPROT@ifpdfoutput}{%
  \CPROT@packageinfo{%
    \string\ifpdfoutput\space already defined.\MessageBreak
    That may happen when using KOMA-Script together\MessageBreak
    with ``pdfcprot.sty''. I have changed the definition\MessageBreak
    from Markus' KOMA-Script, so if you experience errors\MessageBreak
    try \string\let\string\ifpdfoutput\string\relax\space before loading ``pdfcprot.sty''.}%
  }
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\newcommand*{\CPROT@packageoptions}[1]{%
  \@ifundefined{CPROT@save@KV@errx}{%
    \let\CPROT@save@KV@errx=\KV@errx%
    \renewcommand*{\KV@errx}[1]{%
      \PackageError{pdfcprot}{unknown option ``#1''}{%
        You've tried to use the option ``#1''.\MessageBreak
        But there is no option with that name.\MessageBreak
        See the manual of ``pdfcprot.sty'' for information 
        about known options.%
        }%
      }%
    \setkeys{CPROTpackage}{#1}%
    \let\KV@errx=\CPROT@save@KV@errx%
    \let\CPROT@save@KV@errx=\relax%
    }{%
    \setkeys{CPROTpackage}{#1}%
    }%
  }
%    \end{macrocode}
%    \begin{macrocode}
\DeclareOption{DVIoutput}{%
  \CPROT@packagewarning{%
    It is not a good idea to use the DVIoutput package 
    option.\MessageBreak
    Use it only if you experience some using other
    packages.\MessageBreak
    And don't forget to file a bug report against these
    packages.\MessageBreak
    The best is to add just \string\pdfoutput=0\space at the beginning\MessageBreak
    of your preamble or even before \string\documentclass.
  }
  \ifpdftex{%
    \pdfoutput=0%
    \let\pdfoutput\undefined
    }{}%
  }
%    \end{macrocode}
% Define a standard command for undefined options. Actually this is
% just a redirection to a |\setkeys| command.
% \changes{1.5}{2002/02/27}{Just execute the options if \texttt{pdftex} is
% really used}
%    \begin{macrocode}
\DeclareOption*{%
  \ifpdftex{%
    \expandafter\CPROT@packageoptions\expandafter{\CurrentOption}%
    }{}%
  }%
%    \end{macrocode}
% \begin{macro}{\CPROI@fallbackfont}
% \begin{macro}{\setfallbackfont}
% \changes{1.5}{2001/11/16}{changed place of definition; now the
% ``configuration'' commands are all together}
% The internal command |\CPROT@fallbackfont| stores the font to be
% looked for, if no |CPA| is found for the actual font. By default
% it's Palatino. With |\setfallbackfont| it is possible to customise
% this, if required.
%    \begin{macrocode}
\newcommand*{\CPROT@fallbackfont}{pplmn}
\newcommand*{\setfallbackfont}[1]{\renewcommand*{\CPROT@fallbackfont}{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\CPROT@setupcharprotruding@normal}
% \changes{1.5}{2001/11/16}{changed place of definition; now the
% ``configuration'' commands are all together}
% When the package is loaded with option |activate| or
% |activate=normal| this command does the actual adjustment and by
% that defines which fonts will get character protruding with that options.
%    \begin{macrocode}
\newcommand*{\CPROT@setupcharprotruding@normal}{%
  \setupcharprotrudingnumeral{family=3,series=1,shape=8,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{family=2,series=2,shape=12,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{family=1,series=2,shape=14,size=60,textcomp=1}%
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setupcharprotrudingforencoding}
% \changes{1.7}{2004/06/28}{added}
% This command 
%    \begin{macrocode}
\newcommand*{\setupcharprotrudingforencoding}[1]{%
  \setupcharprotrudingnumeral{encoding={#1},family=3,series=1,shape=8,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{encoding={#1},family=2,series=2,shape=12,size=60,textcomp=1}%
  \setupcharprotrudingnumeral{encoding={#1},family=1,series=2,shape=14,size=60,textcomp=1}%
  }
\@onlypreamble\setupcharprotrudingforencoding
%    \end{macrocode}
% \end{macro}
% \begin{option}{pdfcprot.cfg}
% \changes{1.4}{2001/11/07}{added loading of pdfcprot.cfg.}
%    \begin{macrocode}
\InputIfFileExists{pdfcprot.cfg}
           {\typeout{***************************************^^J%
                     * Local config file pdfcrpot.cfg used *^^J%
                     ***************************************}}
           {}
%    \end{macrocode}
% \end{option}
%    \begin{macrocode}
\ProcessOptions\relax
\newcommand*{\CPROT@actualfont}{%
  \f@family%
  \f@series%
  \f@shape%
  \f@encoding%
  }
\@onlypreamble\setfallbackfont%
\newcommand*{\CPROT@cpa@toload}{}
%    \end{macrocode}
% \begin{macro}{\CPROT@setprotcodes@font}
% This command you've seen before in the definition of
% |\CPROT@setprotcodes@|. There it was protected so it won't be expanded
% to early. That was important, to test for the correct font.
%    \begin{macrocode}
\newcommand*{\CPROT@setprotcodes@font}{%
  \renewcommand*{\CPROT@cpa@toload}{\CPROT@actualfont.cpa}%
  \IfFileExists{\CPROT@cpa@toload}{%
%    \end{macrocode}
% \changes{1.1}{2001/10/30}{Former version used a general command
% beeing redefined any time directly from the \texttt{CPA}. Now the \texttt{CPA}
% defines a new command we can test for, so it will be loaded just
% once.}
% Former version used a general command
% beeing redefined any time directly from the |CPA|. Now the |CPA|
% defines a new command we can test for, so it will be loaded just
% once. The same code is found in the part for the fallback
% font. Using this code some time will be spared (I hope).
%    \begin{macrocode}
    \expandafter\@ifundefined\expandafter{\CPROT@actualfont}{%
      \input{\CPROT@cpa@toload}
      }{}
%    \end{macrocode}
% As the fontencoding names contain numbers |\csname| and |\endcsname|
% must be used to call the actual command to setup character
% protruding. After that a adjustment may be needed.
%    \begin{macrocode}
    \csname\CPROT@actualfont\endcsname%
    \CPROT@adjustprotcodes{\font}%
    \CPROT@packageinfo{%
      File \CPROT@cpa@toload{} for the adjustment of\MessageBreak
      the char protruding used. It seems to be _fit_\MessageBreak
      to the font you requested.%
      }%
    }{%
    \CPROT@packageinfo@or@warning{%
      I didn't find \CPROT@cpa@toload.\MessageBreak%
      \space As a fallback I will try \CPROT@fallbackfont\f@encoding.cpa.%
      }%
    \renewcommand*{\CPROT@cpa@toload}{\CPROT@fallbackfont\f@encoding.cpa}%
    \IfFileExists{\CPROT@cpa@toload}{%
      \expandafter\@ifundefined\expandafter{\CPROT@fallbackfont\f@encoding}{%
        \input{\CPROT@cpa@toload}%
        }{}%
      \csname\CPROT@fallbackfont\f@encoding\endcsname%
      \CPROT@adjustprotcodes{\font}%
      \CPROT@packageinfo{%
        File \CPROT@cpa@toload{} used for the adjustment\MessageBreak
        of the char protruding. It seems that it isn't the one\MessageBreak
        you intended to use.%
        }%
      }{%
      \CPROT@packageinfo@or@warning{%
        Even the fallback font was not found. Maybe it's\MessageBreak
        not the right font encoding. Currently ``pdfcprot''\MessageBreak
        bundles only with cpa's for T1, OT1 and TS1 encoding.%
        }%
      }%
    }%
  }
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\newif\ifCPROT@adjustprotcodes@
\newcommand*{\CPROT@adjustprotcodes}[1]{%
  \CPROT@adjustprotcodes@false
  \ifnum\pdftexversion > 14
    \CPROT@adjustprotcodes@true 
  \else
    \ifnum\pdftexversion = 14
      \ifnum \expandafter`\pdftexrevision > `g
        \CPROT@adjustprotcodes@true
      \fi
    \fi
  \fi
  \ifCPROT@adjustprotcodes@
    \@tempcnta=0
    \loop
      \ifcase\lpcode#1\@tempcnta\else
        \CPROT@adjustprotcodes@@\lpcode{#1}\@tempcnta 
      \fi
      \ifcase\rpcode#1\@tempcnta\else  
        \CPROT@adjustprotcodes@@\rpcode{#1}\@tempcnta 
      \fi
      \advance\@tempcnta 1
    \ifnum\@tempcnta < 256 \repeat
   \fi
  }
\def\CPROT@adjustprotcodes@@#1#2#3{%
  \setbox0=\hbox{\the#2\char#3}%
%  \setbox0=\hbox{%
%    \ifx#2\font\else#2\fi%
%    \char#3}%
  \@tempcntb=\wd0%
  \multiply\@tempcntb #1#2#3%
  \divide\@tempcntb \fontdimen6 #2%
  #1#2#3=\@tempcntb%
  }

\newcommand*{\CPROT@setprotcodes}{%
  \ifpdftex{%
    \ifthenelse{\equal{\CPROT@setprotcodes@}{}}{%
      }{%
      \CPROT@setprotcodes@%
      }%
    }{}%
  }

\AtBeginDocument{%
  \CPROT@setprotcodes\relax%
  }
%</package>
%    \end{macrocode}
% \subsection{The Provided \texttt{.CPA} Files}
% \subsubsection{Palatino}
% \begin{macro}{\pplmnT1}
%   \begin{macro}{\pplmnOT1}
% \changes{1.1}{2001/30/10}{\texttt{\protect\string\string\pplmnT1} was added. Before a general
% setup code has been used and defined anytime new loading the
% \texttt{CPA}. In the \texttt{CPA}'s were only the
% \texttt{\protect\string\string\rpcode} and
% \texttt{\protect\string\string\lpcode} commands stated.}
% \changes{1.7}{2004/06/28}{Collapsed all encodings for \texttt{ppl}}
% \changes{1.7}{2004/06/28}{added \texttt{pplmnT2A} and
% \texttt{pplmnOT2} definition files
% for T2A and OT2 encoding}
%    \begin{macrocode}
%<pplmnT1>\expandafter\gdef\csname pplmnT1\endcsname{%
%<pplmnOT1>\expandafter\gdef\csname pplmnOT1\endcsname{%
%<pplmnT2A>\expandafter\gdef\csname pplmnT2A\endcsname{%
%<pplmnOT2>\expandafter\gdef\csname pplmnOT2\endcsname{%
%<*pplmnOT1|pplmnOT2>
  \lpcode\font 92=500  % ``
  \rpcode\font 34=500  % ''
  \rpcode\font 123=300 % --
  \rpcode\font 124=200 % ---
%</pplmnOT1|pplmnOT2>
%<*pplmnT1|pplmnT2A>
  \lpcode\font 16=500  % ``
  \rpcode\font 17=500  % ''
  \rpcode\font 21=300 % --
  \rpcode\font 22=200 % ---
%</pplmnT1|pplmnT2A>
%<*pplmnT2A|pplmnOT2>
  \rpcode\font\cyrdash=200 % "---
  \lpcode\font\cyrdash=200 % "--*
%</pplmnT2A|pplmnOT2>
%<*pplmnT1|pplmnT2A>
% german quotation marks
  \lpcode\font\quotedblbase=600
  \rpcode\font\textquotedblleft=500
%</pplmnT1|pplmnT2A>
%<*pplmnOT1|pplmnT1|pplmnT2A|pplmnOT2>
  % set the protrusion of ",","-" and "." a bit smaller
  % than originally suggested by Han The Than
  \rpcode\font`\,=650 
  \rpcode\font`\-=650 
  \rpcode\font`\.=650 
  % originial Setting from Han The Thans protcode.tex
  \rpcode\font`\!=200
  \rpcode\font`\;=500
  \rpcode\font`\:=500
  \rpcode\font`\?=200
  \lpcode\font`\`=700
  \rpcode\font`\'=700
  \rpcode\font`\)=50
%<*!pplmnOT2>
  \rpcode\font`\A=\rpcode\font`\A
%<pplmnT1>  \rpcode\font 196=50 % A umlaut
  \rpcode\font`\F=50
  \rpcode\font`\K=50
  \rpcode\font`\L=50
  \rpcode\font`\T=50
  \rpcode\font`\V=50
  \rpcode\font`\W=50
  \rpcode\font`\X=50
  \rpcode\font`\Y=50
  \rpcode\font`\k=50
  \rpcode\font`\r=50
  \rpcode\font`\t=50
  \rpcode\font`\v=50
  \rpcode\font`\w=50
  \rpcode\font`\x=50
  \rpcode\font`\y=50
%</!pplmnOT2>
  \lpcode\font`\(=50
%<*!pplmnOT2>
  \lpcode\font`\A=50
%<pplmnT1>  \lpcode\font 196=\lpcode\font`\A % A umlaut
  \lpcode\font`\J=50
  \lpcode\font`\T=50
  \lpcode\font`\V=50
  \lpcode\font`\W=50
  \lpcode\font`\X=50
  \lpcode\font`\Y=50
  \lpcode\font`\v=50
  \lpcode\font`\w=50
  \lpcode\font`\x=50
  \lpcode\font`\y=50
%</!pplmnOT2>
%<*pplmnT2A|pplmnOT2>
  \rpcode\font\CYRA=50
  \rpcode\font\CYRK=50
  \rpcode\font\CYRT=50
  \rpcode\font\CYRH=50
  \rpcode\font\CYRU=50
  \rpcode\font\CYRG=50
  \rpcode\font\CYRZH=50
  \rpcode\font\CYRL=50
  \rpcode\font\CYRC=20
  \rpcode\font\CYRSHCH=10
  \rpcode\font\CYRHRDSN=50
  \rpcode\font\CYRSFTSN=50
  \rpcode\font\cyrk=50
  \rpcode\font\cyrt=50
  \rpcode\font\cyrh=50
  \rpcode\font\cyru=50
  \rpcode\font\cyrg=50
  \rpcode\font\cyrzh=50
  \rpcode\font\cyrl=50
  \rpcode\font\cyrc=20
  \rpcode\font\cyrshch=10
  \rpcode\font\cyrhrdsn=50
  \rpcode\font\cyrsftsn=50
  \lpcode\font\CYRA=50
  \lpcode\font\CYRT=50
  \lpcode\font\CYRH=50
  \lpcode\font\CYRU=50
  \lpcode\font\CYRZH=50
  \lpcode\font\CYRL=50
  \lpcode\font\CYRU=50
  \lpcode\font\CYRCH=50
  \lpcode\font\CYRHRDSN=50
  \lpcode\font\CYRD=50
  \lpcode\font\cyra=50  
  \lpcode\font\cyrt=50
  \lpcode\font\cyrh=50
  \lpcode\font\cyru=50
  \lpcode\font\cyrzh=50
  \lpcode\font\cyrl=50
  \lpcode\font\cyru=50
  \lpcode\font\cyrch=50
  \lpcode\font\cyrhrdsn=50
  \lpcode\font\cyrd=50
%</pplmnT2A|pplmnOT2>
}%
%</pplmnOT1|pplmnT1|pplmnT2A|pplmnOT2>
%    \end{macrocode}
%   \end{macro}
% \end{macro}
% \begin{macro}{\pplmnTS1}
%    \begin{macrocode}
%<*pplmnTS1>
\expandafter\gdef\csname pplmnTS1\endcsname{%
  \rpcode\font 176=600 % \textdegree
}
%</pplmnTS1>
%    \end{macrocode}
% \end{macro}
% \makeatletter \c@IndexColumns=2\makeatother
% \PrintIndex
% \PrintChanges
% \Finale
\endinput
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: % LocalWords:  pdftex kerning Carsten