summaryrefslogtreecommitdiff
path: root/language/romanian/RomanianTeX/romanian.dtx
blob: 4f70627356f90c8b214706bf9f66f9e59dae59ec (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
% \iffalse meta-comment %% ROMANIAN.DTX 1.3R <29.10.1996> %%
%<*!driver>
%    \begin{macrocode}
 %%
 %% This file is part of the Romanian TeX system.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Romanian TeX, version 1.3R <29.10.1996>               %%
 %% (C) 1994-1996 Adrian Rezus [adriaan@{sci,cs}.kun.nl]  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\RomanianTeX{Romanian\TeX\/}%                         %%
\def\RomanianTeXname{Romanian TeX}%                       %%
\def\RomanianTeXid{1.3R}%                                 %%
\def\RomanianTeXversion{1996/10/29 v1.3R}%                %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Revision 1.3R [1996/]:[11/03]..[11/07][11/09]..[11/12]%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    \end{macrocode}
% ---------------- start of docstrip archive file --------------------
%
% \fi
% \CheckSum{2271}
%
% \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         \~}
%
% \DoNotIndex{\',\(,\),\-,\.,\/,\{,\},\^,\`,\|,\ ,\@,\x,\Z}
% \DoNotIndex{\@M,\@m,\m@ne,\z@,\z@skip,\@ne,\tw@,sixt@@n}
% \DoNotIndex{\count@,\dimen@,\advance,\day,\month,year,\relax}
% \DoNotIndex{\begin,\end,\bgroup,\egroup,\begingroup,\endgroup}
% \DoNotIndex{\bf,\em,\it,\rm,\tt,\textbf,\textit,\texttt,\emph}
% \DoNotIndex{\expandafter,\noexpand,\string,\the,\ifhmode,\ifmmode}
% \DoNotIndex{\ifcase,\or,\else,\fi,\if,\ifdim,\ifnum,\ifx}
% \DoNotIndex{\do,\afterassignment,\number,\escapechar,\space}
% \DoNotIndex{\def,\edef,\let,\newcommand,\undefined,\active}
% \DoNotIndex{\accent,\box,\dp,\ht,\wd,\char,\chardef,\discretionary}
% \DoNotIndex{\catcode,\csname,\endcsname,\hbox,\hskip,\kern}
% \DoNotIndex{\font,\fontdimen,\scriptscriptstyle,\textstyle}
% \DoNotIndex{\lccode,\lowercase,\sfcode,\spacefactor,\penalty}
% \DoNotIndex{\mathchar,\mathchardef,\mathaccent,\varepsilon,\m@th}
% \DoNotIndex{\empty,\@empty,\leavevmode,\makeatletter,\mbox}
% \DoNotIndex{\errhelp,\errmessage,\message,\wlog,\write,\immediate}
% \DoNotIndex{\lower,\raise,\sfcode,\spacefactor,\setbox,\toks}
% \DoNotIndex{\documentclass,\documentstyle,\LaTeX,\LaTeXe,\TeX}
% \DoNotIndex{\ProvidesPackage,\usepackage,\CodelineIndex,\cs}
% \DoNotIndex{\input,\endinput,\DocInput}
%
% \originalTeX
% \title{Romanian \TeX{} 1.3R\thanks{%
%    This file is accompanied by
%	a \LaTeXe{} \emph{installation module}
%		(file \texttt{romanian.ins}),
%	the Romanian \emph{hyphenation patterns}
%		(file \texttt{rohyphen.tex}),
%		version 1.1 of October 29, 1996, and
%	the \emph{end-user documentation}
%		(file \texttt{romanian.doc}).
%    [A table of contents for the current release of \RomanianTeX{}
%    can be found in the file \texttt{manifest[.romanian].txt}.]
%    Like its predecessors (essentially:
%	\texttt{romanian.tex}, version 1.2 of December 21, 1994 and
%	\texttt{romanian.sty}, version 1.2R of June 7, 1995),
%    the present design of \RomanianTeX{} is based on the
%    German \TeX{} style implementation [see
%	\texttt{german.dtx}, version 2.5c of May 1st, 1996,
%	   \copyright{}~1995--1996 Bernd Raichle and DANTE e.V.,
%	\texttt{german.sty}
%	   \copyright{}~1991--1996 Bernd Raichle and DANTE e.V., and
%	\texttt{german.tex}
%	   \copyright{}~1987--1990 Hubert Partl].
%    \RomanianTeX{} 1.3R is a \emph{multi-lingual} \TeX{} system.
%    In particular, if set in German \TeX{}-mode, \RomanianTeX{}
%    emulates entirely the German \TeX{} (current version), and,
%    unlike in previous versions, a bi-lingual -- German/Romanian --
%    \RomanianTeX{} configuration does not require \texttt{german.sty}
%    any more. As expected, like the German \TeX{}, \RomanianTeX{} 
%    is \emph{not} compatible with the \textsc{babel}\, system
%    [\copyright{}~1989--1995 Johannes~L. Braams], and -- on
%    specific installations using short file-name conventions -- 
%    one should take similar precautions as regards possible 
%    file-name conflicts.}}
% \date{October 29, 1996}
% \author{Adrian Rezu\c{s}\thanks{%
%    E-mail: \texttt{adriaan@cs.kun.nl}}}
% \maketitle
%
% \StopEventually{}
%
% \begin{abstract}
% This document describes the \RomanianTeX{} package, version 
% 1.3R. \RomanianTeX{} is a \emph{multi-lingual} environment 
% for type-setting Romanian texts with Plain \TeX, \LaTeX{}~2.09 
% and/or \LaTeXe{}. Its implementation strategy is similar to
% the design of the German \TeX{} [v2.5c |<1.05.1996>| and older]: 
% \RomanianTeX{} allows the input of the Romanian diacritics and
% quotes by analogous double quote macros. As a multi-lingual
% \TeX{} system, if set in `originalTeX', `germanTeX' or `frenchTeX'
% mode, \RomanianTeX{} emulates the original (US/UK) English, 
% German or French \TeX{}, resp.\ (In particular, a bi-lingual 
% -- German/Romanian -- \TeX{} configuration does \emph{not} 
% require \texttt{german.sty} any more.) 
% \end{abstract}
% \vfill\eject
%
% \tableofcontents
% \vfill\eject
%
% \ifx\emergencystretch\undefined \else
%    \setlength{\emergencystretch}{2em}
% \fi
% \hbadness=2000
%
% \section{Package identification}
%
% In order to function properly, the macro-code of \RomanianTeX{}
% must be loaded only \emph{once} in a \TeX{} system. 
%
% \subsection{The file banner}
%
% The file banner declares, at the very beginning, several 
% \emph{global} identifiers for the \RomanianTeX{} package. 
% The print-names 
%
% |\RomanianTeX|,                   % TeX print-name
%
% |\RomanianTeXname|,               % ASCII print-name
%
% |\RomanianTeXid|,                 % ASCII: |<version>|
%
% |\RomanianTeXversion|             % ASCII: |<date>| + |<version>|
% \par\noindent
% are exported in every file using \texttt{romanian.sty} and can be 
% changed globally. 
%
% \subsection{The internal self-identifier}
%  
% Internally, any specific \RomanianTeX{} macro-construct is
% identified by a |\csname|-prefix, a |<system-self-id>|
% (current value: \texttt{ro@}). 
%
% This `non-public' feature of the package is meant to avoid 
% |\csname| name-conflicts with other \TeX{} internals and/or 
% other packages.
%
% \subsection{The self-identifty test}
%
% The self-identity test is performed upon system initialization;
% if \RomanianTeX{} is not yet loaded, the rest of the file is 
% going to be processed:
%
%    \begin{macrocode}
\expandafter\ifx\csname romanianTeX\endcsname\relax
  \else \romanianTeX \expandafter\endinput
\fi
%    \end{macrocode}
%
% \subsection{Broadcast package identity}
%
% Upon loading, \RomanianTeX{} identifies itself. Since the package 
% may function as a `style option' for Plain \TeX{}, as well as for 
% different \LaTeX{}-versions, this is done by a |\message| command.
%
%    \begin{macrocode}
\message{\RomanianTeXname, \RomanianTeXversion.}
%    \end{macrocode}
%
% \subsection{\LaTeXe{} package identification}
%
% \LaTeXe{} declares \RomanianTeX{} as a `package'. Other
% packages could possibly test the command |\ProvidesPackage| 
% only for \texttt{undefined}, so we must prevent the fact that
% |\ProvidesPackage| might have the meaning |\relax| at this 
% point (by a local test, within a group construct).
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
\ProvidesPackage{romanian}[\RomanianTeXversion Package Romanian TeX]
\fi
%    \end{macrocode}
%
% \section{Accessing \TeX{} internals}
%
% As expected, \RomanianTeX{} controls the \TeX{} internals by
% changing the \textit{category code} of the |@|-symbol to 
% the `letter'-category. On completing the required modifications 
% in the underlying \TeX{} behavior, \RomanianTeX{} reverts to
% the `public' \TeX{} control, by disallowing |@|-|<csname>|'s.
%
% While in control of the \TeX{} internals, we must be also able 
% to load \RomanianTeX{} with a simple |\input| command (in Plain
% \TeX{}, for instance). So the \textit{category code} of the
% |@|-symbol must be saved \emph{before} performing the change
% to the `letter'-category.
%
%    \begin{macrocode}
\chardef\atcode=\catcode`\@ % save_current_category_code_of |@|
\catcode`\@=11 %            % \makeatletter
%    \end{macrocode}
%
% \section{Compatibility macros}
%
% \subsection{Low-level macros}
%
% As \RomanianTeX{} macros must be possibly usable outside a
% \LaTeX{}-environment, we must re-define some \LaTeX{}-macros.
%
% \subsubsection{The test for `undefined'}
%
% We shall need later the test-command |\@ifundefined| (not in 
% Plain \TeX{}). The discriminating action of this macro is encoded 
% by using explicit \emph{selectors} (actually \emph{projections} 
% \textbf{first} and \textbf{second}, see below).
%
%    \begin{macrocode}
\expandafter\ifx\csname @ifundefined\endcsname\relax
  \def\@ifundefined#1{%
    \expandafter\ifx\csname #1\endcsname\relax
      \expandafter\ro@DQfirst\else\expandafter\ro@DQsecond\fi}
\fi
%    \end{macrocode}
%
% \subsubsection{The selectors}
%
% These selectors are made into \RomanianTeX{} specific macros, by
% using the global |<system-self-id>| (i.e., the |\ro@|-prefix):
%
%    \begin{macrocode}
\def\ro@DQfirst#1#2{#1}
\def\ro@DQsecond#1#2{#2}
%    \end{macrocode}
%
% \subsection{Compatibility macros for NFSS~2}
%
% In what follows, we assume that the NFSS~2 is present whenever 
% the command |\DeclareTextSymbol| is defined:
% 
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax \else
%    \end{macrocode}
%
% Otherwise, we must learn to live with what we have got\ldots
%
% \subsubsection{NFSS~2 macro emulations}
%
% \RomanianTeX{} would yield poor results with older versions of
% \LaTeXe{} and/or NFSS~2. The following piece of macro-code is 
% self-explanatory: if the command |\ProvideTextCommandDefault|
% is not currently available, we are in the worst possible case
% and will strongly recommend system-updating!
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname ProvideTextCommandDefault\endcsname\relax
  \immediate\write17{}
  \immediate\write17{%
!! This LaTeX2e-system requires updating.}
  \immediate\write17{!!}
  \immediate\write17{}
\fi
%    \end{macrocode}
%
% The NFSS~2 allows a font parameter |\fontencoding|.
% We also assume that the command |\providecommand| is available.
%
% We emulate next a few NFSS~2 macros for environments in need of them.
% 
% |\UseTextSymbol{|\meta{encoding}|}{|\meta{symbol}|}|
% is used for the encoding-dependent font-selection with NFSS~2:
%
%    \begin{macrocode}
\@ifundefined{UseTextSymbol}{%
  \def\UseTextSymbol#1#2{{\fontencoding{#1}\selectfont #2}}
}{}
%    \end{macrocode}
% |\UseTextAccent{|\meta{encoding}|}{|\meta{accent}|}{|\meta{base}|}|
% choses an accent symbol from a font with a given encoding, 
% resp.\ with one diverging from its actual encoding.
%
%    \begin{macrocode}
\@ifundefined{UseTextAccent}{%
  \def\UseTextAccent#1#2#3{%
    {\let\@curr@enc\f@encoding
     \fontencoding{#1}\selectfont
     #2{\fontencoding\@curr@enc\selectfont #3}}}%
}{}
%    \end{macrocode}
% By |\ProvideTextCommand{|\meta{csname}|}{|\meta{encoding}|}[|^^A
% \meta{number}|][|\meta{default}|]{|\meta{def}|}| 
% one defines a command applying only to a given encoding, 
% just in case it is not yet defined for this encoding.
%
%    \begin{macrocode}
\@ifundefined{ProvideTextCommand}{%
  \def\ProvideTextCommand#1#2{% misses \RobustTextCommand{#1}{ etc. }
    \expandafter\providecommand\csname #2\string#1\endcsname}%
}{}
%    \end{macrocode}
% |\ProvideTextCommandDefault{|\meta{command}|}{|\meta{def}|}|
% yields a default definition for all those encodings for which no
% explicit definition is available.
%
%    \begin{macrocode}
\@ifundefined{ProvideTextCommandDefault}{%
  \def\ProvideTextCommandDefault#1{%
    \ProvideTextCommand{#1}{U}}%
}{}
%    \end{macrocode}
% |\DeclareTextCompositeCommand{|\meta{command}|}{|^^A
% \meta{encoding}|}{|\meta{char}|}{|\meta{def}|}| 
% enables an easy way of defining the diacritics-input.
%
% The following definition relies on \LaTeXe{}/NFSS~2-internals.
%
%    \begin{macrocode}
\@ifundefined{DeclareTextCompositeCommand}{%
  \def\DeclareTextCompositeCommand#1#2#3#4{% a `dummy' text composite
    \DeclareTextComposite{#1}{#2}{#3}{`\Z}%  redefine the command 
    \expandafter\def\csname\expandafter\string\csname
         #2\endcsname\string#1-\string#3\endcsname##1##2{#4}}%
}{}
%    \end{macrocode}
%
% \subsubsection{Macros for text symbols}
%
% We establish the \texttt{OT1}-defaults for the accents and symbols
% used later:
%
% |\"|,                 % accent: German, French,
%
% |\^|,                 % accent: Romanian, French,
%
% |\c|,                 % accent: Romanian, French,
%
% |\u|,                 % accent: Romanian,
%
% |\i|,                 % symbol: Romanian, German, French,
%
% |\ss|,                % symbol: German.
%
%    \begin{macrocode}
\ProvideTextCommandDefault{\"}{\UseTextAccent{OT1}{\"}} % GF
\ProvideTextCommandDefault{\^}{\UseTextAccent{OT1}{\^}} % RF
\ProvideTextCommandDefault{\c}{\UseTextAccent{OT1}{\c}} % RF
\ProvideTextCommandDefault{\u}{\UseTextAccent{OT1}{\u}} % R
\ProvideTextCommandDefault{\i}{\UseTextSymbol{OT1}\i}   % RGF
\ProvideTextCommandDefault{\ss}{\UseTextSymbol{OT1}\ss} % G
%    \end{macrocode}
%
% We provide also symbolic names for symbols used in the macros 
% for double quotes. As ever, the defaults are taken from the 
% fonts with a~\texttt{OT1} encoding.
%
% The macro-encoding for
% \romanianTeX "`\ldots"' \originalTeX and {\glq}\ldots{\grq}:
%
%    \begin{macrocode}
\@ifundefined{textquotedblleft}{%
  \ProvideTextCommandDefault{\textquotedblleft}{%
    \UseTextSymbol{OT1}\textquotedblleft}%
  \DeclareTextSymbol{\textquotedblleft}{OT1}{92}% or: ...{OT1}{``}
%    \end{macrocode}
%
%    \begin{macrocode}
  \DeclareTextSymbol{\textquotedblleft}{T1}{16}%
}{}
\@ifundefined{textquotedblright}{%
  \ProvideTextCommandDefault{\textquotedblright}{%
    \UseTextSymbol{OT1}\textquotedblright}%
  \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}% or: ...{OT1}{''}
%    \end{macrocode}
%
%    \begin{macrocode}
  \DeclareTextSymbol{\textquotedblright}{T1}{17}%
}{}
\@ifundefined{textquoteleft}{%
  \ProvideTextCommandDefault{\textquoteleft}{%
    \UseTextSymbol{OT1}\textquoteleft}%
  \DeclareTextSymbol{\textquoteleft}{OT1}{`\`}%
  \DeclareTextSymbol{\textquoteleft}{T1}{`\`}%
}{}
\@ifundefined{textquoteright}{
  \ProvideTextCommandDefault{\textquoteright}{%
    \UseTextSymbol{OT1}\textquoteright}%
  \DeclareTextSymbol{\textquoteright}{OT1}{`\'}%
  \DeclareTextSymbol{\textquoteright}{T1}{`\'}%
}{}
\@ifundefined{quotesinglbase}{%
  \DeclareTextSymbol{\quotesinglbase}{T1}{13}%
}{}
\@ifundefined{quotedblbase}{%
  \DeclareTextSymbol{\quotedblbase}{T1}{18}%
}{}
%    \end{macrocode}
%
% The macro-encoding for the French quotes 
% \romanianTeX ">\ldots"< \originalTeX and {\frq}\ldots{\flq}:
%
%    \begin{macrocode}
\@ifundefined{guillemotleft}{%
  \DeclareTextSymbol{\guillemotleft}{T1}{19}%
}{}
\@ifundefined{guillemotright}{%
  \DeclareTextSymbol{\guillemotright}{T1}{20}%
}{}
\@ifundefined{guilsinglleft}{%
  \DeclareTextSymbol{\guilsinglleft}{T1}{14}%
}{}
\@ifundefined{guilsinglright}{%
  \DeclareTextSymbol{\guilsinglright}{T1}{15}%
}{}
%    \end{macrocode}
%
% The most important double/single quote macros have been thereby defined.
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \section{Low-level commands}
%
% \RomanianTeX{} uses low-level \TeX{} commands for the implementation 
% of the double quote mechanism, the specific Romanian diacritics, 
% the trema's, the German \emph{Uml\"aute}, etc. Some of them might
% be useful for the end-user.
%
% We must be able to distinguish the double quotes usage of \RomanianTeX{}
% from the way of coping with the double quotes in German \TeX{}
% [cf.\ \texttt{german.dtx} resp.\ \texttt{german.sty}, version 2.5c,
% |<1.05.1996>|]. 
%
% \subsection{Protect fragile commands}
%
% \LaTeX{} uses the command |\protect|, in order to protect \emph{fragile}
% commands. This has to be re-defined for Plain \TeX{} only.
%
% If undefined, |\protect| is defined as |\relax|.
%
%    \begin{macrocode}
\expandafter\let\expandafter\protect\csname protect\endcsname
%    \end{macrocode}
%
% \subsection{Local hyphenation}
%
% The command |\allowhyphens| informs \TeX{} about the fact that
% a hyphenable word-part will follow (by a |\penalty|-) and
% that a new one begins (by a |\hskip|-command, introducing a
% \textit{glue}):
%
%    \begin{macrocode}
\def\allowhyphens{\penalty\@M \hskip\z@skip}
%    \end{macrocode}
% \emph{Provisions for the German \TeX{}-mode}. 
% The |\ss|-symbol (used to input a \emph{scharfes es}) corresponds 
% to the symbol with position~|^^Y| in the~\texttt{OT1} encoding.
% So, in order to be able to hyphenate words with |\ss|, it is enough 
% to make its |\lccode| non-null. For a~|\ss| taken from a different 
% font this must be done in a macro file re-defining the font and 
% the~|\ss| command.
%
%    \begin{macrocode}
\lccode`\^^Y=`\^^Y
%    \end{macrocode}
%
% There is no harm done if we leave this active in \RomanianTeX{}.
%
% \subsection{The Romanian/German double quotes}
%
% The Romanian/German double quotes are obtained by box-manipulation
% from their English analogues.
%
% The macro |\set@low@box| lowers its argument (a symbol) at the 
% level of the usual comma:
%
%    \begin{macrocode}
\def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
  \setbox\z@\hbox{\dimen@\ht\z@ \advance\dimen@ -\ht\tw@
      \lower\dimen@\box\z@}%
  \ht\z@\ht\tw@ \dp\z@\dp\tw@}
%    \end{macrocode}
%
% After a box-command, \TeX\ sets the |\spacefactor| to~1000:
% we must save its value:
%
%    \begin{macrocode}
\def\save@sf@q#1{{\ifhmode
  \edef\@SF{\spacefactor\the\spacefactor}\else
  \let\@SF\empty \fi \leavevmode #1\@SF}}
%    \end{macrocode}
%
% \subsection{Uml\"aute and trema's}
%
% The macro |\newumlaut| replaces the original \TeX{}-primitive by a
% construct yielding a better match for the real (German) typography 
% (viz., \emph{Uml\"{a}ute mit etwas tieferen Umlautpunkten}).
% [See \texttt{german.dtx} for details.]
%
%    \begin{macrocode}
\expandafter\ifx\csname roU@D\endcsname\relax
  \csname newdimen\endcsname\roU@D
\fi
\def\newumlaut#1{{\roU@D 1ex%
  {\setbox\z@\hbox{\char127}\dimen@-.45ex\advance\dimen@\ht\z@
  \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
  \accent127\fontdimen5\font\roU@D #1}\allowhyphens}
%    \end{macrocode}
%
% For trema's, the original \TeX{} |\accent|-primitives are used.
% [See \texttt{german.dtx}.]
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
  \def\highumlaut#1{{\accent127 #1}\allowhyphens}
\else
  \def\highumlaut#1{\"{#1}\allowhyphens}
\fi
%    \end{macrocode}
%
% \subsection{Activating the double quote mechanism}
%
% The macros |\mDQon| and |\mDQoff| are used in order to activate 
% and/or de-activate the double quote mechanism.
%
%    \begin{macrocode}
\def\mDQon{\catcode`\"\active}
\def\mDQoff{\catcode`\"12\relax}
%    \end{macrocode}
%
% The symbolic names for the input notation are as follows:
%
%    \begin{macrocode}
\begingroup \mDQoff
\def\x{\endgroup
  \def\@nUML{\"}%                   normal mode
  \def\@mUML{\ddot}%                math mode (\mathaccent"707F)
  \def\@nBRV{\u}%                   normal mode
  \def\@mBRV{\breve}%               math mode
  \def\@nHAT{\^}%                   normal mode
  \def\@mHAT{\hat}%                 math mode
  \def\@nCDL{\c}%                   normal mode
  \def\@mCDL{\mathchar"7018 }%      math mode
  \def\@SS{\mathchar"7019 }%        math mode (revise)
  \def\DQ{"}}%                      or: \textquotedbl (?)
\x
%    \end{macrocode}
%
% The double quotes are now added to |\dospecials| and |\@sanitize| 
% (this is intended for \TeX{} and/or \LaTeX{}-handling):
%
%    \begin{macrocode}
\begingroup
  \def\do{\noexpand\do\noexpand}%
  \edef\x{\endgroup
    \def\noexpand\dospecials{\dospecials\do\"}}%
\x
%    \end{macrocode}
%
% But |\@sanitize| is defined only for \LaTeX\, so we ask about it:
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname @sanitize\endcsname\relax \else
  \begingroup
    \def\@makeother{\noexpand\@makeother\noexpand}%
    \edef\x{\endgroup
      \def\noexpand\@sanitize{\@sanitize\@makeother\"}}%
  \x
\fi
%    \end{macrocode}
%
% \subsection{Compatibility with other versions}
%
% \emph{Provisions for the German \TeX{}-mode}. 
% The German \TeX{} commands |\3| and |\ck| are obsolete: the next piece
% of macro-code is only maintained for downward-compatibility reasons.
%
%    \begin{macrocode}
\let\ro@original@three=\3 % \3 may be defined/undefined
\def\ck{\penalty\@M\discretionary{k-}{}{c}k\allowhyphens}
%    \end{macrocode}
%
% \section{Romanian [German/French] double quotes}
%
% The typographically `legal' Romanian double quotes are those that 
% are also `legal' in German. We have also the implicit rule of 
% (typographical) taste that `quotes inside quotes' have to be 
% `French'\ldots\, The corresponding (German) single quotes are 
% \emph{not recommended} in Romanian typography. On the other hand, 
% the English double/single quotes are -- as in German, French, etc.
% -- \emph{typographically illegal} in their \emph{left}-variant,
% i.e., if used at the beginning of a word.
%
% The macro-constructs:
%
% |\glqq|, |\grqq|,     % for German/Romanian double quotes
%
% |\flqq|, |\frqq|,     % for French double quotes
%
% |\glq|,  |\grq|,      % for German/Romanian single quotes
%
% |\flq|,  |\frq|,      % for French single quotes
% \par\noindent
% must be defined for the NFSS~2, and so for \LaTeXe{}, as being 
% encoding-dependent.
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
%    \end{macrocode}
%
% \subsection{\ldots~without NFSS~2}
%
% Approximations: macros for the Romanian/German double and single quotes
% \romanianTeX "`\ldots"' \originalTeX and {\glq}\ldots{\grq}.
%
%    \begin{macrocode}
\def\@glqq{\save@sf@q{\set@low@box{''\/}\box\z@
             \kern-.04em\allowhyphens}}
\def\glqq{\protect\@glqq}
\def\@grqq{\save@sf@q{\kern-.07em``\kern.07em}}% ('')
\def\grqq{\protect\@grqq}
\def\@glq{\save@sf@q{\set@low@box{'\/}\box\z@
            \kern-.04em\allowhyphens}}
\def\glq{\protect\@glq}
\def\@grq{\save@sf@q{\kern-.0125em`\kern.07em}}
\def\grq{\protect\@grq}
%    \end{macrocode}
%
% Approximations: macros for the French double/single quotes
% \romanianTeX "<\ldots"> \originalTeX and {\flq}\ldots{\frq}.
%
%    \begin{macrocode}
\def\@flqq{\relax\ifmmode \ll \else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle \ll $}%
    \allowhyphens}\fi}
\def\flqq{\protect\@flqq}
\def\@frqq{\relax\ifmmode \gg \else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle \gg $}%
    \allowhyphens}\fi}
\def\frqq{\protect\@frqq}
\def\@flq{\relax\ifmmode <\else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle <$}\allowhyphens}\fi}
\def\flq{\protect\@flq}
\def\@frq{\relax\ifmmode >\else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle >$}\allowhyphens}\fi}
\def\frq{\protect\@frq}
%    \end{macrocode}
% [See \texttt{german.dtx} for details.]
%
%    \begin{macrocode}
\else
%    \end{macrocode}
%
% \subsection{\ldots~with NFSS~2}
%
% In the newer \LaTeXe{} releases, |\glqq| corresponds to |\quotedblbase|. 
% The definition is extended in a relatively simple way to the 
% \texttt{OT1}-encoded fonts.
%
%    \begin{macrocode}
\DeclareRobustCommand{\glqq}{%
  \ifmmode\hbox{\quotedblbase}\else\quotedblbase\fi}
\ProvideTextCommandDefault{\quotedblbase}{%
  \UseTextSymbol{OT1}\quotedblbase}
\ProvideTextCommand{\quotedblbase}{OT1}{%
  \save@sf@q{\set@low@box{\textquotedblright\/}\box\z@
    \kern-.04em\allowhyphens}}
%    \end{macrocode}
%
% For |\grqq| there is no \LaTeXe{} counterpart: we use the older version.
% [For the \texttt{T1}-encoding, see details in \texttt{german.dtx}.]
%
%    \begin{macrocode}
\ProvideTextCommand{\grqq}{T1}{\textquotedblleft}
\ProvideTextCommand{\grqq}{OT1}{%
  \save@sf@q{\kern-.07em%
  \ifmmode\hbox{\textquotedblleft}\else\textquotedblleft\fi
  \kern.07em\relax}}
\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
%    \end{macrocode}
%
% Define correspondingly the German/Romanian single quotes
% |\glq| and |\grq|\,\ldots
%
%    \begin{macrocode}
\DeclareRobustCommand{\glq}{%
  \ifmmode\hbox{\quotesinglbase}\else\quotesinglbase\fi}
\ProvideTextCommandDefault{\quotesinglbase}{%
  \UseTextSymbol{OT1}\quotesinglbase}
\ProvideTextCommand{\quotesinglbase}{OT1}{%
  \save@sf@q{\set@low@box{\textquoteright\/}\box\z@
    \kern-.04em\allowhyphens}}
%    \end{macrocode}
%
%    \begin{macrocode}
\ProvideTextCommand{\grq}{T1}{\textquoteleft}
\ProvideTextCommand{\grq}{OT1}{%
  \save@sf@q{\kern-.0125em%
  \ifmmode\hbox{\textquoteleft}\else\textquoteleft\fi
  \kern.07em\relax}}
\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
%    \end{macrocode}
%
% \ldots\,and the French quotes (`guillemots'), both double and single:
%
%    \begin{macrocode}
\DeclareRobustCommand{\flqq}{%
  \ifmmode\hbox{\guillemotleft}\else\guillemotleft\fi}
\ProvideTextCommandDefault{\guillemotleft}{%
  \UseTextSymbol{OT1}\guillemotleft}
\ProvideTextCommand{\guillemotleft}{OT1}{%
  \ifmmode \ll \else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle \ll $}%
    \allowhyphens}\fi}
\DeclareRobustCommand{\frqq}{%
  \ifmmode\hbox{\guillemotright}\else\guillemotright\fi}
\ProvideTextCommandDefault{\guillemotright}{%
  \UseTextSymbol{OT1}\guillemotright}
\ProvideTextCommand{\guillemotright}{OT1}{%
  \ifmmode \gg \else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle \gg $}%
    \allowhyphens}\fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareRobustCommand{\flq}{%
  \ifmmode\hbox{\guilsinglleft}\else\guilsinglleft\fi}
\ProvideTextCommandDefault{\guilsinglleft}{%
  \UseTextSymbol{OT1}\guilsinglleft}
\ProvideTextCommand{\guilsinglleft}{OT1}{%
  \ifmmode <\else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle <$}\allowhyphens}\fi}
\DeclareRobustCommand{\frq}{%
  \ifmmode\hbox{\guilsinglright}\else\guilsinglright\fi}
\ProvideTextCommandDefault{\guilsinglright}{%
  \UseTextSymbol{OT1}\guilsinglright}
\ProvideTextCommand{\guilsinglright}{OT1}{%
  \ifmmode >\else \save@sf@q{\penalty\@M
    \raise .27ex\hbox{$\m@th\scriptscriptstyle >$}\allowhyphens}\fi}
%    \end{macrocode}
%
% The Romanian/German and the French double/single quote macros have 
% been thereby defined.
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \section{Uml\"aute and trema's: macros}
%
% The treatement of the macros for trema's and the German 
% \emph{Uml\"aute} must take into account the presence or the
% absence of the NFSS~2.
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
%    \end{macrocode}
%
% \subsection{\ldots~without NFSS~2}
%
% The internal switch-commands |\umlauthigh| and |\umlautlow| are
% defined first for situations without NFSS~2.
%
%    \begin{macrocode}
\def\umlauthigh{\def\"##1{{\accent127 ##1}}}
\def\umlautlow{\def\"{\protect\newumlaut}}
%    \end{macrocode}
%
%    \begin{macrocode}
\else
%    \end{macrocode}
%
% \subsection{\ldots~with NFSS~2}
%
% For situations where the NFSS~2 is available, this is more involved:
%
%    \begin{macrocode}
\def\umlauthigh{\def\ro@OTumlaut##1{{\accent 127 ##1}}}
\def\umlautlow{\def\ro@OTumlaut{\protect\newumlaut}}
\umlauthigh
%    \end{macrocode}
%
% For fonts with a~\texttt{OT1} and a~\texttt{T1} encoding, one can 
% use standard definitions. [\textbf{Note}. Some of the following are
% \emph{not} in \texttt{german.sty}.]
%
%    \begin{macrocode}
\DeclareTextAccent{\"}{T1}{4}
\DeclareTextAccent{\"}{OT1}{127}
\DeclareTextCompositeCommand{\"}{OT1}{a}{\ro@OTumlaut{a}}%  - 
\DeclareTextCompositeCommand{\"}{OT1}{A}{\ro@OTumlaut{A}}%  -
\DeclareTextCompositeCommand{\"}{OT1}{e}{\ro@OTumlaut{e}}%  -
\DeclareTextCompositeCommand{\"}{OT1}{E}{\ro@OTumlaut{E}}%  -
\DeclareTextCompositeCommand{\"}{OT1}{\i}{\ro@OTumlaut{\i}}% -
\DeclareTextCompositeCommand{\"}{OT1}{I}{\ro@OTumlaut{I}}%  -
\DeclareTextCompositeCommand{\"}{OT1}{o}{\ro@OTumlaut{o}}%  +
\DeclareTextCompositeCommand{\"}{OT1}{O}{\ro@OTumlaut{O}}%  +
\DeclareTextCompositeCommand{\"}{OT1}{u}{\ro@OTumlaut{u}}%  +
\DeclareTextCompositeCommand{\"}{OT1}{U}{\ro@OTumlaut{U}}%  +
\DeclareTextComposite{\"}{T1}{a}{228}%  + 
\DeclareTextComposite{\"}{T1}{A}{196}%  -
\DeclareTextComposite{\"}{T1}{e}{235}%  -
\DeclareTextComposite{\"}{T1}{E}{203}%  -
\DeclareTextComposite{\"}{T1}{\i}{239}% -
\DeclareTextComposite{\"}{T1}{I}{207}%  -
\DeclareTextComposite{\"}{T1}{o}{246}%  -
\DeclareTextComposite{\"}{T1}{O}{214}%  -
\DeclareTextComposite{\"}{T1}{u}{252}%  -
\DeclareTextComposite{\"}{T1}{U}{220}%  -
%    \end{macrocode}
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \section{The Romanian diacritics: macros}
%
% The Romanian \emph{breve-, hat-}, and \emph{cedilla}-macros are 
% treated differently if the NFSS~2 is present or not.
%
%    \begin{macrocode}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DeclareTextSymbol\endcsname\relax
%    \end{macrocode}
%
% \subsection{\ldots~without NFSS~2}
%
% The macros are defined first for situations without the NFSS~2.
%
%    \begin{macrocode}
\def\@nBRV{\def\u##1{{\accent21 ##1}}}
\def\@nHAT{\def\^##1{{\accent94 ##1}}}
\def\@nCDL{% cf. \c{#1} in Plain TeX
\def\c##1{{\setbox\z@\hbox{##1}\ifdim\ht\z@=1ex{\accent24 ##1}%
  \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}}}
%    \end{macrocode}
%
%    \begin{macrocode}
\else
%    \end{macrocode}
%
% \subsection{\ldots~with NFSS~2}
%
% For situations with the NFSS~2 is available, one has:
%
%    \begin{macrocode}
\def\@rBRV{\def\ro@OTbrv##1{{\accent 21 ##1}}}
\def\@rHAT{\def\ro@OThat##1{{\accent 94 ##1}}}
\def\@rCDL{% cf. \c{#1} in Plain TeX
\def\ro@OTcdl##1{{\setbox\z@\hbox{##1}\ifdim\ht\z@=1ex{\accent24 ##1}%
  \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}}}
\@rBRV
\@rHAT
\@rCDL
%    \end{macrocode}
%
% For fonts with a~\texttt{OT1} and a~\texttt{T1} encoding,
% one can use standard definitions.
%
%    \begin{macrocode}
\DeclareTextAccent{\u}{T1}{8}
\DeclareTextAccent{\^}{T1}{2}
\DeclareTextAccent{\c}{T1}{11}
\DeclareTextAccent{\u}{OT1}{21}
\DeclareTextAccent{\^}{OT1}{94}
\DeclareTextAccent{\c}{OT1}{24}
\DeclareTextCompositeCommand{\u}{OT1}{a}{\ro@OTbrv{a}}%
\DeclareTextCompositeCommand{\u}{OT1}{A}{\ro@OTbrv{A}}%
\DeclareTextCompositeCommand{\^}{OT1}{a}{\ro@OThat{a}}%
\DeclareTextCompositeCommand{\^}{OT1}{A}{\ro@OThat{A}}%
\DeclareTextCompositeCommand{\^}{OT1}{\i}{\ro@OThat{\i}}%
\DeclareTextCompositeCommand{\^}{OT1}{I}{\ro@OThat{I}}%
\DeclareTextCompositeCommand{\c}{OT1}{s}{\ro@OTcdl{s}}%
\DeclareTextCompositeCommand{\c}{OT1}{S}{\ro@OTcdl{S}}%
\DeclareTextCompositeCommand{\c}{OT1}{t}{\ro@OTcdl{t}}%
\DeclareTextCompositeCommand{\c}{OT1}{T}{\ro@OTcdl{T}}%
\DeclareTextComposite{\u}{T1}{a}{160}
\DeclareTextComposite{\u}{T1}{A}{128}
\DeclareTextComposite{\^}{T1}{a}{226}
\DeclareTextComposite{\^}{T1}{A}{194}
\DeclareTextComposite{\^}{T1}{\i}{238}
\DeclareTextComposite{\^}{T1}{I}{206}
\DeclareTextComposite{\c}{T1}{s}{179}
\DeclareTextComposite{\c}{T1}{S}{147}
\DeclareTextComposite{\c}{T1}{t}{181}
\DeclareTextComposite{\c}{T1}{T}{149}
%    \end{macrocode}
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \section{The double quote input notation}
%
% The input notation |"<input-symbol>| for diacritics, special
% hyphens, etc., used in \RomanianTeX{} is implemented by the double
% quote \textit{active character}. The active DQ-character reads
% its argument, deciding about the next action to be performed.
%
% \subsection{Warnings and errors reports}
%
% Upon scanning an undefined |"<input-symbol>|-sequence,
% \RomanianTeX{} generates warnings and error reports.
%
%    \begin{macrocode}
\def\DQwarninglevel#1{\chardef\ro@DQwarninglevel=#1\relax}
\DQwarninglevel{1}
%    \end{macrocode}
%
%    \begin{macrocode}
\expandafter\ifx\csname on@line\endcsname\relax
  \ifx\inputlineno\undefined \let\on@line\@empty
  \else
    \ifnum\inputlineno<\z@ \let\on@line\@empty
    \else \def\on@line{ on input line \the\inputlineno}
\fi\fi\fi
%    \end{macrocode}
%
% The macros for warnings and error reports are self-explanatory:
%
%    \begin{macrocode}
\def\ro@DQ@error#1{%
  \errhelp{Use `` for a simple double quote character.}%
  \errmessage{romanian: The command \DQ\string#1 is undefined}}
\def\ro@DQ@warning#1{%
   \immediate\write\sixt@@n{romanian: %
       \DQ\string#1 is possibly wrong\on@line.}}
%    \end{macrocode}
%
% \subsection{The defining mechanism for double quote macros}
%
%    \begin{macrocode}
\def\ro@DQ@macro#1#2{%
  \expandafter#1\csname @ro@@\string #2DQ\endcsname}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\def@DQmacro#1#2#3{%
  \ro@DQredefcheck{#1}%
  \ro@DQ@macro\def{#1}{{#2}{#3}}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\let@DQmacro#1#2{\begingroup
  \ro@DQredefcheck{#1}%
  \edef\x{\endgroup \let
    \ro@DQ@macro\noexpand{#1}\ro@DQ@macro\noexpand{#2}}%
  \x}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\ro@DQredefcheck#1{}
%    \end{macrocode}
%
% \subsection{Macros for the active double quote}
%
% The macro |\@active@DQ| is linked to the active double quote symbol:
%
%    \begin{macrocode}
\def\@active@DQ#1{%
  \ro@DQ@macro\ifx{#1}\relax
    \ifnum\ro@DQwarninglevel>\z@ \ro@DQ@error{#1}\fi
    \expandafter\ro@@normal@DQ
  \else
    \expandafter\ro@@active@DQ
  \fi {#1}}
%    \end{macrocode}
%
% Cope with the hexadecimal \TeX{} input-notation (a do-nothing case):
%
%    \begin{macrocode}
\def\ro@@active@DQ#1{%
  \ro@DQ@macro\ifx{#1}\noexpand
    \expandafter\ro@normal@DQ
  \else
    \expandafter\ro@@@active@DQ
  \fi {#1}}
%    \end{macrocode}
%
% The command |\ro@@normal@DQ| generates two single quotes
% (used in error handling), while |\ro@normal@DQ| is used for
% hexadecimal \TeX{}-input.
%
%    \begin{macrocode}
\def\ro@@normal@DQ#1{``#1}
\def\ro@normal@DQ#1{\DQ #1}
%    \end{macrocode}
%
% \subsection{The protection mechanism}
%
% The protection mechanism is identical with that of German \TeX{}
% and is explained in \texttt{german.dtx}.
%
%    \begin{macrocode}
\begingroup
  \catcode`\(=1\lccode`\(=`\{\catcode`\{=12
  \catcode`\)=2\lccode`\)=`\}\catcode`\}=12
  \catcode`\ =11\relax% <= do not delete this and the
\lowercase(\endgroup% <=== following percent characters!
%    \end{macrocode}
%
%    \begin{macrocode}
\def\ro@@@active@DQ#1(%
\expandafter\ro@@@@active@DQ\expandafter{\string#1})%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\ro@@@@active@DQ(%
\ifx\protect\relax\else\ifx\protect\empty\else%
\expandafter\expandafter\expandafter\protect%
\fi\fi%
\active@DQ \DQ@prtct )%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\DQ@prtct#1#(\@DQ@prtct)%
\def\@DQ@prtct#1(\string\DQ@prtct{\string#1})%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\DQ@prtct #1{#2}(\string\DQ@prtct{\string#2})%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\active@DQ #1{#2}(\ro@active@@DQ(#2))%
%    \end{macrocode}
%
%    \begin{macrocode}
)%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\active@DQ#1#{\@active@DQ}%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\ro@active@@DQ#1{%
  \csname ro@DQ\ifmmode second\else first\fi
    \expandafter\expandafter\expandafter\expandafter
  \ro@DQ@macro\endcsname{#1}}
%    \end{macrocode}
%
% \subsection{Differential double quote control}
%
% \RomanianTeX{} \emph{specifics}: we introduce a new identifier
% |DQ@mode|; it will be used as a Boolean [a 2-position flag] in
% order to discriminate between the German and the Romanian \TeX{}
% double quote control.
%
%    \begin{macrocode}
\newcount\DQ@mode \DQ@mode=0 % allocate a counter and initialize it
%    \end{macrocode}
%
%    \begin{macrocode}
\def\setRomanianDQ{\DQ@mode=0}
\def\setGermanDQ{\DQ@mode=1}
%    \end{macrocode}
%
% There are obvious discriminators:
%
%    \begin{macrocode}
\def\@R#1#2{\ifnum\DQ@mode=0 #1\else #2\fi}
\def\@G#1#2{\ifnum\DQ@mode=1 #1\else #2\fi}
%    \end{macrocode}
%
% In fact, only one -- |\@R| say -- is actually needed later.
%
% \subsection{The double quote commands}
%
% Most of the |"|-input commands are similar and have the same effect
% in \RomanianTeX{}~\RomanianTeXid~and in the \emph{current version} of
% German \TeX{} [cf.\ \texttt{german.dtx}, v2.5c |<1.05.1996>|].
%
% \subsubsection{The hexadecimal notation}
%
% We handle first the standard \TeX{} hexadecimal double quote input
% notation:
%
%    \begin{macrocode}
\ro@DQ@macro\let{0}=\noexpand
\let@DQmacro{1}{0}\let@DQmacro{2}{0}\let@DQmacro{3}{0}
\let@DQmacro{4}{0}\let@DQmacro{5}{0}\let@DQmacro{6}{0}
\let@DQmacro{7}{0}\let@DQmacro{8}{0}\let@DQmacro{9}{0}
\let@DQmacro{A}{0}\let@DQmacro{B}{0}\let@DQmacro{C}{0}
\let@DQmacro{D}{0}\let@DQmacro{E}{0}\let@DQmacro{F}{0}
%    \end{macrocode}
%
% \subsubsection{Inputting the double quotes}
%
% The macro-encoding for the input of the Romanian/German and
% French double quotes \romanianTeX ("`\ldots"' and "<\ldots">)
% \originalTeX is as expected:
%
%    \begin{macrocode}
\def@DQmacro{`}{\glqq{}}{\glqq{}}            % Romanian/German L-DQ
\def@DQmacro{'}{\grqq{}}{\grqq{}}            % Romanian/German R-DQ
\def@DQmacro{<}{\flqq{}}{\flqq{}}            % French L-`guillemots'
\def@DQmacro{>}{\frqq{}}{\frqq{}}            % French R-`guillemots'
%    \end{macrocode}
%
% \subsubsection{The normal double quote input}
%
% In older versions of German and Romanian \TeX{} we could generate
% a normal double quote symbol with |"{}|. This feature is maintained
% on downward-compatibility reasons:
%
%    \begin{macrocode}
\def@DQmacro{}{\DQ{}}{\DQ{}}
%    \end{macrocode}
%
% \subsubsection{Hyphenation auxiliaries}
%
% The special |"|-prefixed symbolic sequences
% \verb:"-:, \verb:"|:, \verb:"":, \verb:"~:, and \verb:"=:
% stand for hyphenation auxiliary commands, allowing us to cope
% (automatically) with local hyphenation exceptions.
%
%    \begin{macrocode}
\def@DQmacro{-}{\penalty\@M\-\allowhyphens}%
               {\penalty\@M\-\allowhyphens}
\def@DQmacro{|}{\penalty\@M\discretionary{-}{}{\kern.03em}%
                \allowhyphens}{}
\def@DQmacro{"}{\hskip\z@skip}{\hskip\z@skip}
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{~}{\leavevmode\hbox{-}}{-}
\def@DQmacro{=}{\penalty\@M-\hskip\z@skip}%
               {\penalty\@M-\hskip\z@skip}
%    \end{macrocode}
%
% \subsubsection{Diacritics: Romanian vowels}
%
% The specific input-output mapping of the Romanian/German diacritics 
% on vowels must be as follows. (We document here the case-analysis 
% \RomanianTeX{} \emph{versus} German \TeX{}. 
% The \emph{actual conditional macro-encoding} is summarized in the 
% list appearing at the end of this section.)
%
% For |"a| and |"A| we have, differentially: Romanian \romanianTeX
% "a, "A \emph{versus} German \germanTeX "a, "A; for instance,
% Romanian \romanianTeX \emph{cas"a} [house], \emph{rom"An} 
% [Romanian] and German \germanTeX \emph{sp"at, SP"AT} [late]. 
% \originalTeX (The Romanian upper-case \u{A} and \^{A} are rare
% in print and are \emph{not} macro-encoded in \RomanianTeX{}.)
%
% Analogously, for |"i| and |"I|, one has Romanian \romanianTeX
% "i, "I (e.g., "in, "In [in]) \emph{versus} German/French trema's 
% \germanTeX "i, "I. \originalTeX
%
% On economy reasons, the remaining \emph{Uml\"aute}
% \romanianTeX ("o, "O and "u, "U) \originalTeX and trema's
% \romanianTeX ("e, "E, \originalTeX with |\highumlaut|) can be
% imported as such from the German \TeX{}, although there is no
% need for them in \RomanianTeX{} (except from borrowings, they
% do not occur in Romanian).
%
% \subsubsection{Diacritics: Romanian consonants 1}
%
% Unlike German, Romanian has diacritics on consonants, too:
% Romanian \romanianTeX "s, "S and "t, "T, resp. \originalTeX
% In these cases, German \TeX{} uses the |"|-input for genuine
% purposes.
%
% So |"s| and |"S| are used to get \emph{scharfes es} input-encoding.
% Contrast, e.g., the Romanian \romanianTeX \emph{"stiri, "Stiri} 
% [news] and the German \germanTeX \emph{Stra"se, STRA"SE} [street]. 
% \originalTeX
%
% Moreover, |"z| and |"Z| have no effect in \RomanianTeX{},
% while, in German \TeX{}, they are also supposed to generate
% \emph{scharfes es}, in the form \germanTeX "z and "Z, resp.
% (contrast, for instance, \romanianTeX \emph{"zar, "Zar} [dice]
% and \germanTeX \emph{Stra"ze, STRA"ZE} [street]). \originalTeX
%
% In \RomanianTeX{}, the original German \TeX{} encodings of
% |"s|, |"S|, |"z| and |"Z| are neutralized conditionally.
%
% On the other hand, in German \TeX{}, the |"t|- and |"T|-input
% is used to yield an `automatic' German hyphenation exception.
%
% \subsubsection{German hyphenation exceptions}
%
% The German hyphenation exceptions [cf.\ \texttt{german.dtx}] are 
% handled by a specific mechanism. The next piece of macro-code is 
% used only for the German \TeX{} |DQ@mode|:
%
%    \begin{macrocode}
\def\ro@DQgdsc#1#2{\penalty\@M
  \ifnum\ro@DQwarninglevel>\@ne \ro@DQ@warning{#1}\fi
  \discretionary{#2-}{}{#1}\allowhyphens}
%    \end{macrocode}
%
% The conditional variant must also include a test for Romanian;
% if a \RomanianTeX{} |DQ@mode| is found, the second argument
% (meant to allow German discretionary hyphens) must be discarded,
% and so must be the possible warnings:
%
%    \begin{macrocode}
\def\ro@DQdisc#1#2{%            Romanian-DQ:
\ifnum\DQ@mode=0 #1\relax\else% German-DQ:
  \penalty\@M
  \ifnum\ro@DQwarninglevel>\@ne \ro@DQ@warning{#1}\fi
  \discretionary{#2-}{}{#1}\allowhyphens
\fi}
%    \end{macrocode}
%
% The \RomanianTeX{} handles the German hyphenation exceptions
% conditionally, with |\ro@DQdisc|.
%
% We have, for instance, the genuine German hyphenation exception
% [k-k], [K-K], from input |"ck|, |"CK|, but nothing to do in the
% case of Romanian (and in German math-mode). 
%
% Further, except for |"t| and |"T| (see below), the remaining cases
% (|"l|, |"L|, |"m|, |"M|, |"n|, |"N|, |"p|, |"P|,|"r|, |"R| and |"F|)
% are similar, and the original German \TeX{} macro-code can be also
% used in \RomanianTeX{} (with the discriminating |\ro@DQdisc|-macro).
%
% Finally, the special lower-case German \texttt{ff}-ligatures require
% a specific mechanism, |\def@DQmacro{f}{\ro@DQdiscff}{f}|, where:
%
%    \begin{macrocode}
\def\ro@DQdiscff{\penalty\@M
  \ifnum\ro@DQwarninglevel>\@ne \ro@DQ@warning f\fi
  \afterassignment\ro@DQinsertff \let\ro@DQnextff= }
\def\ro@DQinsertff{%
  \if f\ro@DQnextff
    \expandafter\ro@DQfirst\else\expandafter\ro@DQsecond\fi
  {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\ro@DQnext}}
%    \end{macrocode}
%
%    \begin{macrocode}
\let\ro@DQnextff=f
%    \end{macrocode}
% [See \texttt{german.dtx} for explanations.]
% As there is no \emph{ff} in Romanian (except from borrowings),
% this piece of macro-code is useless in \RomanianTeX{} and we
% may either decide to neutralize it conditionally or leave it
% as it is, with no harm done.
%
% \emph{Note}. The \TeX{} math-mode ignores the exceptional German hyphens.
%
% \subsubsection{Diacritics: Romanian consonants 2}
%
% However, |"t| and |"T| are supposed to yield \romanianTeX "t and "T
% \originalTeX resp.\ under a \RomanianTeX{} DQ-r\'egime. In this
% case, in place of the original German \TeX{} macro-code, we have a
% differential treatement:
% Romanian \romanianTeX "t, "T, as, e.g., in \emph{"tara, "Tara} 
% [the country] \originalTeX \emph{versus} the genuine German 
% hyphenation exception [tt-t], [TT-T].
%
% This can be encoded by using \emph{both} the |\@R|-discriminator
% \emph{and} the \emph{original} German \TeX{} |\grmn@DQdisc| (called
% here |\ro@DQgdsc|).
%
% \subsection{The actual DQ-translation}
%
% We can now display the \emph{actual} |"|-translation map:
%
% \subsubsection{Vowels}
%
%    \begin{macrocode}
\def\@nDQ@a{\@R{\@nBRV a}{\@nUML a}}          % "a: \u{a}  | \"{a}
\def\@mDQ@a{\@R{\@mBRV a}{\@mUML a}}          % "a: \u{a}  | \"{a}
\def\@nDQ@A{\@R{\@nHAT a}{\@nUML A}}          % "A: \^{a}  | \"{A}
\def\@mDQ@A{\@R{\@mHAT a}{\@mUML A}}          % "A: \^{a}  | \"{A}
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{a}{\@nDQ@a}{\@mDQ@a}             % "a: \u{a}  | \"{a}
\def@DQmacro{A}{\@nDQ@A}{\@mDQ@A}             % "A: \^{a}  | \"{A}
%    \end{macrocode}
%
%    \begin{macrocode}
\def@DQmacro{e}{\highumlaut e}{\@mUML e}      % "e: \"{e}  | \"{e}
\def@DQmacro{E}{\highumlaut E}{\@mUML E}      % "e: \"{E}  | \"{E}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@nDQ@i{\@R{\@nHAT{\i}}{\highumlaut{\i}}} % "i: \^{\i} | \"{\i}
\def\@mDQ@i{\@R{\@mHAT\imath}{\@mUML\imath}}  % "i: \^{\i} | \"{\i}
\def\@nDQ@I{\@R{\@nHAT I}{\highumlaut I}}     % "I: \^{I}  | \"{I}
\def\@mDQ@I{\@R{\@mHAT I}{\@mUML I}}          % "I: \^{I}  | \"{I}
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{i}{\@nDQ@i}{\@mDQ@i}             % "i: \^{\i} | \"{\i}
\def@DQmacro{I}{\@nDQ@I}{\@mQQ@I}             % "I: \^{I}  | \"{I}
%    \end{macrocode}
%
%    \begin{macrocode}
\def@DQmacro{o}{\@nUML o}{\@mUML o}           % "o: \"{o}  | \"{o}
\def@DQmacro{O}{\@nUML O}{\@mUML O}           % "O: \"{O}  | \"{O}
%    \end{macrocode}
%
%    \begin{macrocode}
\def@DQmacro{u}{\@nUML u}{\@mUML u}           % "u: \"{u}  | \"{u}
\def@DQmacro{U}{\@nUML U}{\@mUML U}           % "U: \"{U}  | \"{U}
%    \end{macrocode}
%
% \subsubsection{Consonants}
%
%    \begin{macrocode}
\def@DQmacro{c}{\ro@DQdisc ck}{c}             % "ck: ck    | [k-k]
\def@DQmacro{C}{\ro@DQdisc CK}{C}             % "CK: ck    | [K-K]
%    \end{macrocode}
%
%    \begin{macrocode}
\def@DQmacro{f}{\ro@DQdiscff}{f}              % "ff: [ff-f]| [ff-f]
\def@DQmacro{F}{\ro@DQdisc F{FF}}{F}          % "FF: FF    | [FF-F]
%    \end{macrocode}
%
%    \begin{macrocode}
\def@DQmacro{l}{\ro@DQdisc l{ll}}{l}          % "ll: ll    | [ll-l]
\def@DQmacro{L}{\ro@DQdisc L{LL}}{L}          % "LL: LL    | [LL-L]
\def@DQmacro{m}{\ro@DQdisc m{mm}}{m}          % similar
\def@DQmacro{M}{\ro@DQdisc M{MM}}{M}          % similar
\def@DQmacro{n}{\ro@DQdisc n{nn}}{n}          % similar
\def@DQmacro{N}{\ro@DQdisc N{NN}}{N}          % similar
\def@DQmacro{p}{\ro@DQdisc p{pp}}{p}          % similar
\def@DQmacro{P}{\ro@DQdisc P{PP}}{P}          % similar
\def@DQmacro{r}{\ro@DQdisc r{rr}}{r}          % similar
\def@DQmacro{R}{\ro@DQdisc R{RR}}{R}          % similar
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@nDQ@s{\@R{\@nCDL s}{\ss{}}}             % "s: \c{s}  | \ss
\def\@mDQ@s{\@R{\@mCDL s}{\@SS{}}}            % "s: \c{s}  | \ss
\def\@nDQ@S{\@R{\@nCDL S}{SS}}                % "S: \c{S}  | SS
\def\@mDQ@S{\@R{\@mCDL S}{SS}}                % "S: \c{S}  | SS
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{s}{\@nDQ@s}{\@mDQ@s}             % "s: \c{s}  | \ss
\def@DQmacro{S}{\@nDQ@S}{\@mDQ@S}             % "S: \c{S}  | SS
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@nDQ@t{\@R{\@nCDL t}{\ro@DQgdsc t{tt}}}  % "t: \c{t}  | [tt-t]
\def\@mDQ@t{\@R{\@mCDL t}{t}}                 % "t: \c{t}  | t
\def\@nDQ@T{\@R{\@nCDL T}{\ro@DQgdsc T{TT}}}  % "T: \c{T}  | [TT-T]
\def\@mDQ@T{\@R{\@mCDL T}{T}}                 % "T: \c{T}  | T
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{t}{\@nDQ@t}{\@mDQ@t}             % "t: \c{t}  | [tt-t]
\def@DQmacro{T}{\@nDQ@T}{\@mDQ@T}             % "T: \c{T}  | [TT-T]
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@nDQ@z{\@R{z}{\ss{}}}                    % "z: z      | \ss
\def\@mDQ@z{\@R{z}{\@SS{}}}                   % "z: z      | \ss
\def\@nDQ@Z{\@R{Z}{SZ}}                       % "Z: Z      | SZ
\def\@mDQ@Z{\@R{Z}{SZ}}                       % "Z: Z      | SZ
%    \end{macrocode}
%    \begin{macrocode}
\def@DQmacro{z}{\@nDQ@z}{\@mDQ@z}             % "z: z      | \ss
\def@DQmacro{Z}{\@nDQ@Z}{\@mDQ@Z}             % "Z: Z      | SZ
%    \end{macrocode}
%
% \subsection{Re-defining the DQ-commands}
%
%    \begin{macrocode}
\def\ro@DQredefcheck#1{%
  \immediate\write\m@ne{romanian: %
    \ro@DQ@macro\ifx{#1}\relax \else re\fi
    defining DQ-command for `\string#1'\on@line.}}%
%    \end{macrocode}
% [See \texttt{german.dtx}.]
%
% \section{Support for other languages}
%
% This section copes with material which is by now standard in
% the \LaTeX{}-world. The interested reader will fruitfully consult
% \texttt{german.dtx} or any other similar macro-package (as, e.g.,
% the \textsc{babel}-system), if (s)he is not already aware of the
% way the language-dependent features (date, caption display, etc.)
% should work in \LaTeX{}.
%
% \subsection{Dates}
%
% \subsubsection{The English date}
%
%    \begin{macrocode}
\def\month@english{\ifcase\month \or
  January\or February\or March\or April\or
  May\or June\or July\or August\or
  September\or October\or November\or December\fi}
\def\dateUSenglish{\def\today{\month@english
  \space\number\day, \number\year}}
\def\dateenglish{\def\today{\number\day \ifcase\day \or
  st\or nd\or rd\or th\or th\or th\or th\or th\or th\or th\or%  1..10
  th\or th\or th\or th\or th\or th\or th\or th\or th\or th\or% 11..20
  st\or nd\or rd\or th\or th\or th\or th\or th\or th\or th\or% 21..30
  st\fi
  ~\month@english \space\number\year}}
%    \end{macrocode}
%
% \subsubsection{The Romanian date}
%
%    \begin{macrocode}
\def\month@romanian{\ifcase\month \or
  ianuarie\or februarie\or martie\or aprilie\or
  mai\or iunie\or iulie\or august\or 
  septembrie\or octombrie\or noiembrie\or decembrie\fi}
\def\dateromanian{\def\today{\number\day~\month@romanian
  \space\number\year}}
%    \end{macrocode}
%
% \subsubsection{The German and Austrian dates}
%
%    \begin{macrocode}
\def\month@german{\ifcase\month \or
  Januar\or Februar\or M\"arz\or April\or
  Mai\or Juni\or Juli\or August\or
  September\or Oktober\or November\or Dezember\fi}
\def\dategerman{\def\today{\number\day.~\month@german
  \space\number\year}}
\def\dateaustrian{\def\today{\number\day.~\ifnum 1=\month
  J\"anner\else \month@german\fi \space\number\year}}
%    \end{macrocode}
%
% \subsubsection{The French date}
%
%    \begin{macrocode}
\def\datefrench{\def\today{\number\day \ifnum1=\day \/$^{\rm er}$\fi
  \space\ifcase\month \or
  janvier\or f\'evrier\or mars\or avril\or
  mai\or juin\or juillet\or ao\^ut\or
  septembre\or octobre\or novembre\or d\'ecembre\fi
  \space\number\year}}
%    \end{macrocode}
%
% \subsection{Captions}
%
% \subsubsection{English captions}
%
%    \begin{macrocode}
\def\captionsenglish{%
  \def\prefacename{Preface}%
  \def\refname{References}%
  \def\abstractname{Abstract}%
  \def\bibname{Bibliography}%
  \def\chaptername{Chapter}%
  \def\appendixname{Appendix}%
  \def\contentsname{Contents}%
  \def\listfigurename{List of Figures}%
  \def\listtablename{List of Tables}%
  \def\indexname{Index}%
  \def\figurename{Figure}%
  \def\tablename{Table}%
  \def\partname{Part}%
  \def\enclname{encl}%
  \def\ccname{cc}%
  \def\headtoname{To}%
  \def\pagename{Page}%
  \def\seename{see}%
  \def\alsoname{see also}}
\let\captionsUSenglish=\captionsenglish
%    \end{macrocode}
%
% \subsubsection{Romanian captions}
%
%    \begin{macrocode}
\def\captionsromanian{%                       % Variants:
\def\prefacename{Prefa\c{t}\u{a}}%            %
  \def\refname{Bibliografie}%                 % Trimiteri bibliografice
  \def\abstractname{Rezumat}%                 % Sumar 
  \def\bibname{Bibliografie}%                 %
  \def\chaptername{Capitolul}%                % [essay.sty]: {}
  \def\appendixname{Anex\u{a}}%               % Apendix
  \def\contentsname{Cuprins}%                 % Tabla de materii
  \def\listfigurename{Lista de figuri}%       % Indice de figuri
  \def\listtablename{Lista de tabele}%        % Tabele
  \def\indexname{Indice}%                     % 
  \def\figurename{Figura}%                    % 
  \def\tablename{Tabelul}%                    %
  \def\partname{Partea}%                      % 
  \def\enclname{anexe}%                       % con\c{t}ine anexe
  \def\ccname{Copie pentru}%                  % 
  \def\headtoname{C\u{a}tre}%                 %		
  \def\pagename{pagina}%                      % pag., p.
  \def\seename{vezi}%                         % a se vedea, v.
  \def\alsoname{vezi de asemenea}}%           % vezi \c{s}i
%    \end{macrocode}
%
% Note that, for \texttt{essay.sty} (a \RomanianTeX{} style option 
% based on Lamport's \texttt{book.sty}), the |\chaptername| must be
% \emph{nil}.
%
% The variant-label \emph{Trimiteri bibliografice} for the
% |\refname|-field looks obsolete, but most people from the
% humanities would use it preferentially, in place of the
% bare \emph{Bibliografie}, translated \emph{ad hoc}, yet 
% incorrectly, from English/French. 
%
% Finally, the noun \emph{Lista} in the |\listfigurename| and
% |\listtablename| fields may also appear without a definite 
% article (i.e., as \emph{List\u{a}}) in current Romanian prints.
%
% \subsubsection{German captions}
%
%    \begin{macrocode}
\def\captionsgerman{%                         % Variants:
  \def\prefacename{Vorwort}%                  %
  \def\refname{Literatur}%                    % Bibliographie
  \def\abstractname{Zusammenfassung}%         %
  \def\bibname{Literaturverzeichnis}%         % Bibliographie
  \def\chaptername{Kapitel}%                  %
  \def\appendixname{Anhang}%                  %
  \def\contentsname{Inhaltsverzeichnis}%      % Inhalt
  \def\listfigurename{Abbildungsverzeichnis}% %
  \def\listtablename{Tabellenverzeichnis}%    %
  \def\indexname{Index}%                      %
  \def\figurename{Abbildung}%                 %
  \def\tablename{Tabelle}%                    % Tafel
  \def\partname{Teil}%                        %
  \def\enclname{Anlage(n)}%                   % Beilage(n)
  \def\ccname{Verteiler}%                     % Kopien an
  \def\headtoname{An}%                        %
  \def\pagename{Seite}%                       % S.
  \def\seename{siehe}%                        % s.
  \def\alsoname{siehe auch}}                  %
\let\captionsaustrian=\captionsgerman
%    \end{macrocode}
%
% \subsubsection{French captions}
%
%    \begin{macrocode}
\def\captionsfrench{%
  \def\prefacename{Pr\'eface}%
  \def\refname{R\'ef\'erences}%
  \def\abstractname{R\'esum\'e}%
  \def\bibname{Bibliographie}%
  \def\chaptername{Chapitre}%
  \def\appendixname{Annexe}%
  \def\contentsname{Table des mati\`eres}%
  \def\listfigurename{Liste des figures}%
  \def\listtablename{Liste des tableaux}%
  \def\indexname{Index}%
  \def\figurename{Figure}%
  \def\tablename{Tableau}%
  \def\partname{Partie}%
  \def\enclname{P.~J.}%
  \def\ccname{Copie \`a}%
  \def\headtoname{A}%
  \def\pagename{Page}%
  \def\seename{voir}%
  \def\alsoname{voir aussi}}%
%    \end{macrocode}
%
% \subsection{Other language-dependent parameters}
%
% \subsubsection{English}
%
%    \begin{macrocode}
\def\extrasUSenglish{}
\let\noextrasUSenglish=\extrasUSenglish
\let\extrasenglish=\extrasUSenglish
\let\noextrasenglish=\extrasenglish
%    \end{macrocode}
%
% \subsubsection{Romanian}
%
%    \begin{macrocode}
\def\extrasromanian{\frenchspacing \uchyph\@ne
  \lefthyphenmin\tw@ \righthyphenmin\tw@}
\def\noextrasromanian{%
  \ifnum\sfcode`\.=\@m \else \noexpand\nonfrenchspacing \fi
  \uchyph\the\uchyph\relax
  \lefthyphenmin\the\lefthyphenmin
  \righthyphenmin\the\righthyphenmin}
%    \end{macrocode}
%
% \subsubsection{German}
%
%    \begin{macrocode}
\def\extrasgerman{\frenchspacing \uchyph\@ne
  \lefthyphenmin\tw@ \righthyphenmin\tw@}
\def\noextrasgerman{%
  \ifnum\sfcode`\.=\@m \else \noexpand\nonfrenchspacing \fi
  \uchyph\the\uchyph\relax
  \lefthyphenmin\the\lefthyphenmin
  \righthyphenmin\the\righthyphenmin}
\let\extrasaustrian=\extrasgerman
\let\noextrasaustrian=\noextrasgerman
%    \end{macrocode}
%
% \subsubsection{French}
%
%    \begin{macrocode}
\def\extrasfrench{\frenchspacing}
\def\noextrasfrench{%
  \ifnum\sfcode`\.=\@m \else \noexpand\nonfrenchspacing \fi}
%    \end{macrocode}
%
% \subsection{Language identifiers: default values}
% 
%    \begin{macrocode}
\@ifundefined{l@USenglish}{%
  \@ifundefined{l@english}{\chardef\l@USenglish=255 }%
                          {\chardef\l@USenglish=\l@english}%
  \wlog{romanian: \string\language\space number for US English %
        undefined, default \number\l@USenglish\space used.}%
}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\@ifundefined{l@english}{%
  \chardef\l@english=\l@USenglish
  \wlog{romanian: \string\language\space number for UK English %
        undefined, default \number\l@english\space used.}%
}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\@ifundefined{l@romanian}{%
  \chardef\l@romanian=255 %
    \message{romanian: \string\language\space number for Romanian %
             undefined, default \number\l@romanian\space used.}%
}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\@ifundefined{l@german}{%
  \@ifundefined{l@austrian}{%
    \chardef\l@german=255 %
    \wlog{romanian: \string\language\space number for German %
          undefined, default \number\l@german\space used.}%
}{%
    \chardef\l@german=\l@austrian
    \wlog{romanian: \string\language\space number for German %
          undefined, default \number\l@german\space used.}%
 }%
}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\@ifundefined{l@austrian}{%
  \chardef\l@austrian=\l@german
  \wlog{romanian: \string\language\space number for Austrian %
        undefined, default \number\l@austrian\space used.}%
}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\@ifundefined{l@french}{%
  \chardef\l@french=255
  \wlog{romanian: \string\language\space number for French %
        undefined, default \number\l@french\space used.}%
}{}
%    \end{macrocode}
%
% \subsection{Language selection macros}
%
%    \begin{macrocode}
\def\ro@originalTeX{}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\languagename{}
%    \end{macrocode}
%
%    \begin{macrocode}
\expandafter\def\csname selectlanguage \endcsname#1{\relax
  \expandafter\ifx\csname l@#1\endcsname\relax
    \errhelp{Your command will be ignored, type <return> to proceed}%
    \errmessage{You haven't defined the language #1 yet}%
  \else
    \ro@originalTeX
    \edef\languagename{#1}%
    \edef\ro@originalTeX{\csname noextras#1\endcsname
                      \def\noexpand\ro@originalTeX{}}%
    \csname date#1\endcsname
    \csname captions#1\endcsname
    \csname extras#1\endcsname\relax
    \csname bibs#1\endcsname % for `bibgerm': must disappear!
    \language \csname l@#1\endcsname\relax
  \fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\begingroup\catcode`\ =11\relax% <= do not delete this and the
\toks0={\endgroup% <=== following percent characters!
\def\selectlanguage#1{\protect\selectlanguage {%
\ifnum\escapechar=\expandafter`\string#1\empty%
\else\string#1\empty\fi}}}%
\the\toks0\relax%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\p@selectlanguage{\selectlanguage}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\iflanguage#1#2#3{%
  \expandafter\ifx\csname l@#1\endcsname\relax #3%
  \else \ifnum\csname l@#1\endcsname=\language #2%
  \else #3\fi\fi}
%    \end{macrocode}
%
% \subsection{Compatibility with \protect\TeX~2}
%
%    \begin{macrocode}
\expandafter\ifx\csname language\endcsname\relax
  \csname newcount\endcsname\language
  \language=0 \fi
\expandafter\ifx\csname lefthyphenmin\endcsname\relax
  \csname newcount\endcsname\lefthyphenmin
  \lefthyphenmin=2 \fi
\expandafter\ifx\csname righthyphenmin\endcsname\relax
  \csname newcount\endcsname\righthyphenmin
  \righthyphenmin=3 \fi
%    \end{macrocode}
%
%    \begin{macrocode}
\expandafter\ifx\csname setlanguage\endcsname\relax
  \def\setlanguage{\relax
    \ifhmode \else
      \errhelp{Use \selectlanguage to switch languages.}%
      \errmessage{\setlanguage allowed only in horizontal mode}%
    \fi
    \begingroup\afterassignment\endgroup\count@=}
\fi
%    \end{macrocode}
%
% \subsection{Activating/de-activating the language setting}
%
%    \begin{macrocode}
\begingroup \mDQon
\def\x{\endgroup
  \def\originalTeX{\mDQoff \let"\DQ \umlauthigh
    \let\3\ro@original@three
    \selectlanguage{USenglish}}%
  \def\romanianTeX{\mDQon \let"\@active@DQ \umlautlow
    \setRomanianDQ % \DQ@mode=0
    \let\ro@original@three\3\let\3\ss
    \selectlanguage{romanian}}%
  \def\germanTeX{\mDQon \let"\@active@DQ \umlautlow
    \setGermanDQ   % \DQ@mode=1
    \let\ro@original@three\3\let\3\ss
    \selectlanguage{german}}%
  \def\frenchTeX{\mDQoff \let"\DQ \umlauthigh
    \let\3\ro@original@three
    \selectlanguage{french}}}%
\x
%    \end{macrocode}
%
% The modification job is done. We return to the `public' \TeX{} world
% (by setting |@| to category code `other', from the initially saved 
% |\atcode|):
%
%    \begin{macrocode}
\catcode`\@=\atcode          % restore_previous_category_code_of |@|
%    \end{macrocode}
% and initialize \RomanianTeX{}:
%
%    \begin{macrocode}
\romanianTeX
%    \end{macrocode}
%
%\iffalse
%</!driver>
%\fi
%
% \section{A driver for the macro-code documentation}
%
% The following piece of code should generate the documentation
% of the \RomanianTeX{} macro-code (in \texttt{.dvi}-form), from
% \texttt{romanian.dtx}, if passed through \emph{Romanian} \LaTeXe{}.
%
%    \begin{macrocode}
%<+driver>\ifx\documentclass\undefined % test: LaTeX2e or LaTeX 2.09?
%<+driver>\typeout{^^JUse a Romanian LateX2e installation!}
%<+driver>\typeout{^^JAborting (fake LaTeX 2.09 article):^^J}
%<+driver> \documentstyle[]{article}
%<+driver>\else % do the job with (Romanian) LaTeX2e, if possible:
%<+driver> \documentclass[a4paper]{ltxdoc}
%<+driver> \usepackage{romanian}
%<+driver>\fi
%<+driver>\begin{document}
%<+driver>\ifx\documentclass\undefined \relax % farniente...
%<+driver>\else % do the job, as required:
%<+driver>\DocInput{romanian.dtx}
%<+driver>\fi   % reach an end, anyway:
%<+driver>\end{document}
%    \end{macrocode}
%
% \Finale
\endinput
%% End of file ROMANIAN.DTX