% MANUAL.TEX % TeX source file of the Manual describing the use of Devanagari fonts % with TeX and LaTeX. % % Copyright (C) 1991 University of Groningen, The Netherlands % % Author: Frans J. Velthuis % Internet: velthuis@rc.rug.nl % Bitnet: velthuis@hgrrug5 % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 1, or (at your option) % any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. % \documentstyle[dev]{article} \textwidth 6in \oddsidemargin 0pt \evensidemargin 0pt \topmargin 0pt \addtolength{\textheight}{.5in} \parindent 0pt \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} \begin{document} \begin{titlepage} \begin{center} {\LARGE\bf Devanagari for \TeX \\ Version 1.2 \\ User Manual \\} \vspace{.5in} {\large Frans J. Velthuis \\ \copyright University of Groningen \\ The Netherlands \\ May 1991 \\} \end{center} \vfill \tableofcontents \end{titlepage} \section{Introduction} This document describes the use of a package which makes it possible to print characters from the Devanagari script. The package consists of font files, a preprocessor and macro files. It is used with the typesetting system \TeX\footnote{\TeX\ is a trademark of the American Mathematical Society} or the macro package LaTeX. It is assumed that the reader is familiar with \TeX. The next two sections explain what you need to know about creating Devanagari text. The last section (Advanced Topics) can be skipped on first reading. A source file for \TeX\ consists of plain ASCII-text. With the devanagari package it has been a design-objective to keep the format of the source text as close as possible to the accepted standards for transliteration. However, symbols like \={a} and \d{r} are not available on keyboards and have to be replaced by other symbols or groups of symbols. The table in the following section shows what has to be entered in order to produce a certain devanagari (Called DN from now on) symbol. A source text which is produced this way has to be processed by a so-called preprocessor before it can be given to \TeX\ as input. This preprocessor takes care of things like determining the shape of vowels, the formation of consonant ligatures etc. The preprocessor can work in two different modes: Hindi mode or Sanskrit mode. The difference is that in Sankrit mode all the available ligatures are used, while in Hindi mode sometimes a virama stroke is preferred. Furthermore, in Sanskrit mode a virama is automaticaly added at the end of a word if it ends in a consonant. \medskip {\bf Acknowledgement:} I would especially like to thank Rob Adriaanse, Hans Bakker, Roelf Barkhuis, Henk van Linde and Dominik Wujastyk for their advice and support. \bigskip Please send suggestions for improvement etc.\ to: E-mail: \verb+ velthuis@rc.rug.nl+ \\ Postal Mail: \\ Frans Velthuis \\ Nyensteinheerd 267 \\ 9736 TV Groningen \\ The Netherlands \newpage \section{The Characters You Type} The following table shows which character(s) to type in order to produce a character in DN. \bigskip \begin{center} \begin{tabular} {||l|l||l|l||l|l||l|l|l||@{\protect\rule{0cm}{.35cm}}} \hline {\tt a} & {\dn a} or implicit & {\tt ch} or {\tt C} & {\dnx C} & {\tt r} & {\dnx r} & {\tt f} & {\dnx\symbol{'47}} & \\ {\tt aa} or {\tt A} & {\dnx a\symbol{'101}} or {\dnx\symbol{'101}} & {\tt j} & {\dnx j} & {\tt l} & {\dnx l} & {\tt z} & {\dnx\symbol{'51}} & \\ {\tt i} & {\dnx i} or {\dnx\symbol{'105}} & {\tt jh} or {\tt J} & {\dnx J} & {\tt L} & {\dnx\symbol{'17}} & {\tt .kh} or {\tt .K} & {\dnx\symbol{'14}} & \\ {\tt ii} or {\tt I} & {\dnx I} or {\dnx\symbol{'106}} & {\tt\symbol{'176}n} & {\dnx\symbol{'32}} & {\tt v} & {\dnx v} & {\tt .g} & {\dnx\symbol{'13}} & \\ {\tt u} & {\dnx u} or {\dnx\symbol{0}} & {\tt .t} & {\dnx\symbol{'126}} & {\tt\symbol{'177}s} & {\dnx\symbol{'146}} & {\tt q} & {\dnx\symbol{'52}} & \\ {\tt uu} or {\tt U} & {\dnx U} or {\dnx\symbol{'1}} & {\tt .th} or {\tt .T} & {\dnx\symbol{'127}} & {\tt .s} & {\dnx\symbol{'161}} & {\tt .o} & {\dnx\symbol{'72}} & OM \\ {\tt .r} & {\dnx\symbol{'33}} or {\dnx\symbol{2}} & {\tt .d} & {\dnx\symbol{'130}} & {\tt s} & {\dnx s} & {\tt .a} & {\dnx\symbol{'137}} & avagraha \\ {\tt .R} & {\dnx\symbol{'21}} or {\dnx\symbol{'16}} & {\tt .dh} or {\tt .D} & {\dnx\symbol{'131}} & {\tt h} & {\dnx h} & {\tt\symbol{'176}o} & {\dnx aA\<} & English o \\ {\tt .l} & {\dnx\symbol{'30}} or {\dnx\symbol{'37}} & {\tt .n} & {\dnx\symbol{'132}} & {\tt R} & {\dnx\symbol{'167}} & {\tt\symbol{'176}a} & {\dnx\symbol{'4}} & English a \\ {\tt .L} & {\dnx\symbol{'31}} or {\dnx\symbol{'174}} & {\tt t} & {\dnx t} & {\tt Rh} & {\dnx\symbol{'170}} & {\tt .m} or {\tt M} & {\dnx\symbol{'25}} & anusv\={a}ra \\ {\tt e} & {\dnx e} or {\dnx\symbol{3}} & {\tt th} or {\tt T} & {\dnx T} & {\tt 1} & {\dnx 1} & {\tt /} & {\dnx\symbol{'40}} & candrabindu \\ {\tt ai} or {\tt E} & {\dnx e\?} or {\dnx\symbol{'173}} & {\tt d} & {\dnx d} & {\tt 2} & {\dnx 2} & {\tt .h} or {\tt H} & {\dnx\symbol{'54}} & visarga \\ {\tt o} & {\dnx ao} or {\dnx o} & {\tt dh} or {\tt D} & {\dnx D} & {\tt 3} & {\dnx 3} & {\tt\symbol{'174}} & {\dnx\symbol{'56}} & sentence end \\ {\tt au} or {\tt O} & {\dnx aO} or {\dnx O} & {\tt n} & {\dnx n} & {\tt 4} & {\dnx 4} & {\tt\symbol{'174}\symbol{'174}} & {\dnx\symbol{'73}} & paragraph end \\ {\tt k} & {\dnx k} & {\tt p} & {\dnx p} & {\tt 5} & {\dnx 5} & {\tt @} & {\dnx\symbol{'177}} & abbreviation \\ {\tt kh} or {\tt K} & {\dnx K} & {\tt ph} or {\tt P} & {\dnx P} & {\tt 6} & {\dnx 6} & {\tt\symbol{'43}} & {\dnx\symbol{'25}} & elliptical dot \\ {\tt g} & {\dnx g} & {\tt b} & {\dnx b} & {\tt 7} & {\dnx 7} & {\tt ..} & {\dnx\symbol{'24}} & period \\ {\tt gh} or {\tt G} & {\dnx G} & {\tt bh} or {\tt B} & {\dnx B} & {\tt 8} & {\dnx 8} & {\tt\symbol{'176}r} & {\dnx\symbol{'35}} & Marathi r \\ {\tt\symbol{'177}n} & {\dnx R} & {\tt m} & {\dnx m} & {\tt 9} & {\dnx 9} & & & \\ {\tt c} & {\dnx c} & {\tt y} & {\dnx y} & {\tt 0} & {\dnx 0} & & & \\ \hline \end{tabular} \end{center} \bigskip {\bf Notes:} \begin{itemize} \item For several DN characters there are two alternative ways to produce them. You can type two straight characters or one character with the shift key pressed, according to your preference. In cases where ambiguities might erase, using uppercase vowels is preferable: use \verb+laRAI+ instead of \verb+laRaaii+ for {\dn lwAI} \item \verb+~a+ produces an `English a' Marathi style. Compare: {\dn V\4?sF} (Hindi) and {\dn V\ x w F N Q S V W X Y Z+ and the following characters when they are not used in a combination mentioned in the table on page 2: \verb+" .+ and \verb+~+ \subsection{Plain \TeX\ Commands} The commands for loading the macro-packages, changing the font size etc. differ depending on whether you use Plain \TeX\ or LaTeX. When you prepare an input file for Plain \TeX, the following statement has to be included near the beginning of the input file (but after the preprocessor commands): \verb+\input dnmacs+ \\ There are several commands to switch to a different DN font size. Standard (10 points) size is obtained by: \verb+\dnnormal+. \verb+\dnsmall+ and \verb+\dnnine+ give smaller sizes. (8 and 9 points) The commands to switch to bigger sizes are: (in order of increasing size): \verb+\dnhalf+, \verb+\dnbig+, \verb+\dnlarge+ and \verb+\dnhuge+. These commands can be given inside as well as outside DN text. \subsection{LaTeX Commands} If you want to use the Devanagari-fonts within LaTeX, it is necessary to include \verb+dev+ as an option in the \verb+\documentstyle+ statement. Example: \verb+\documentstyle[dev]{article}+. Within LaTeX the font size is changed automatically for titles, footnotes etc. However you can change the size yourself by using the standard LaTeX size-changing commands. Example: \verb+{\large{\d+\verb+n acchaa}}+. (The inner pair of braces is necessary for the preprocessor so it can recognize DN text). \subsection{Calling the Preprocessor} After an input file is completed, it has to be processed by the preprocessor before it can be fed to \TeX\ or LaTeX. The preprocessor is called \verb+devnag+. To process an input file, type: \begin{verbatim} devnag \end{verbatim} The default file extension for an input file is \verb+.DN+ and for an output file \verb+.TEX+. If no output filename is specified then the name of the output file will be the same as that of the input file. Example: {\tt devnag hindi} will cause {\tt devnag} to read from the file {\tt hindi.dn} and write to the file {\tt hindi.tex}. If you just type: {\tt devnag} then you will be prompted for the names of the input and output file. \section{Advanced Topics} \subsection{DN Delimiters} As said before, you can use dollar-signs as well as \verb+{\d+\verb*+n + and \verb+}+ to delimit DN text. If you use dollar-signs, these signs cannot be used for other purposes, such as printing a dollar-sign or switching to mathematical mode. However, dollar-signs can be printed by means of \verb+\char36+ (in \TeX) or \verb+\symbol{36}+ (in LaTeX). Switching to mathematical mode can be accomplished in an alternative way in LaTeX by using \verb+\(+ and \verb+\)+ as delimiters of mathematical mode. The preprocessor does the following with text between DN-delimiters: \\ 1. It translates the Devanagari-text into \TeX-macro's. \\ 2. It takes care of the switch to a Devanagari-font. \\ 3. It takes care of adjustment of various \TeX-parameters. (hyphenation, line-distance etc.) \\ One can imagine situations in which not all of these functions are needed or desired. The behaviour of the preprocessor after seeing a dollar-delimiter can be defined with the preprocessor commands \verb+@dolmode1+, \verb+@dolmode2+ and \verb+@dolmode3+. The preprocessor command \verb+@dolmode1+ activates functions 1,2 and 3. This is equivalent to \verb+@dollars+. The preprocessor command \verb+@dolmode2+ activates the funtions 1 and 2, while the command \verb+@dolmode3+ only activates function 1. Using \verb+{\d+\verb+n#+ and \verb+}+ to delimit DN-text has the same effect as using dollars after specifying the \verb+@dolmode3+ command, i.e. only function 1 is activated. When the preprocessor sees \verb+{\d+\verb*+n + it always switches to DN mode, without considering the context. This means that you cannot use the string `\verb+{\d+\verb*+n +' within a `verbatim'-environment. This also means that you should not `hide' this string within the definition of another macro or command. For instance, the following construction will fail: \begin{verbatim} \def\bigdn{\dn \dnbig } {\bigdn acchaa} \end{verbatim} It should also be noted that the file-structure within DN text will not be preserved by the preprocessor. This means that single end-of-lines may appear in other places than in the original file. Because a space and an end-of-line are the same for \TeX, this will in general not influence the final output. However, it is possible to leave the carriage returns in the same place before and after processing by the preprocessor by using the \verb+@obeylines+ preprocessor command. This command should not be confused with the \verb+\obeylines+ command, which is a \TeX-command. \subsection{Hyphenation} Hyphenation is not often seen in devanagari texts. When it occurs, it is nearly always between parts of a compound word. In versions of \TeX\ before version 3.0 it is not possible to use two seperate hyphenation tables within one text file. For these reasons hyphenation is not applied to DN text. This means that \TeX\ will have more problems finding suitable line-breakpoints in DN text than in `normal' text. Therefore, when there are large pieces of DN text, it is advised to make the line-width not too small. Because hyphenation is turned off, things like `discretionary hyphens' (\verb+\-+) and \verb+\hyphenation+-commands are useless with DN text. \subsection{Line Distance} Because of the subscripts and superscripts, DN text needs more distance between lines than `latin' text. The parameter in \TeX\ that controls the distance between lines is called \verb+\baselineskip+. This parameter is increased for DN text in the macro-files. However, \TeX\ determines what the line distance whithin a paragraph has to be at the end of that paragraph. This may cause problems if a paragraph contains a mixture of DN text and `latin' text and the paragraph does not end with DN text. The value of \verb+\baselineskip+ at the end of the paragraph will be the value for `latin' text and the lines will be too close to each other. There are several solutions. In the first place you can give \verb+\baselineskip+ an explicit value before the paragraph ends. (See the macro-files for the values of \verb+\baselineskip+ for the different font-sizes.) Alternatively, you can add a piece of DN text at the end which contains just a paragraph end: \\ \verb+{\dn \par}+ \\ Even when a paragraph has only DN text, you have to take care that the paragraph end is included in the DN text. This means that the final \verb+}+ or \verb+$+ that ends the DN text must come {\it after} the empty line or the \verb+\par+ commmand that forms the paragraph end. \subsection{Ligature Commands} It is possible to enable or disable the use of ligatures for consonant groups. This is done by means of the preprocessor commands \verb+@lig+ and \verb+@nolig+. The former enables ligatures while the latter disables them. Ligatures are specified by means of numbers. The table on the following page shows the ligatures which are available together with their numbers. It possible to specify more then one ligature with a \verb+@lig+ or \verb+@nolig+ command. In that case the numbers must be seperated by spaces. There also has to be a space between the command and the first number. Example: \\ \verb+@lig 20 43 90+ \\ There is no limit to the number of \verb+@lig+ or \verb+@nolig+ preprocessor commands in a file. When the use of a ligature for a consonant group is disabled, the consonants are printed after each other and a virama (hal) sign is used. When a ligature for a certain consonant group is disabled, then all the ligatures for consonant groups which are formed by adding characters to this consonant group are also disabled. Example: If ligature 3 is disabled then ligature is 10 is also disabled. Some `standard' ligatures like {\dn +} cannot be disabled and are not in the table. In Sanskrit mode, all available ligatures are enabled. For Hindi mode the table shows which ligatures are enabled. \newpage \begin{center} {\large\bf Table of Ligatures} \medskip \begin{tabular} {||l|l|l|l||l|l|l|l||l|l|l|l||@{\protect\rule{0cm}{.4cm}}} \hline \# & consonants & lig. & hindi & \# & consonants & lig. & hindi & \# & consonants & lig. & hindi \\ \hline 1 & {\dnx k k} & {\dnx\symbol{'303}} & yes & 36 & {\dnx ^^Z c} & {\dnx\symbol{'321}} & & 71 & {\dnx d r y} & {\dnx\symbol{'357}} & yes \\ 2 & {\dnx k t } & {\dnx\symbol{'304}} & yes & 37 & {\dnx ^^Z j} & {\dnx\symbol{'322}} & & 72 & {\dnx d v y} & {\dnx\symbol{'225}} & yes \\ 3 & {\dnx k n} & {\dnx\symbol{'307}} & & 38 & {\dnx V k} & {\dnx\symbol{'326}} & yes & 73 & {\dnx D n} & {\dnx\symbol{'360}} & \\ 4 & {\dnx k m} & {\dnx\symbol{'311}} & & 39 & {\dnx V V} & {\dnx\symbol{'323}} & yes & 74 & {\dnx n n} & {\dnx\symbol{'340}} & yes \\ 5 & {\dnx k y} & {\dnx\symbol{'310}} & yes & 40 & {\dnx V W} & {\dnx\symbol{'341}} & yes & 75 & {\dnx p t} & {\dnx\symbol{'330}} & \\ 6 & {\dnx k l} & {\dnx\symbol{'312}} & & 41 & {\dnx V y} & {\dnx\symbol{'324}} & yes & 76 & {\dnx p n} & {\dnx\symbol{'331}} & \\ 7 & {\dnx k v} & {\dnx\symbol{'313}} & & 42 & {\dnx W y} & {\dnx\symbol{'325}} & yes & 77 & {\dnx p l} & {\dnx\symbol{'332}} & \\ 8 & {\dnx k t y} & {\dnx\symbol{'305}} & yes & 43 & {\dnx X g} & {\dnx\symbol{'263}} & & 78 & {\dnx b n} & {\dnx\symbol{'247}} & \\ 9 & {\dnx k t v} & {\dnx\symbol{'306}} & yes & 44 & {\dnx X G} & {\dnx\symbol{'264}} & & 79 & {\dnx b b} & {\dnx\symbol{'251}} & \\ 10 & {\dnx k n y} & {\dnx\symbol{'346}} & & 45 & {\dnx X X} & {\dnx\symbol{'345}} & yes & 80 & {\dnx b v} & {\dnx\symbol{'333}} & \\ 11 & {\dnx k r y} & {\dnx\symbol{'347}} & yes & 46 & {\dnx X m} & {\dnx\symbol{'273}} & & 81 & {\dnx B n} & {\dnx\symbol{'336}} & \\ 12 & {\dnx k v y} & {\dnx\symbol{'314}} & & 47 & {\dnx X y} & {\dnx\symbol{'267}} & yes & 82 & {\dnx m n} & {\dnx\symbol{'337}} & \\ 13 & {\dnx k t r y} & {\dnx\symbol{'374}} & yes & 48 & {\dnx X g y} & {\dnx\symbol{'270}} & & 83 & {\dnx m l} & {\dnx\symbol{'335}} & \\ 14 & {\dnx G n} & {\dnx\symbol{'315}} & & 49 & {\dnx X G r} & {\dnx\symbol{'266}} & & 84 & {\dnx l l} & {\dnx\symbol{'245}} & \\ 15 & {\dnx R k} & {\dnx\symbol{'254}} & yes & 50 & {\dnx X r y} & {\dnx\symbol{'373}} & yes & 85 & {\dnx v n} & {\dnx\symbol{'246}} & \\ 16 & {\dnx R K} & {\dnx\symbol{'262}} & yes & 51 & {\dnx Y y} & {\dnx\symbol{'344}} & yes & 86 & {\dnx v v} & {\dnx\symbol{'250}} & \\ 17 & {\dnx R g} & {\dnx\symbol{'275}} & yes & 52 & {\dnx t t} & {\dnx\symbol{'201}} & yes & 87 & {\dnx f c} & {\dnx\symbol{'226}} & \\ 18 & {\dnx R G} & {\dnx\symbol{'277}} & yes & 53 & {\dnx t n} & {\dnx\symbol{'327}} & & 88 & {\dnx f n} & {\dnx\symbol{'227}} & \\ 19 & {\dnx R R} & {\dnx\symbol{'274}} & yes & 54 & {\dnx d g} & {\dnx\symbol{'213}} & & 89 & {\dnx f b} & {\dnx\symbol{'233}} & \\ 20 & {\dnx R n} & {\dnx\symbol{'265}} & yes & 55 & {\dnx d G} & {\dnx\symbol{'212}} & & 90 & {\dnx f l} & {\dnx\symbol{'232}} & \\ 21 & {\dnx R m} & {\dnx\symbol{'301}} & yes & 56 & {\dnx d d} & {\dnx\symbol{'214}} & yes & 91 & {\dnx f v} & {\dnx\symbol{'230}} & \\ 22 & {\dnx R y} & {\dnx\symbol{'302}} & yes & 57 & {\dnx d D} & {\dnx\symbol{'210}} & yes & 92 & {\dnx q V} & {\dnx\symbol{'243}} & \\ 23 & {\dnx R k t} & {\dnx\symbol{'255}} & & 58 & {\dnx d n} & {\dnx\symbol{'221}} & & 93 & {\dnx q W} & {\dnx\symbol{'244}} & \\ 24 & {\dnx R k y} & {\dnx\symbol{'257}} & yes & 59 & {\dnx d b} & {\dnx\symbol{'223}} & yes & 94 & {\dnx q V y} & {\dnx\symbol{'367}} & \\ 25 & {\dnx R k q} & {\dnx\symbol{'260}} & & 60 & {\dnx d B} & {\dnx\symbol{'211}} & yes & 95 & {\dnx q V v} & {\dnx\symbol{'253}} & \\ 26 & {\dnx R K y} & {\dnx\symbol{'272}} & yes & 61 & {\dnx d m} & {\dnx\symbol{'224}} & & 96 & {\dnx q V r y} & {\dnx\symbol{'252}} & \\ 27 & {\dnx R g y} & {\dnx\symbol{'276}} & yes & 62 & {\dnx d y} & {\dnx\symbol{'215}} & yes & 97 & {\dnx s n} & {\dnx\symbol{'334}} & \\ 28 & {\dnx R G y} & {\dnx\symbol{'271}} & yes & 63 & {\dnx d v} & {\dnx\symbol{'222}} & yes & 98 & {\dnx s r} & {\dnx\symbol{'372}} & yes \\ 29 & {\dnx R G r} & {\dnx\symbol{'300}} & yes & 64 & {\dnx d g r} & {\dnx\symbol{'355}} & & 99 & {\dnx h Z} & {\dnx\symbol{'242}} & yes \\ 30 & {\dnx R k t y} & {\dnx\symbol{'256}} & & 65 & {\dnx d G r} & {\dnx\symbol{'356}} & & 100 & {\dnx h n} & {\dnx\symbol{'241}} & yes \\ 31 & {\dnx R k q v} & {\dnx\symbol{'261}} & & 66 & {\dnx d d y} & {\dnx\symbol{'220}} & yes & 101 & {\dnx h m} & {\dnx\symbol{'234}} & yes \\ 32 & {\dnx c c} & {\dnx\symbol{'316}} & & 67 & {\dnx d d v} & {\dnx\symbol{'370}} & yes & 102 & {\dnx h y} & {\dnx\symbol{'235}} & yes \\ 33 & {\dnx c ^^Z} & {\dnx\symbol{'317}} & & 68 & {\dnx d D y} & {\dnx\symbol{'217}} & yes & 103 & {\dnx h r} & {\dnx\symbol{'240}} & yes \\ 34 & {\dnx C y} & {\dnx\symbol{'320}} & yes & 69 & {\dnx d D v} & {\dnx\symbol{'371}} & yes & 104 & {\dnx h l} & {\dnx\symbol{'236}} & yes \\ 35 & {\dnx j r} & {\dnx\symbol{'205}} & yes & 70 & {\dnx d B y} & {\dnx\symbol{'216}} & yes & 105 & {\dnx h v} & {\dnx\symbol{'237}} & yes \\ \hline \end{tabular} \end{center} \end{document}