summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/babel/magyar.dtx
blob: febd734ad76b94551f10143bfa3a97197d46fece (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
% \iffalse meta-comment
%
% Copyright 1989-2005 Johannes L. Braams and any individual authors
% listed elsewhere in this file.  All rights reserved.
% 
% This file is part of the Babel system.
% --------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainer of this work is Johannes Braams.
% 
% The list of all files belonging to the Babel system is
% given in the file `manifest.bbl. See also `legal.bbl' for additional
% information.
% 
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
% \CheckSum{1538}
% \iffalse
%    Tell the \LaTeX\ system who we are and write an entry on the
%    transcript.
%<*dtx>
\ProvidesFile{magyar.dtx}
%</dtx>
%<code>\ProvidesLanguage{magyar}
%\fi
%\ProvidesFile{magyar.dtx}
        [2005/03/30 v1.4j Magyar support from the babel system]
%\iffalse
%% File `magyar.dtx'
%% Babel package for LaTeX version 2e
%% Copyright (C) 1989 - 2005
%%           by Johannes Braams, TeXniek
%
%% Magyar Language Definition File
%% Copyright (C) 1989 - 2005
%%           by Johannes Braams, TeXniek
%%              \'Arp\'ad B\'IR\'O
%%              J\'ozsef B\'ERCES
%
% Please report errors to: J.L. Braams babel braams.cistron.nl
%
%    This file is part of the babel system, it provides the source
%    code for the Hungarian language definition file.  A contribution
%    was made by Attila Koppanyi (attila@cernvm.cern.ch).
%<*filedriver>
\documentclass{ltxdoc}
\newcommand*\TeXhax{\TeX hax}
\newcommand*\babel{\textsf{babel}}
\newcommand*\langvar{$\langle \it lang \rangle$}
\newcommand*\note[1]{}
\newcommand*\Lopt[1]{\textsf{#1}}
\newcommand*\file[1]{\texttt{#1}}
\begin{document}
 \DocInput{magyar.dtx}
\end{document}
%</filedriver>
%\fi
% \GetFileInfo{magyar.dtx}
%
% \changes{magyar-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
%    \file{babel.com}}
% \changes{magyar-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
% \changes{magyar-1.1d}{1994/02/08}{Further spelling corrections}
% \changes{magyar-1.1e}{1994/02/09}{Still more spelling corrections}
% \changes{magyar-1.2}{1994/02/27}{Update for \LaTeXe}
% \changes{magyar-1.3c}{1994/06/26}{Removed the use of \cs{filedate}
%    and moved identification after the loading of \file{babel.def}}
% \changes{magyar-1.3g}{1996/07/12}{Replaced \cs{undefined} with
%    \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
%    with \LaTeX}
% \changes{magyar-1.4a}{1998/06/04}{order inverting in
%    headings/titles/captions; definite article handling; active char
%    for special hyphenation}
% \changes{magyar-1.4d}{2001/11/15}{Corrected checksum}
% \changes{magyar-1.4j}{2004/11/17}{Added missing comment characters
%    in the redefinitions of \cs{ps@headings} to prevent spurious
%    spaces} 
%
%  \section{The Hungarian language}
%
%    The file option \file{\filename} defines all the
%    language definition macros for the Hungarian language.
%
%    The \babel{} support for the Hungarian language until file
%    version 1.3i was essentially changing the English document
%    elements to Hungarian ones, but because of the differences
%    between these too languages this was actually unusable (`Part I'
%    was transferred to `R\'esz I' which is not usable instead of `I.\
%    r\'esz'). To enhance the typesetting facilities for Hungarian
%    the following should be considered:
%    \begin{itemize}
%      \item In Hungarian documents there is a period after
%            the part, section, subsection \mbox{etc.} numbers.
%
%      \item In the part, chapter, appendix name the number
%            (or letter) goes before the name, so `Part I' translates to
%            `I.\ r\'esz'.
%
%       \item The same is true with captions
%             (`Table 2.1' goes to `2.1.\ t\'abl\'azat').
%
%       \item There is a period after the caption name instead of a colon.
%             (`Table 2.1:' goes to `2.1.\ t\'abl\'azat.')
%
%       \item There is a period at the end of the title in a run-in head
%             (when |afterskip<0| in |\@startsection|).
%
%       \item Special hyphenation rules must be applied
%             for the so-called long double consonants (ccs, ssz,\dots).
%
%       \item The opening quotation mark is like the German one
%             (the closing is the same as in English).
%
%       \item In Hungarian figure, table, \mbox{etc.}
%             referencing a definite article is also incorporated.
%             The Hungarian definite articles behave like the English
%             indefinite ones (`a/an'). `a' is used for words beginning
%             with a consonant and `az' goes for a vowel.
%             Since some numbers begin with a vowel some others
%             with a consonant some commands should be provided for
%             automatic definite article generation.
%    \end{itemize}
%
%    Until file version 1.3i\footnote{That file was
%    last revised on 1996/12/23 with a contribution by the next
%    authors: Attila Kopp\'anyi (\texttt{attila@cernvm.cern.ch}),
%    \'Arp\'ad B\'{\i}r\'o (\texttt{JZP1104@HUSZEG11.bitnet}),
%    Istv\'an Hamecz (\texttt{hami@ursus.bke.hu)} and
%    Dezs\H{o} Horv\'ath (\texttt{horvath@pisa.infn.it}).} 
%    the special typesetting rules of the Hungarian language
%    mentioned above were not taken into consideration.
%    This version (\fileversion)\footnote{It was written by J\'ozsef
%    B\'erces (\texttt{jozsi@docs4.mht.bme.hu}) with some help from
%    Ferenc Wettl (\texttt{wettl@math.bme.hu}) and an idea from David
%    Carlisle (\texttt{david@dcarlisle.demon.co.uk}).} 
%    enables \babel{} to typeset `good-looking' Hungarian texts.
%
% \DescribeMacro\ontoday
%    The |\ontoday| command works like |\today| but
%    produces a slightly different date format used in expressions such
%    as `on February 10th'.
%
% \DescribeMacro\Az
%    The commands |\Az#1| and |\az#1| write the correct
%    definite article for the argument and the argument itself
%    (separated with a |~|). The star-forms (|\Az*| and |\az*|)
%    produce the article only.
%
% \DescribeMacro\Azr
%    |\Azr#1| and |\azr#1| treat the argument as a label so expand
%    it then write the definite article for |\r@#1|, a non-breakable
%    space then the label expansion. The star-forms do not print
%    the label expansion. |\Azr(#1| and |\azr(#1| are used for
%    equation referencing with the syntax |\azr(|\textit{label}|)|.
%
% \DescribeMacro\Aref
%    There are two aliases |\Aref| and |\aref| for |\Azr| and |\azr|,
%    respectively. During the preparation of a document it is not
%    known in general, if the code `|a~\ref{|\textit{label}|}|' or the code
%    `|az~\ref{|\textit{label}|}|' is the grammatically correct one. Writing
%    `|\aref{|\textit{label}|}|' instead of the previous ones solves the 
%    problem.
%
% \DescribeMacro\Azp
%    |\Azp#1| and |\azp#1| also treat the argument as a label but
%    use the label's page for definite article determination.
%    There are star-forms giving only the definite article without
%    the page number. 
%
% \DescribeMacro\Apageref
%    There are aliases |\Apageref| and |\apageref| for |\Azp| and
%    |\azp|, respectively. The code |\apageref{|\textit{label}|}| 
%    is equivalent either to |a~\pageref{|\textit{label}|}| or 
%    to |az~\pageref{|\textit{label}|}|.
%
% \DescribeMacro\Azc
%    |\Azc| and |\azc| work like the |\cite| command but
%    (of course) they insert the definite article. There can be
%    several comma separated cite labels and in that case the
%    definite article is given for the first one.
%    They accept |\cite|'s optional argument.
%    There are star-forms giving the definite article only.
%
% \DescribeMacro\Acite
%    There are aliases |\Acite| and |\acite| for
%    |\Azc| and |\azc|, respectively. 
%
%    For this language the character |`| is made active.
%    Table~\ref{tab:hun-actives} shows the shortcuts.
%    The main reason for the activation of the |`| character
%    is to handle the special hyphenation of the long double
%    consonants.
%    \begin{table}
%      \begin{center}
%        \begin{tabular}{lp{45mm}p{47mm}}
%          shortcut & explanation & example \\
%          \hline
%          |``|        &  same as |\glqq| in \babel{}, or
%                         |\quotedblbase| in T1 
%                         (opening quotation mark, like ,,) 
%                        & |``id\'ezet''|$\longrightarrow$,,id\'ezet'{}' \\
%          |`c|, |`C|  &  ccs is hyphenated as cs-cs
%                        & |lo`ccsan|$\longrightarrow$locs-csan \\
%          |`d|, |`D|  &  ddz is hyphenated as dz-dz
%                        & |e`ddz\"unk|$\longrightarrow$edz-dz\"unk \\
%          |`g|, |`G|  &  ggy is hyphenated as gy-gy
%                        & |po`ggy\'asz|$\longrightarrow$pogy-gy\'asz \\
%          |`l|, |`L|  &  lly is hyphenated as ly-ly
%                        & |Kod\'a`llyal|$\longrightarrow$Kod\'aly-lyal \\
%          |`n|, |`N|  &  nny is hyphenated as ny-ny
%                        & |me`nnyei|$\longrightarrow$meny-nyei \\
%          |`s|, |`S|  &  ssz is hyphenated as sz-sz
%                        & |vi`ssza|$\longrightarrow$visz-sza \\
%          |`t|, |`T|  &  tty is hyphenated as ty-ty
%                        & |po`ttyan|$\longrightarrow$poty-tyan \\
%          |`z|, |`Z|  &  zzs is hyphenated as zs-zs
%                        & |ri`zzsel|$\longrightarrow$rizs-zsel \\
%        \end{tabular}
%        \caption{The shortcuts defined in \file{magyar.ldf}}
%        \label{tab:hun-actives}
%      \end{center}
%    \end{table}
%
%
% \StopEventually{}
%
%    The macro |\LdfInit| takes care of preventing that this file is
%    loaded more than once, checking the category code of the
%    \texttt{@} sign, etc.
% \changes{magyar-1.3h}{1996/11/03}{Now use \cs{LdfInit} to perform
%    initial checks}
%    \begin{macrocode}
%<*code>
\LdfInit{magyar}{caption\CurrentOption}
%    \end{macrocode}
%
%    When this file is read as an option, i.e. by the |\usepackage|
%    command, \texttt{magyar} will be an `unknown' language in which
%    case we have to make it known.  So we check for the existence of
%    |\l@magyar| or |\l@hungarian| to see whether we have to do
%    something here.
%
% \changes{magyar-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
% \changes{magyar-1.1}{1992/02/16}{Added a warning when no hyphenation
%    patterns were loaded.}
% \changes{magyar-1.3c}{1994/06/26}{Now use \cs{@nopatterns} to
%    produce the warning}
% \changes{magyar-1.4d}{2003/09/18}{The \cs{else} clause got outside
%    of the \cs{if} statement, breaking the Hungarian support}
% \changes{magyar-1.4g}{2003/10/07}{Further change to make it work
%    when neither \cs{l@magyar} nor \cs{l@hugarian} are defined}
%    \begin{macrocode}
\ifx\l@magyar\@undefined
  \ifx\l@hungarian\@undefined
    \@nopatterns{Magyar}
    \adddialect\l@magyar0
  \else
    \let\l@magyar\l@hungarian
  \fi
\fi
%    \end{macrocode}
%    The statement above makes sure that |\l@magyar| is always
%    defined; if |\l@hungarian| is still undefined we make it equal to
%    |\l@magyar|. 
%    \begin{macrocode}
\ifx\l@hungarian\@undefined
  \let\l@hungarian\l@magyar
\fi
%    \end{macrocode}
%
%    The next step consists of defining commands to switch to (and
%    from) the Hungarian language.
%
% \begin{macro}{\captionsmagyar}
%    The macro |\captionsmagyar| defines all strings used in the four
%    standard document classes provided with \LaTeX.
% \changes{magyar-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
%    and \cs{prefacename}}
% \changes{magyar-1.1}{1993/07/15}{\cs{headpagename} should be
%    \cs{pagename}}
% \changes{magyar-1.1c}{1994/01/05}{Added translations, fixed typos}
% \changes{magyar-1.3e}{1995/07/04}{Added \cs{proofname} for
%    AMS-\LaTeX}
% \changes{magyar-1.3f}{1996/04/18}{translated Proof and replaced some
%    translations}
% \changes{magyar-1.4a}{1998/06/04}{the initial letter of fejezet,
%    t\'abl\'azat, r\'esz, l\'asd changed to lowercase}
%    \begin{macrocode}
\@namedef{captions\CurrentOption}{%
  \def\prefacename{El\H osz\'o}%
%    \end{macrocode}
%    For the list of references at the end of an article we have a
%    choice between two words, `Referenci\'ak' (a Hungarian version of
%    the English word) and `Hivatkoz\'asok'. The latter seems to
%    be in more widespread use.
%    \begin{macrocode}
  \def\refname{Hivatkoz\'asok}%
%    \end{macrocode}
%    If you have a document with a summary instead of an abstract you
%    might want to replace the word `Kivonat' with
%    `\"Osszefoglal\'o'.
%    \begin{macrocode}
  \def\abstractname{Kivonat}%
%    \end{macrocode}
%    The Hungarian version of `Bibliography' is `Bibliogr\'afia', but
%    a more natural word to use is `Irodalomjegyz\'ek'.
%    \begin{macrocode}
  \def\bibname{Irodalomjegyz\'ek}%
  \def\chaptername{fejezet}%
  \def\appendixname{F\"uggel\'ek}%
  \def\contentsname{Tartalomjegyz\'ek}%
  \def\listfigurename{\'Abr\'ak jegyz\'eke}%
  \def\listtablename{T\'abl\'azatok jegyz\'eke}%
  \def\indexname{T\'argymutat\'o}%
  \def\figurename{\'abra}%
  \def\tablename{t\'abl\'azat}%
  \def\partname{r\'esz}%
  \def\enclname{Mell\'eklet}%
  \def\ccname{K\"orlev\'el--c\'\i mzettek}%
  \def\headtoname{C\'\i mzett}%
  \def\pagename{oldal}%
  \def\seename{l\'asd}%
  \def\alsoname{l\'asd m\'eg}%
%    \end{macrocode}
%    Besides the Hungarian word for Proof, `Bizony\'\i t\'as' we can
%    also name Corollary (K\"ovetkezm\'eny), Theorem (T\'etel) and
%    Lemma (Lemma).
% \changes{magyar-1.4b}{2000/09/20}{Added \cs{glossaryname}}
% \changes{magyar-1.4h}{2003/11/20}{Inserted translation for Glossary} 
%    \begin{macrocode}
  \def\proofname{Bizony\'\i t\'as}%
  \def\glossaryname{Sz\'ojegyz\'ek}%
  }%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\datemagyar}
%    The macro |\datemagyar| redefines the command |\today| to produce
%    Hungarian dates.
% \changes{magyar-1.1d}{1994/02/08}{Rewritten to produce the correct
%    date format}
% \changes{magyar-1.4a}{1998/06/10}{Use \cs{number}\cs{day} instead of
%    \cs{ifcase} construct}
%    \begin{macrocode}
\@namedef{date\CurrentOption}{%
  \def\today{%
    \number\year.\nobreakspace\ifcase\month\or
    janu\'ar\or febru\'ar\or m\'arcius\or
    \'aprilis\or m\'ajus\or j\'unius\or
    j\'ulius\or augusztus\or szeptember\or
    okt\'ober\or november\or december\fi
    \space\number\day.}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ondatemagyar}
%    The macro |\ondatemagyar| produces Hungarian dates which have the
%    meaning `\emph{on this day}'.  It does not redefine the command
%    |\today|.
% \changes{magyar-1.1c}{1994/01/05}{The date number should not be
%    followed by a dot.}
% \changes{magyar-1.1d}{1994/02/08}{Renamed from \cs{datemagyar};
%    nolonger redefines \cs{today}.}
%    \begin{macrocode}
\@namedef{ondate\CurrentOption}{%
  \number\year.\nobreakspace\ifcase\month\or
  janu\'ar\or febru\'ar\or m\'arcius\or
  \'aprilis\or m\'ajus\or j\'unius\or
  j\'ulius\or augusztus\or szeptember\or
  okt\'ober\or november\or december\fi
    \space\ifcase\day\or
    1-j\'en\or  2-\'an\or  3-\'an\or  4-\'en\or  5-\'en\or
    6-\'an\or  7-\'en\or  8-\'an\or  9-\'en\or 10-\'en\or
   11-\'en\or 12-\'en\or 13-\'an\or 14-\'en\or 15-\'en\or
   16-\'an\or 17-\'en\or 18-\'an\or 19-\'en\or 20-\'an\or
   21-\'en\or 22-\'en\or 23-\'an\or 24-\'en\or 25-\'en\or
   26-\'an\or 27-\'en\or 28-\'an\or 29-\'en\or 30-\'an\or
   31-\'en\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\extrasmagyar}
% \begin{macro}{\noextrasmagyar}
%    The macro |\extrasmagyar| will perform all the extra definitions
%    needed for the Hungarian language. The macro |\noextrasmagyar| is
%    used to cancel the actions of |\extrasmagyar|.
%
%    \begin{macrocode}
 \@namedef{extras\CurrentOption}{%
   \expandafter\let\expandafter\ontoday
     \csname ondate\CurrentOption\endcsname}
\@namedef{noextras\CurrentOption}{\let\ontoday\@undefined}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    Now we redefine some commands included into \file{latex.ltx}.
%    The original form of a command is always saved with
%    |\babel@save| and the changes are added to |\extrasmagyar|.
%    This ensures that the Hungarian version of a macro is alive
%    \emph{only} if the Hungarian language is active.
%
% \begin{macro}{\fnum@figure}
% \begin{macro}{\fnum@table}
%    In figure and table captions the order of the figure/table
%    number and |\figurename|\hspace{0pt}/|\tablename| must be changed.
%    To achieve this |\fnum@figure| and |\fnum@table| are
%    redefined and added to |\extrasmagyar|.
% \changes{magyar-1.4i}{2004/02/20}{Use \cs{nobreakspace} instead of
%    tilde}
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\fnum@figure
  \def\fnum@figure{\thefigure.\nobreakspace\figurename}}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\fnum@table
  \def\fnum@table{\thetable.\nobreakspace\tablename}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@makecaption}
%    The colon in a figure/table caption must be replaced by a dot
%    by redefining |\@makecaption|.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@makecaption
  \def\@makecaption#1#2{%
    \vskip\abovecaptionskip
    \sbox\@tempboxa{#1. #2}%
    \ifdim \wd\@tempboxa >\hsize
      {#1. #2\csname par\endcsname}
    \else
      \global \@minipagefalse
      \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \fi
    \vskip\belowcaptionskip}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@caption}
%    There should be a dot after the figure/table number in lof/lot,
%    so |\@caption| is redefined.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@caption
  \long\def\@caption#1[#2]#3{%
    \csname par\endcsname
    \addcontentsline{\csname ext@#1\endcsname}{#1}%
      {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
    \begingroup
      \@parboxrestore
      \if@minipage
        \@setminipage
      \fi
      \normalsize
      \@makecaption{\csname fnum@#1\endcsname}%
          {\ignorespaces #3}\csname par\endcsname
    \endgroup}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@seccntformat}
%    In order to have a dot after the section number
%    |\@seccntformat| is redefined.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@seccntformat
  \def\@seccntformat#1{\csname the#1\endcsname.\quad}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@sect}
%    Alas, |\@sect| must also be redefined to have that dot in toc too.
%    On the other hand, we include a dot after a run-in head.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@sect
  \def\@sect#1#2#3#4#5#6[#7]#8{%
    \ifnum #2>\c@secnumdepth
      \let\@svsec\@empty
    \else
      \refstepcounter{#1}%
      \protected@edef\@svsec{\@seccntformat{#1}\relax}%
    \fi
    \@tempskipa #5\relax
    \ifdim \@tempskipa>\z@
      \begingroup
        #6{%
          \@hangfrom{\hskip #3\relax\@svsec}%
            \interlinepenalty \@M #8\@@par}%
      \endgroup
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\csname the#1\endcsname.}%
        \fi
        #7}%
    \else
      \def\@svsechd{%
        #6{\hskip #3\relax
        \@svsec #8.}%
        \csname #1mark\endcsname{#7}%
        \addcontentsline{toc}{#1}{%
          \ifnum #2>\c@secnumdepth \else
            \protect\numberline{\csname the#1\endcsname.}%
          \fi
          #7}}%
    \fi
    \@xsect{#5}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@ssect}
%    In order to have that dot after a run-in head when the star form of the
%    sectioning commands is used, we have to redefine |\@ssect|.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@ssect
  \def\@ssect#1#2#3#4#5{%
    \@tempskipa #3\relax
    \ifdim \@tempskipa>\z@
      \begingroup
        #4{%
          \@hangfrom{\hskip #1}%
            \interlinepenalty \@M #5\@@par}%
      \endgroup
    \else
      \def\@svsechd{#4{\hskip #1\relax #5.}}%
    \fi
    \@xsect{#3}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@begintheorem}
% \begin{macro}{\@opargbegintheorem}
%    Order changing and dot insertion in theorem by redefining
%    |\@begintheorem| and |\@opargbegintheorem|.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\@begintheorem
  \def\@begintheorem#1#2{\trivlist
    \item[\hskip \labelsep{\bfseries #2.\ #1.}]\itshape}%
  \babel@save\@opargbegintheorem
  \def\@opargbegintheorem#1#2#3{\trivlist
    \item[\hskip \labelsep{\bfseries #2.\ #1\ (#3).}]\itshape}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    The next step is to redefine some macros included into the
%    class files. It is determined which class file is loaded
%    then the original form of the macro is saved and the changes
%    are added to |\extrasmagyar|.
%
%    First we check if the \file{book.cls} is loaded.
%    \begin{macrocode}
\@ifclassloaded{book}{%
%    \end{macrocode}
% \begin{macro}{\ps@headings}
%    The look of the headings is changed: we have to insert some dots
%    and change the order of chapter number and |\chaptername|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\ps@headings}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \if@twoside
      \def\ps@headings{%
          \let\@oddfoot\@empty\let\@evenfoot\@empty
          \def\@evenhead{\thepage\hfil\slshape\leftmark}%
          \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
          \let\@mkboth\markboth
        \def\chaptermark##1{%
          \markboth {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne
              \if@mainmatter
                \thechapter. \@chapapp. \ %
              \fi
            \fi
            ##1}}{}}%
        \def\sectionmark##1{%
          \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\z@
              \thesection. \ %
            \fi
            ##1}}}}%
    \else
      \def\ps@headings{%
        \let\@oddfoot\@empty
        \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
        \let\@mkboth\markboth
        \def\chaptermark##1{%
          \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne
              \if@mainmatter
                \thechapter. \@chapapp. \ %
              \fi
            \fi
            ##1}}}}%
    \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@part}
%    At the beginning of a part we need \mbox{eg.} `I.\ r\'esz'
%    instead of `Part I' (in toc too).
%    To achieve this |\@part| is redefined.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\@part
    \def\@part[#1]#2{%
        \ifnum \c@secnumdepth >-2\relax
          \refstepcounter{part}%
          \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
        \else
          \addcontentsline{toc}{part}{#1}%
        \fi
        \markboth{}{}%
        {\centering
         \interlinepenalty \@M
         \normalfont
         \ifnum \c@secnumdepth >-2\relax
           \huge\bfseries \thepart.\nobreakspace\partname
           \csname par\endcsname
           \vskip 20\p@
         \fi
         \Huge \bfseries #2\csname par\endcsname}%
        \@endpart}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@chapter}
%    The same changes are made to chapter.
%    First the screen typeout and the toc are changed by
%    redefining |\@chapter|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\@chapter
    \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                           \if@mainmatter
                             \refstepcounter{chapter}%
                             \typeout{\thechapter.\space\@chapapp.}%
                             \addcontentsline{toc}{chapter}%
                                       {\protect\numberline{\thechapter.}#1}%
                           \else
                             \addcontentsline{toc}{chapter}{#1}%
                           \fi
                        \else
                          \addcontentsline{toc}{chapter}{#1}%
                        \fi
                        \chaptermark{#1}%
                        \addtocontents{lof}{\protect\addvspace{10\p@}}%
                        \addtocontents{lot}{\protect\addvspace{10\p@}}%
                        \if@twocolumn
                          \@topnewpage[\@makechapterhead{#2}]%
                        \else
                          \@makechapterhead{#2}%
                          \@afterheading
                        \fi}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@makechapterhead}
%    Then the look of the chapter-start is modified by redefining
%    |\@makechapterhead|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\@makechapterhead
    \def\@makechapterhead#1{%
      \vspace*{50\p@}%
      {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \huge\bfseries \thechapter.\nobreakspace\@chapapp{}
            \csname par\endcsname\nobreak
            \vskip 20\p@
          \fi
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\csname par\endcsname\nobreak
        \vskip 40\p@
      }}}%
%    \end{macrocode}
% \end{macro}
%    This the end of the book class modification.
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
%    Now we check if \file{report.cls} is loaded.
%    \begin{macrocode}
\@ifclassloaded{report}{%
%    \end{macrocode}
% \begin{macro}{\ps@headings}
%    First the headings are modified just in case of the book class.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\ps@headings}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \if@twoside
      \def\ps@headings{%
          \let\@oddfoot\@empty\let\@evenfoot\@empty
          \def\@evenhead{\thepage\hfil\slshape\leftmark}%
          \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
          \let\@mkboth\markboth
        \def\chaptermark##1{%
          \markboth {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne
                \thechapter. \@chapapp. \ %
            \fi
            ##1}}{}}%
        \def\sectionmark##1{%
          \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\z@
              \thesection. \ %
            \fi
            ##1}}}}%
    \else
      \def\ps@headings{%
        \let\@oddfoot\@empty
        \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
        \let\@mkboth\markboth
        \def\chaptermark##1{%
          \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne
                \thechapter. \@chapapp. \ %
            \fi
            ##1}}}}%
    \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@chapter}
%    Chapter-start modification with |\@chapter|
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\@chapter
    \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                             \refstepcounter{chapter}%
                             \typeout{\thechapter.\space\@chapapp.}%
                             \addcontentsline{toc}{chapter}%
                                       {\protect\numberline{\thechapter.}#1}%
                        \else
                          \addcontentsline{toc}{chapter}{#1}%
                        \fi
                        \chaptermark{#1}%
                        \addtocontents{lof}{\protect\addvspace{10\p@}}%
                        \addtocontents{lot}{\protect\addvspace{10\p@}}%
                        \if@twocolumn
                          \@topnewpage[\@makechapterhead{#2}]%
                        \else
                          \@makechapterhead{#2}%
                          \@afterheading
                        \fi}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@makechapterhead}
%    and |\@makechapterhead|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\@makechapterhead
    \def\@makechapterhead#1{%
      \vspace*{50\p@}%
      {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
            \huge\bfseries \thechapter.\nobreakspace\@chapapp{}
            \csname par\endcsname\nobreak
            \vskip 20\p@
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\csname par\endcsname\nobreak
        \vskip 40\p@
      }}}%
%    \end{macrocode}
% \end{macro}
%    End of report class modification.
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
%    Checking if \file{article.cls} is loaded.
%    \begin{macrocode}
\@ifclassloaded{article}{%
%    \end{macrocode}
% \begin{macro}{\ps@headings}
%    Changing headings by redefining |\ps@headings|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\ps@headings}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \if@twoside
      \def\ps@headings{%
          \let\@oddfoot\@empty\let\@evenfoot\@empty
          \def\@evenhead{\thepage\hfil\slshape\leftmark}%
          \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
          \let\@mkboth\markboth
        \def\sectionmark##1{%
          \markboth {\MakeUppercase{%
            \ifnum \c@secnumdepth >\z@
              \thesection.\quad
            \fi
            ##1}}{}}%
        \def\subsectionmark##1{%
          \markright {%
            \ifnum \c@secnumdepth >\@ne
              \thesubsection.\quad
            \fi
            ##1}}}%
    \else
      \def\ps@headings{%
        \let\@oddfoot\@empty
        \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
        \let\@mkboth\markboth
        \def\sectionmark##1{%
          \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne
              \thesection.\quad
            \fi
            ##1}}}}%
    \fi}%
%    \end{macrocode}
% \end{macro}
%    No more necessary changes specific to the article class.
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
%    And now this is the turn of \file{letter.cls}.
%    \begin{macrocode}
\@ifclassloaded{letter}{%
%    \end{macrocode}
% \begin{macro}{\ps@headings}
%    In the headings the page number must be followed by a dot
%    and then |\pagename|.
%    \begin{macrocode}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \babel@save\ps@headings}
  \expandafter\addto\csname extras\CurrentOption\endcsname{%
    \if@twoside
      \def\ps@headings{%
          \let\@oddfoot\@empty\let\@evenfoot\@empty
          \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
                        \hfil \@date
                        \hfil \thepage.\nobreakspace\pagename}%
          \let\@evenhead\@oddhead}
    \else
      \def\ps@headings{%
          \let\@oddfoot\@empty
          \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
                        \hfil \@date
                        \hfil \thepage.\nobreakspace\pagename}}
    \fi}%
%    \end{macrocode}
% \end{macro}
%    End of letter class.
%    \begin{macrocode}
}{}
%    \end{macrocode}
%
%    After making the changes to the \LaTeX{}
%    macros we define some new ones to handle the problem
%    with definite articles.
% \begin{macro}{\az}
%    |\az| is a user-level command which decides if the next
%    character is a star. |\@az| is called for |\az*| and
%    |\az@| for |\az|.
%    \begin{macrocode}
\def\az{a\@ifstar{\@az}{\az@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Az}
%    |\Az| is used at the beginning of a sentence. Otherwise it behaves
%    the same as |\az|.
%    \begin{macrocode}
\def\Az{A\@ifstar{\@az}{\az@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\az@}
%    |\az@| is called if there is no star after |\az| or |\Az|.
%    It calls |\@az| and writes |#1| separating with a non-breakable
%    space.
%    \begin{macrocode}
\def\az@#1{\@az{#1}\nobreakspace#1}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@az}
%    This macro calls |\hun@tempadef| to remove the accents from
%    the argument then calls |\@@az| that determines if a `z'
%    should be written after a/A (written by |\az|/|\Az|).
%    \begin{macrocode}
\def\@az#1{%
  \hun@tempadef{relax}{relax}{#1}%
  \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
  \@tempb}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hun@tempadef}
%    The macro |\hun@tempadef| has three tasks:
%    \begin{itemize}
%      \item Accent removal. Accented letters confuse
%            |\@@az|, the main definite article determinator
%            macro, so they must be changed to their non-accented
%            counterparts. Special letters must also be changed,
%            \mbox{eg.} \oe$\,\rightarrow\,$o.
%      \item Labels must be expanded.
%      \item To handle Roman numerals correctly, commands starting
%            with |\hun@| are defined for labels containing Roman
%            numbers with the Roman numerals
%            replaced by their Arabic representation.
%            This macro can check if there is a |\hun@| command.
%    \end{itemize}
%    There are three arguments:
%    \begin{enumerate}
%      \item The primary command that should be expanded if it exists.
%            This is usually the |\hun@| command for a label.
%      \item The secondary command which is used if the first one
%            is |\relax|. This is usually the original \LaTeX{}
%            command for a label.
%      \item This is used if the first two is |\relax|. For this one
%            no expansion is carried out but the accents are still
%            removed and special letters are changed.
%    \end{enumerate}
% \changes{magyar-1.4f}{2003/09/29}{Added
%    \cs{def}\cs{safe@activesfalse{}} as a fix for PR3426} 
%    \begin{macrocode}
\def\hun@tempadef#1#2#3{%
  \begingroup
    \def\@safe@activesfalse{}%
    \def\setbox ##1{}% to get rid of accents and special letters
    \def\hbox ##1{}%
    \def\accent ##1 ##2{##2}%
    \def\add@accent ##1##2{##2}%
    \def\@text@composite@x ##1##2{##2}%
    \def\i{i}\def\j{j}%
    \def\ae{a}\def\AE{A}\def\oe{o}\def\OE{O}%
    \def\ss{s}\def\L{L}%
    \def\d{}\def\b{}\def\c{}\def\t{}%
    \expandafter\ifx\csname #1\endcsname\relax
      \expandafter\ifx\csname #2\endcsname\relax
        \xdef\@tempa{#3}%
      \else
        \xdef\@tempa{\csname #2\endcsname}%
      \fi
    \else
      \xdef\@tempa{\csname #1\endcsname}%
    \fi
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
%    The following macros are used to determine the definite
%    article for a label's expansion.
% \begin{macro}{\aref}
%    |\aref| is an alias for |\azr|.
%    \begin{macrocode}
\def\aref{\azr}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Aref}
%    |\Aref| is an alias for |\Azr|.
%    \begin{macrocode}
\def\Aref{\Azr}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azr}
%    |\azr| calls |\@azr| if the next character is a star,
%    otherwise it calls |\azr@|.
%    \begin{macrocode}
\def\azr{a\@ifstar{\@azr}{\azr@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Azr}
%    |\Azr| is the same as |\azr| except that it writes `A'
%    instead of `a'.
%    \begin{macrocode}
\def\Azr{A\@ifstar{\@azr}{\azr@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azr@}
%    |\azr@| decides if the next character is |(| and
%    in that case it calls |\azr@@@| which writes an extra |(|
%    for equation referencing. Otherwise |\azr@@| is called.
%    \begin{macrocode}
\def\azr@{\@ifnextchar ({\azr@@@}{\azr@@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azr@@}
%    Calls |\@azr| then writes the label's expansion preceded by
%    a non-breakable space.
%    \begin{macrocode}
\def\azr@@#1{\@azr{#1}\nobreakspace\ref{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azr@@@}
%    Same as |\azr@@| but inserts a |(| between the
%    non-breakable space and the label expansion.
%    \begin{macrocode}
\def\azr@@@(#1{\@azr{#1}\nobreakspace(\ref{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@azr}
%    Calls |\hun@tempadef| to choose between the label's
%    |\hun@| or original \LaTeX{} command and to expand
%    it with accent removal and special letter substitution.
%    Then calls |\@@az|, the core macro of definite article handling.
%    \begin{macrocode}
\def\@azr#1{%
  \hun@tempadef{hun@r@#1}{r@#1}{}%
  \ifx\@tempa\empty
  \else
    \edef\@tempb{\noexpand\@@az\expandafter\@firstoftwo\@tempa\hbox!}%
    \@tempb
  \fi
}
%    \end{macrocode}
% \end{macro}
%
%    The following commands are used to generate the definite article
%    for the page number of a label.
% \begin{macro}{\apageref}
%    |\apageref| is an alias for |\azp|.
%    \begin{macrocode}
\def\apageref{\azp}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Apageref}
%    |\Apageref| is an alias for |\Azp|.
%    \begin{macrocode}
\def\Apageref{\Azp}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azp}
%    Checks if the next character is |*| and calls
%    |\@azp| or |\azp@|.
%    \begin{macrocode}
\def\azp{a\@ifstar{\@azp}{\azp@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Azp}
%    Same as |\azp| except that it writes `A' instead of `a'.
%    \begin{macrocode}
\def\Azp{A\@ifstar{\@azp}{\azp@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azp@}
%    Calls |\@azp| then writes the label's page preceded by
%    a non-breakable space.
%    \begin{macrocode}
\def\azp@#1{\@azp{#1}\nobreakspace\pageref{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@azp}
%    Calls |\hun@tempadef| then takes the label's page and passes
%    it to |\@@az|.
%    \begin{macrocode}
\def\@azp#1{%
  \hun@tempadef{hun@r@#1}{r@#1}{}%
  \ifx\@tempa\empty
  \else
    \edef\@tempb{\noexpand\@@az\expandafter\@secondoftwo\@tempa\hbox!}%
    \@tempb
  \fi
}
%    \end{macrocode}
% \end{macro}
%
%    The following macros are used to give the definite article to
%    citations.
% \begin{macro}{\acite}
%    This is an alias for |\azc|.
%    \begin{macrocode}
\def\acite{\azc}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Acite}
%    This is an alias for |\Azc|.
%    \begin{macrocode}
\def\Acite{\Azc}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azc}
%    Checks if the next character is a star and
%    calls |\@azc| or |\azc@|.
%    \begin{macrocode}
\def\azc{a\@ifstar{\@azc}{\azc@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Azc}
%    Same as |\azc| but used at the beginning of sentences.
%    \begin{macrocode}
\def\Azc{A\@ifstar{\@azc}{\azc@}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azc@}
%    If there is no star we accept an optional argument,
%    just like the |\cite| command.
%    \begin{macrocode}
\def\azc@{\@ifnextchar [{\azc@@}{\azc@@[]}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\azc@@}
%    First calls |\@azc| then |\cite|.
%    \begin{macrocode}
\def\azc@@[#1]#2{%
  \@azc{#2}\nobreakspace\def\@tempa{#1}%
    \ifx\@tempa\@empty\cite{#2}\else\cite[#1]{#2}\fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@azc}
%    This is an auxiliary macro to get the first cite label
%    from a comma-separated list.
%    \begin{macrocode}
\def\@azc#1{\@@azc#1,\hbox!}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@azc}
%    This one uses only the first argument, that is the first
%    element of the comma-separated list of cite labels.
%    Calls |\hun@tempadef| to expand the cite label with accent
%    removal and special letter replacement.
%    Then |\@@az|, the core macro, is called.
%    \begin{macrocode}
\def\@@azc#1,#2\hbox#3!{%
  \hun@tempadef{hun@b@#1}{b@#1}{}%
  \ifx\@tempa\empty
  \else
    \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
    \@tempb
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hun@number@lehgth}
%    This macro is used to count the number of digits in its
%    argument until a non-digit character is found or
%    the end of the argument is reached.
%    It must be called as
%    |\hun@number@lehgth|\textit{arg}|\hbox\hbox!| and
%    |\count@| must be zeroed.
%    It is called by |\@@az|.
%    \begin{macrocode}
\def\hun@number@lehgth#1#2\hbox#3!{%
  \ifcat\noexpand#11%
    \ifnum\expandafter`\csname#1\endcsname>47
      \ifnum\expandafter`\csname#1\endcsname<58
        \advance\count@ by \@ne
        \hun@number@lehgth#2\hbox\hbox!\fi\fi\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hun@alph@lehgth}
%    This is used to count the number of letters until a
%    non-letter is found or the end of the argument is reached.
%    It must be called as
%    |\hun@alph@lehgth|\textit{arg}|\hbox\hbox!| and
%    |\count@| must be set to zero.
%    It is called by |\@@az@string|.
%    \begin{macrocode}
\def\hun@alph@lehgth#1#2\hbox#3!{%
  \ifcat\noexpand#1A%
    \advance\count@ by \@ne
    \hun@alph@lehgth#2\hbox\hbox!\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@az@string}
%    This macro is called by |\@@az| if the argument begins
%    with a letter.
%    The task of |\@@az@string| is to determine if the argument
%    starts with a vowel and in that case |\let\@tempa\@tempb|.
%    After checking if the first letter is A, E, I, O, or U,
%    |\hun@alph@lehgth| is called
%    to determine the length of the argument. If it gives 1
%    (that is the argument is a single-letter one or the second
%    character is not letter) then the letters L, M, N, R, S, X, and Y
%    are also considered as a vowel since their Hungarian pronounced
%    name starts with a vowel.
%    \begin{macrocode}
\def\@@az@string#1#2{%
  \ifx#1A%
    \let\@tempa\@tempb
  \else\ifx#1E%
    \let\@tempa\@tempb
  \else\ifx#1I%
    \let\@tempa\@tempb
  \else\ifx#1O%
    \let\@tempa\@tempb
  \else\ifx#1U%
    \let\@tempa\@tempb
  \fi\fi\fi\fi\fi
  \ifx\@tempa\@tempb
  \else
    \count@\z@
    \hun@alph@lehgth#1#2\hbox\hbox!%
    \ifnum\count@=\@ne
      \ifx#1F%
        \let\@tempa\@tempb
      \else\ifx#1L%
        \let\@tempa\@tempb
      \else\ifx#1M%
        \let\@tempa\@tempb
      \else\ifx#1N%
        \let\@tempa\@tempb
      \else\ifx#1R%
        \let\@tempa\@tempb
      \else\ifx#1S%
        \let\@tempa\@tempb
      \else\ifx#1X%
        \let\@tempa\@tempb
      \else\ifx#1Y%
        \let\@tempa\@tempb
      \fi\fi\fi\fi\fi\fi\fi\fi
    \fi
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@az}
%    This macro is the core of definite article handling.
%    It determines if the argument needs `az' or `a' definite
%    article by setting |\@tempa| to `z' or |\@empty|.
%    It sets |\@tempa| to `z' if
%    \begin{itemize}
%      \item the first character of the argument is 5; or
%      \item the first character of the argument is 1 and
%            the $\mathit{length\ of\ the\ number} \pmod 3 = 1$
%            (one--egy, thousand--ezer, million--egymilli\'o,\dots); or
%      \item the first character of the argument is
%            a, A, e, E, i, I, o, O, u, or U; or
%      \item the first character of the argument is
%            l, L, m, M, n, N, r, R, s, S, x, X, y, or Y
%            and the length of the argument is 1 or the second
%            character is a non-letter.
%    \end{itemize}
%    At the end it calls |\@tempa|, that is, it either typesets a `z'
%    or nothing.
%    \begin{macrocode}
\def\@@az#1#2\hbox#3!{%
  \let\@tempa\@empty
  \def\@tempb{z}%
  \uppercase{%
    \ifx5#1%
      \let\@tempa\@tempb
    \else\ifx1#1%
      \count@\@ne
      \hun@number@lehgth#2\hbox\hbox!%
      \loop
      \ifnum\count@>\thr@@
        \advance\count@-\thr@@
      \repeat
      \ifnum\count@=\@ne
        \let\@tempa\@tempb
      \fi
    \else
      \@@az@string{#1}{#2}%
    \fi\fi
  }%
  \@tempa}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\refstepcounter}
%    |\refstepcounter| must be redefined in order to keep
%    |\@currentlabel| unexpanded. This is necessary to enable
%    the |\label| command to write a |\hunnewlabel| command
%    to the aux file with the Roman numerals substituted by
%    their Arabic representations.
%    Of course, the original definition of |\refstepcounter| is
%    saved and restored if the Hungarian language is switched off.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \babel@save\refstepcounter
  \def\refstepcounter#1{\stepcounter{#1}%
    \def\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\label}
%    |\label| is redefined to write another line into the aux
%    file: |\hunnewlabel{ }{ }| where the Roman numerals
%    are replaced their Arabic representations.
%    The original definition of |\label| is saved into
%    |\old@label| and it is also called by |\label|.
%    On leaving the Hungarian typesetting mode |\label|'s
%    original is restored since it is added to |\noextrasmagyar|.
%    \begin{macrocode}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \let\old@label\label
  \def\label#1{\@bsphack
    \old@label{#1}%
    \begingroup
      \let\romannumeral\number
      \def\@roman##1{\number ##1}%
      \def\@Roman##1{\number ##1}%
      {\toks0={\noexpand\noexpand\noexpand\number}%
        \def\number##1{\the\toks0 ##1}\xdef\tempb@{\thepage}}%
      \edef\@tempa##1{\noexpand\protected@write\@auxout{}%
           {\noexpand\string\noexpand\hunnewlabel
           {##1}{{\@currentlabel}{\tempb@}}}}%
      \@tempa{#1}%
    \endgroup
  \@esphack}%
}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
  \let\label\old@label
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hunnewlabel}
%    Finally, |\hunnewlabel| is defined.
%    It checks if the label's expansion (|#2|) differs from that
%    one given in the |\newlabel| command. If yes
%    (that is, the label contains some Roman numerals),
%    it defines the macro |\hun@r@|\textit{label},
%    otherwise it does nothing.
%    \begin{macrocode}
\def\hunnewlabel#1#2{%
  \def\@tempa{#2}%
  \expandafter\ifx\csname r@#1\endcsname\@tempa
    \relax% \message{No need for def: #1}%
  \else
    \global\expandafter\let\csname hun@r@#1\endcsname\@tempa%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
%    For Hungarian the |`| character is made active.
% \changes{magyar-1.4c}{2001/03/05}{Make sure that the grave accent
%    has catcode 12 \emph{before} it is made \cs{active}}
%    \begin{macrocode}
\AtBeginDocument{%
  \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
\initiate@active@char{`}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
  \languageshorthands{magyar}%
  \bbl@activate{`}}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
  \bbl@deactivate{`}}
%    \end{macrocode}
%
%    The character sequence |``| is declared as a shorthand
%    in order to produce
%    the opening quotation sign appropriate for Hungarian.
%    \begin{macrocode}
\declare@shorthand{magyar}{``}{\glqq}
%    \end{macrocode}
%
% In Hungarian there are some long double consonants which
% must be hyphenated specially.
% For all these long double consonants (except dzzs, that is
% extremely very-very rare) a shortcut is defined.
%    \begin{macrocode}
\declare@shorthand{magyar}{`c}{\textormath{\bbl@disc{c}{cs}}{c}}
\declare@shorthand{magyar}{`C}{\textormath{\bbl@disc{C}{CS}}{C}}
\declare@shorthand{magyar}{`d}{\textormath{\bbl@disc{d}{dz}}{d}}
\declare@shorthand{magyar}{`D}{\textormath{\bbl@disc{D}{DZ}}{D}}
\declare@shorthand{magyar}{`g}{\textormath{\bbl@disc{g}{gy}}{g}}
\declare@shorthand{magyar}{`G}{\textormath{\bbl@disc{G}{GY}}{G}}
\declare@shorthand{magyar}{`l}{\textormath{\bbl@disc{l}{ly}}{l}}
\declare@shorthand{magyar}{`L}{\textormath{\bbl@disc{L}{LY}}{L}}
\declare@shorthand{magyar}{`n}{\textormath{\bbl@disc{n}{ny}}{n}}
\declare@shorthand{magyar}{`N}{\textormath{\bbl@disc{N}{NY}}{N}}
\declare@shorthand{magyar}{`s}{\textormath{\bbl@disc{s}{sz}}{s}}
\declare@shorthand{magyar}{`S}{\textormath{\bbl@disc{S}{SZ}}{S}}
\declare@shorthand{magyar}{`t}{\textormath{\bbl@disc{t}{ty}}{t}}
\declare@shorthand{magyar}{`T}{\textormath{\bbl@disc{T}{TY}}{T}}
\declare@shorthand{magyar}{`z}{\textormath{\bbl@disc{z}{zs}}{z}}
\declare@shorthand{magyar}{`Z}{\textormath{\bbl@disc{Z}{ZS}}{Z}}
%    \end{macrocode}
%
%    The macro |\ldf@finish| takes care of looking for a
%    configuration file, setting the main language to be switched on
%    at |\begin{document}| and resetting the category code of
%    \texttt{@} to its original value.
% \changes{magyar-1.3h}{1996/10/30}{Now use \cs{ldf@finish} to wrap up}
%    \begin{macrocode}
\ldf@finish\CurrentOption
%</code>
%    \end{macrocode}
%
% \Finale
%%
%% \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         \~}
%%
\endinput