summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/hyph-utf8/bg/azbukaExtended.tex
blob: 099309a424638f8640833fd541df0a4a95bf82da (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
\documentclass[12pt,a4paper,twosided]{article}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc} % temporary to make MakeUppercase work.
%\usepackage[english,bulgarian]{babel}
\usepackage[english,bulgarian]{babel}
\usepackage{mathptm}
\def\№{\Romannumeral}


\usepackage[bulgarian]{varioref}  % my modified varioref.sty 
                                  % waiting for the author of
                                  % varioref.sty to release this officially.
                                  % DO NOT DISTRIBUTE!

\title{Notes on Bulgarian typesetting in \LaTeX }
\author{Georgi Boshnakov}


\begin{document}

% \selectlanguage{bulgarian}

% \selectlanguage{english}

%%% "`abvg"'
%%% 
%%% \shorthandoff{"}
%%% 
%%% "`abvg"'
%%% 
%%% \shorthandon{"}
%%% 
%%% "№
%%% 
%%% 
%%% 
%%% \foreignlanguage{english}{``This is an English phrase.''}

%\enumBul

% \makeatletter
% \@Alph3, \@alph3

% \enumEng 

% \@Alph3, \@alph3

% \enumBul \@Alph3, \@alph3

% \makeatother


%%% \latintext
%%% 
%%% \textcyrillic{АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ}
%%% 
%%% \cyrillictext
%%% 
%%% \textlatin{abcdefghijklmnop}
%%% 
%%% \Bulgarian bg: ``adfafdadfafdsaf'' a'  b'
%%% 
%%% {\English eng1: ``adfafdadfafdsaf'' a'  b'}
%%% 
%%% {\selectlanguage{english} eng2: ``adfafdadfafdsaf'' a'  b'}
%%% 
%%% \selectbglanguage
%%% 
%%% 
%%% % \selectenglanguage


\maketitle

\tableofcontents

\section{Introduction} \label{sec:intro}


This document shows some features specific to the Bulgarian typesetting with babel.
The text is mainly English but the main language of the document, as far as \LaTeX{} is
concerned, is Bulgarian. This is possible because the encoding T2A  contains the latin
characters. On the other hand, the effect is that English hyphenation is not turned on and
therefore English words are not hyphenated or, if they are, they may be wrongly hyphenated. 
I have done this deliberately to emphasise that it is a good practice to change explicitly
the language.

This document was written initially for my package \texttt{bulgaria} developed in 1994-1996 to
support Bulgarian language in the then new version of \LaTeX. Since at the time the encoding
systems in general where in transition and because there was no standard for cyrillic ones I
assembled some fonts to support the MIK encoding (the prevalent encoding at the time in
Bulgaria, its origins are in DOS but it was supported in Windows as well, not by Microsoft
though). This allowed me to introduce a fully working implementation only a few months after
\LaTeX2e{} became the official \LaTeX{} version.

I later modified this to work with the Babel system the most important change being the
switch to the use of standard fonts and encodings. 
I handed this to the Babel developer Johannes Braams who is currently maintaining it. 


Prompted by some enquiries, I released the hyphenation stuff separately in may 2006.  It can
be found in the \texttt{language} subdirectory on CTAN or on my web page. 

% Note that currently the MikTeX suite replaces my hyphenation patterns (available as part of
% the babel package) with different ones which seem not to work.  So, I release my hyphenation
% files separately as well. 


Comments and suggestions are welcome. 
I do not give my email address here (because of the spamming curse) but you can easily find
me with a search engine. 
I will maintain the hyphenation and, if there is
demand, release a new set of patterns to support the more stylish traditional hyphenation
(the current patterns are the simplified ones, born in the computer age).


\section{Language and encoding} \label{sec:langenc}



There are still many encoding systems around, you need to tell \LaTeX{} which one you use.
For example, 
\begin{verbatim}
    \usepackage[cp1251]{inputenc}
\end{verbatim}
specifies the cyrillic encoding typically used in Windows. 
This line should be one of the first few lines after the \verb+\documentclass+ declaration.

The input encoding is completely independent of the internal encoding used by 
\LaTeX. You generally do not need to be concerned with it but for completeness here is the
command that specifies the internal (cyrillic) encoding \texttt{T2A}:
\begin{verbatim}
    \usepackage[T2A]{fontenc}
\end{verbatim}
This should not be needed but see the section about uppercase/lowercase below.

To change language you may use the babel assorment of commands, say 
\begin{verbatim}
   \selectlanguage{english} 
   \selectlanguage{bulgarian}
\end{verbatim}
see the user guide of Babel for details.
There are useful shorthands like 
\verb+\Bul+,
\verb+\Bg+,
\verb+\Eng+,
\verb+\latintext+,
and
\verb+\cyrillictext+.



\section{Alphabet} \label{sec:alphabet}



\subsection{Entering cyrillic letters}

The best way to enter Bulgarian text is to type it in some of the standard encodings
and leave \LaTeX\ to struggle with the conversion work (it knows most of the cyrillic
encodings).  To tell \LaTeX{} the input encoding, put near the beginning of your document a
line like
\begin{center}
\verb+\usepackage[utf8]{inputenc}+
\end{center}
if you are in the modern age and/or Linux,
or
\begin{center}
\verb+\usepackage[MIK]{inputenc}+
\end{center}
if you prefer ``classic DOS'' and the MIK encoding,
or
\begin{center}
\verb+\usepackage[cp1251]{inputenc}+
\end{center}
if you do not know what I am talking about and are on a Windows system.

This command is usually placed write after the \verb+\documentclass+ command.

If you need to enter only a couple of words you may also use commands like \verb+\cyra+,
\verb+CYRA+, \verb+\cyryu+, \verb+\CYRYU+. The number sign can be obtained by \verb+\No+ or
\verb+\textnumero+.

For example, \verb+\CYRA\CYRB\CYRV, \cyra\cyrb\cyrv+ produces
\begin{center}
\CYRA\CYRB\CYRV, \cyra\cyrb\cyrv
\end{center}

Accents in Bulgarian are used very rarely. This is done only to designate where the stress
falls in certain special circumstances (mainly to avoid confusion). For example, \verb+\`{и}+
gives \`{и}. This is unambigously a pronoun which if written without the accent may
occasionally be confused with the conjunction и (Bulgarian for ``and''). 

Warning: the shorter \verb+\`и+ works in all encodings except utf8. It is prudent to always
add the braces to avoid irritation if you decide to switch to utf8. 

% \"е


\subsection{Changing letter case (Uppercase/Lowercase)}

Use the \LaTeX{} commands \verb+\MakeLowercase+ and \verb+\MakeUppercase+ to change case of a
piece of text. For example, 

\verb+\MakeLowercase{АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ №}+

\noindent
gives

\MakeLowercase{АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ №}  

\noindent
(All letters should change to lowercase, if MakeLowercase works properly.)


\noindent
Similarly

\verb+\MakeUppercase{абвгдежзийклмнопрстуфхцчшщъыьэюя №}+

\noindent
gives

\MakeUppercase{абвгдежзийклмнопрстуфхцчшщъыьэюя №}

\noindent
% (All letters should change to uppercase, if MakeUppercase works properly.)

Note that the symbol № is unchanged by both commands since it is not a regular letter. 

If the above commands do not change the case properly, then this should be  rectified by 
including the command  \verb+\usepackage[T2A]{fontenc}+ in the preamble of your document
(this command should not be needed as T2A is the default encoding, a bug may have crawled in
somehow). If you have the \verb+.tex+ source of this file you may wish to comment out the 
\verb+usepackage+ command for package \verb+fontenc+ and compile the file to see the
difference, if any.


\subsection{The symbol №}

The symbol № is not particularly important but it is used occasionally, e.g.,

№\,1, №\,20,  №№\,1--5.

The Bulgarian keyboard has a key №. The commands 
\verb+\textnumero+ and \verb+\No+ produce № as well.


  \begin{table}  \label{table:No}
\centering
\begin{tabular}{cc}
\LaTeX{} source  & typeset output  \\ \hline
\verb+\textnumero\,3+ & \textnumero\,3 \\
\verb+\No\,3+          & \No\,3         \\
\verb+№\,3+            & №\,3 
\end{tabular}

  \end{table}



% \CYRA\CYRB\CYRV, \cyra\cyrb\cyrv


\subsection{Roman numbers}

In Bulgarian texts, uppercase Roman numbers are often used for ordinal
numbers. Most of them can be entered via the Bulgarian keyboard: the letters I and V are
available precisely for that purpose, M and C are the same in the cyrillic alphabet, but L is
missing. This does not matter much in the case of a computer keyboard. Even so,   I prefer to
redefine the I and V keys for more important tasks and leave the computer render a number in
Roman form, see also the comments in section~{sec:bugs}. 

The command \verb+\Romannumeral+ (with shorthand \verb+\№+ defined in the preamble of this
file) is provided for capitalised Roman numbers, e.g.: 
\verb+\№1+, 
\verb+\№8+, 
\verb+\№26+, 
\verb+\№{26}+,
give
\№1, \№8, \№26, and \№{26},
respectively. This example shows also that arguments with 2 or more decimal digits have to be
put in braces.


\subsection{Quoting styles}

The quotation marks in texts typeset in Bulgarian traditionally look like "`this"'. 
This style and the quotes themselves have been borrowed from the German language.

To get traditional Bulgarian style quotes enclose the text in \verb+"`+ and \verb+"'+. 
To get the French style quotes use \verb+"<+ and \verb+">+ instead. For example,

\begin{verbatim}
   ``English style quotes'' \par
   "`текст в традиционните за български текстове кавички"' \par
   "<алтернативни кавички, срещани предимно в по-стари текстове">
\end{verbatim}

\noindent
gives
% \selectlanguage{bulgarian}

\bigskip{}

   ``English style quotes'' \par
   "`текст в традиционните за български текстове кавички"' \par
   "<алтернативни кавички, срещани предимно в по-стари текстове">

% \selectlanguage{english}

\bigskip

Note that in the pre-babel \verb+bulgarian.sty+  quotes in Bulgarian texts were typeset
automatically in the traditional Bulgarian style.


\subsection{Dates}

The command \verb+\today+ produces the current date, e.g. today is \today.

In the traditional format for dates in Bulgaria uppercased roman numbers are used for the
months, e.g. today is \todayRoman.

\begin{center}
  \begin{tabular}{cc}
\LaTeX{} source  & typeset output  \\ \hline
\verb+\today+      & \today 	  \\  
\verb+\todayRoman+ & \todayRoman 
  \end{tabular}
\end{center}



\section{Hyphenation} \label{sec:hyph}


When you choose a language for \emph{babel}, \LaTeX{} hyphenates the text
according to the hyphenation rules of that language.
So, normally you do not need to do anything more to get proper hyphenation.

If your Bulgarian text does not get hyphenated, then you need to tell
the \TeX{} system to load Bulgarian hyphenation rules. The details are
system dependent but not complicated, see the documentation of your
\TeX{} distribution for details.

For example, if you are using MikTeX, start its \emph{Settings}
utility (known also as \emph{MikTeX options}, click the
\emph{Language} tab, tick \emph{bulgarian}, and click OK. MikTeX will
tell you that it needs to regenerate the formats, let it do it.  That
is it. Process a document to see that hyphenation works.

If you find words that do not hyphenate properly, then send me an email.











\section{Enumeration} \label{sec:enum}



Alphabetic enumeration is usually done with the Bulgarian alphabet but latin enumeration is
used as well.  Besides the alphabet, the style of the enumeration is somewhat different from
the English one.

We provide facilities for both cyrillic and latin enumeration. By default, the cyrillic one
is switched on by commands changing the language to Bulgarian. The declarations
\verb+\alphEng+ and \verb+\alphBul+ may be used to switch to and from latin enumeration, if
desired.

Note that the cyrillic enumeration here simply uses cyrillic letters wherever the standard
\LaTeX\ enumeration style would produce alphabetic enumeration.  This is definitely not
satisfactory and a fuller implementation might change other details but this is better left
to document classes.


The letters й, ъ, and ь are not used for enumeration and therefore omitted. Note that the
cyrillic letters э and ы are not part of the Bulgarian alphabet anyway.

\begin{enumerate}   \label{enum:1}
	\item a

	\begin{enumerate}
		\item aa
		\begin{enumerate}
			\item aaa
			\begin{enumerate}
				\item aaaa
	
				\item bbbb

				\item cccc

				\item dddd

			\end{enumerate}
	
			\item bbb

		\end{enumerate}

		\item bb

		\item cc

		\item dd

	\end{enumerate}

	\item b

\end{enumerate}


The following enumeration is preceded by the command
\verb+\enumEng+.

\enumEng 

\begin{enumerate}  \label{enum:2}
	\item a
	\begin{enumerate}
		\item aaaaaaa
		\begin{enumerate}
			\item aaaaaaa
			\begin{enumerate}
				\item aaaaaaa
	
				\item bbbbbbb

				\item cccccc

			\end{enumerate}
	
			\item bbbbbbb

			\item cccccc

		\end{enumerate}


	\end{enumerate}

	\item b

\end{enumerate}

\section{Support for the varioref package}


The package \texttt{varioref} allows for producing cross-references which look natural and
generally do not require manual intervention when the context changes. Support for Bulgarian
should be available with the next release of \LaTeX{}. This file has been produced with a
draft version of the package.

The table below is an illustration. Notice that the page reference command is the same in all cases
but the printed text changes depending on its relative distance from the reference point. 
Also, references to the current page and the facing page are automatically varied to some
extent.

\begin{center}
  
\begin{tabular}{l|l}
command & typeset output  \\  \hline
\verb+\vpageref{sec:intro}+    & \vpageref{sec:intro}            \\
\verb+\vpageref{enum:1}+       & \vpageref{enum:2}      \\
\verb+\vpageref{enum:2}+       & \vpageref{enum:2}      \\
\verb+\vpageref{table:No}+     & \vpageref{table:No} 
  
\end{tabular}
\end{center}

It is instructive to see what output would have produced if the above table turned up on the
following page. The table on the next page is generated by the same \LaTeX{} source as the
table above. There is a \verb+\newpage+ command after this paragraph to ensure that the two
tables are on different pages.


\newpage

\begin{center}
  
\begin{tabular}{l|l}
command & typeset output  \\  \hline
\verb+\vpageref{sec:intro}+    & \vpageref{sec:intro}            \\
\verb+\vpageref{enum:1}+       & \vpageref{enum:2}      \\
\verb+\vpageref{enum:2}+       & \vpageref{enum:2}      \\
\verb+\vpageref{table:No}+     & \vpageref{table:No} 
  
\end{tabular}
\end{center}



% Some text follows to  illustrate the usage of the commands in the
% \texttt{varioref}. 
% This paragraph is repeated at several places in this document, its text
% source is exactly the same but the output depends on the relative position of the referenced
% pages. Some silly page references follow. The introduction begins  
% \vpageref{sec:intro}, 
% the enumeration  \vpageref{enum:1} illustrates the default enumeration labels when
% Bulgarian is active while the enumeration \vpageref{enum:2}
% shows an alternative. 
% The table \vpageref{table:No} shows several ways to typeset \No.
% The especially dull introduction starts \vpageref{sec:intro} 
% and if this sentence is on the same page as the beginning of this paragraph the wording of
% the reference to it may be slightly different.


% Some text follows to  illustrate the usage of the commands in the
% \texttt{varioref}. 
% This paragraph is repeated at several places in this document, its text
% source is exactly the same but the output depends on the relative position of the referenced
% pages. Some silly page references follow. The introduction begins  
% \vpageref{sec:intro}, 
% the enumeration  \vpageref{enum:1} illustrates the default enumeration labels when
% Bulgarian is active while the enumeration \vpageref{enum:2}
% shows an alternative. 
% The table \vpageref{table:No} shows several ways to typeset \No.
% The especially dull introduction starts \vpageref{sec:intro} 
% and if this sentence is on the same page as the beginning of this paragraph the wording of
% the reference to it may be slightly different.
% 
% Some text follows to  illustrate the usage of the commands in the
% \texttt{varioref}. 
% This paragraph is repeated at several places in this document, its text
% source is exactly the same but the output depends on the relative position of the referenced
% pages. Some silly page references follow. The introduction begins  
% \vpageref{sec:intro}, 
% the enumeration  \vpageref{enum:1} illustrates the default enumeration labels when
% Bulgarian is active while the enumeration \vpageref{enum:2}
% shows an alternative. 
% The table \vpageref{table:No} shows several ways to typeset \No.
% The especially dull introduction starts \vpageref{sec:intro} 
% and if this sentence is on the same page as the beginning of this paragraph the wording of
% the reference to it may be slightly different.

\section{Reporting bugs and requesting features} \label{sec:bugs}

Please email me bug reports and requests for features, visit my web page at the
University of Manchester for further information.

I am using Emacs for typesetting documents. Emacs~22 has good support for essentially all
writing systems in the world. AucTeX is an amazing Emacs package which makes an excellent
environment for writing  LaTeX (and other ``dialects'' of TeX) documents). 
Another Emacs package, ESS (Emacs speaks statistics), integrates Emacs smoothly with some of
the major statistical systems. 

If you are using Emacs but have not considered AucTeX yet, do it!
If you do computations with systems such as R, S-plus or SAS, consider ESS.

If you are not an Emacs user you may consider becoming one. Together with the above tools it
may become your basic working environment. Be prepared though for a period of familiarisation
with the idiosyncracies of Emacs, it will help if you have a friend with some experience with
it.   

 


\end{document}





% \edef\myNo{\textnumero}

% \expandafter\meaning\csname T2A\endcsname

% \expandafter\meaning\csname T2A-cmd\endcsname

% \meaning\myNo

% \myNo: \csname \myNo \endcsname

%\selectlanguage{bulgarian}
% \labelenumii  
% \theenumii

% \meaning\textnumero

% \meaning\No

% \csname TeX \endcsname


% \Romannumeral  7

% \expandafter a\csname Romannumeral \endcsname 7

% \csname №\endcsname 

% \def\proba#1{\char#1}

% \proba 88, \proba{88}

% a: \expandafter\string\csname\proba157 \endcsname

% char65:\ \ \expandafter\string\csname \char65 \endcsname

% char157:   \expandafter\string\csname \char157 \endcsname

% char cyra:   \expandafter\string\expandafter\csname \cyra \endcsname

% \def\aaaa{aaaa}

% aaaa: \expandafter\string\csname \aaaa \endcsname

% \meaning\cyrzh

\makeatletter

\meaning\roman

\meaning\alph
 
\meaning\verbatim@font

\meaning\normalfont

\makeatother

\meaning\bulgarianhyphenmins

\meaning\englishhyphenmins

cyr. enc: \cyrillicencoding

\meaning\inputencoding

\meaning\frac

\expandafter\string\csname \the\CYRYA \endcsname

\begin{verbatim}

This is verbatim text. It contains both latin and cyrillic letters.
АБВГД ЕЖЗИЙ КЛМНОП РСТУФХЦ ЧШЩЪЫ ЬЭЮЯ

\end{verbatim}