From 60b4c4c10b1d3f17d0cfd874ee2aa0c760323848 Mon Sep 17 00:00:00 2001
From: Manuel Pégourié-Gonnard <mpg@elzevir.fr>
Date: Thu, 3 Jul 2008 21:45:54 +0000
Subject: velthuis v2.15

git-svn-id: svn://tug.org/texlive/trunk@9196 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/velthuis/devanagari.sty   | 179 +++++++++------------
 1 file changed, 75 insertions(+), 104 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/velthuis/devanagari.sty')

diff --git a/Master/texmf-dist/tex/latex/velthuis/devanagari.sty b/Master/texmf-dist/tex/latex/velthuis/devanagari.sty
index 350af9b197b..3e9207f3d97 100644
--- a/Master/texmf-dist/tex/latex/velthuis/devanagari.sty
+++ b/Master/texmf-dist/tex/latex/velthuis/devanagari.sty
@@ -1,14 +1,14 @@
 %
-%    devanagari.sty v2.14
+%    devanagari.sty v2.15
 %
 %    LaTeX2e package for Devanagari for TeX system.
-%    Copyright (C) 1991-2003 University of Groningen, The Netherlands
+%    Copyright (C) 1991-2006 University of Groningen, The Netherlands
 %
 %    Author     : Dominik Wujastyk <d.wujastyk@ucl.ac.uk>
 %    Maintainer : Anshuman Pandey <apandey@u.washington.edu>
 %                 Kevin Carmody <i@kevincarmody.com>
-%                 Zdenek Wagner <wagner@cesnet.cz>
-%    Revised    : 30 March 2006
+%                 Zdenek Wagner <zdenek.wagner@gmail.com>
+%    Revised    : 18 January 2007
 %
 %    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
@@ -42,7 +42,7 @@
 % The Identification Part
 % ~~~~~~~~~~~~~~~~~~~~~~~
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesFile{devanagari.sty}[2006/05/04 v2.14 LaTeX macros for Velthuis Devanagari]
+\ProvidesPackage{devanagari}[2008/03/09 v2.15 LaTeX macros for Velthuis Devanagari]
 %
 % Error message for someone running LaTeX 2.09: Checks for definition of
 % \documentclass; it exists in LaTeX2e, but not in LaTeX 2.09
@@ -130,9 +130,13 @@
 %
 % The Main Code Part
 % ~~~~~~~~~~~~~~~~~~
+% We will need a reliable way to recognise that we are in the \dn mode.
+%
+\newif\ifdnmode
+%
 % Now define the main Devanagari macro, \dn.
 %
-\DeclareRobustCommand\dn{%
+\DeclareRobustCommand\dn{\csname originalTeX\endcsname \dnmodetrue
   \fontencoding{U}\fontfamily{\dnfamilydefault}\selectfont%
 % \language=\l@nohyphenation
   \renewcommand*{\-}{\@@hyph}%
@@ -143,7 +147,7 @@
   \csname really@do@dev@catcodes\endcsname
   \let\dn@latex@info\@latex@info  \let\@latex@info\@gobble
   \dn@commands  \let\@latex@info\dn@latex@info
-  \csname dn@captions\endcsname \cmnum}
+  \csname dn@captions\endcsname}
 %
 % Here is the macro \do@dev@catcodes that changes the catcodes
 % appropriately for Devanagari. \UnDevCatcodes restores the
@@ -202,8 +206,8 @@
               \let\dn@commands\do@dev@catcodes}%
              {\let\dn@commands\relax}
 
-\DeclareOption{catcodes}{\let\dn@commands\do@dev@catcodes}
 \DeclareOption{nocatcodes}{\let\dn@commands\relax}
+\DeclareOption{catcodes}{\let\dn@commands\do@dev@catcodes}
 \DeclareOption{compat}{\let\really@do@dev@catcodes\do@dev@catcodes}
 
 % Language options: if one of these options is defined, \dn will also
@@ -263,8 +267,6 @@
 \DeclareRobustCommand*\rs{\NormalFont\thinspace}%
 \DeclareRobustCommand\re{\thinspace}%
 \DeclareRobustCommand*\rdt{\llap{\char19}}%
-\DeclareRobustCommand*\dnnum{\let\nstyle=d}%
-\DeclareRobustCommand*\cmnum{\let\nstyle=r}%
 \DeclareRobustCommand*\rn[1]{\if\nstyle r{\NormalFont ##1}\else##1\fi}%
 % Switch to "pen" mode of the current family
 \DeclareRobustCommand\pen{\expandafter\dn@penselect\f@family!?}%
@@ -275,6 +277,12 @@
   \fi \fi}%
 } % end of \dn@commands
 %
+% Switch between Devanagari and CM numerals
+%
+\DeclareRobustCommand*\dnnum{\let\nstyle=d}%
+\DeclareRobustCommand*\cmnum{\let\nstyle=r}%
+\cmnum   % default
+%
 % Vedic intonation mark macros (based on Kevin Carmody's code from dnmacs.tex)
 %
 % Use these macros in DN files to enable and use Vedic intonation macros.
@@ -331,102 +339,17 @@
 \newdimen\anudep
 \newdimen\anuwid
 %
+% Fix for the table of contents and enumerations
 %
-%
-% Fixes
-% ~~~~~
-% Here are some fixes for specific situations, provided by Francois Patte.
-%
-% Because TeX interprets [ and ] of the biblabel as dn char 133 and
-% 135 the package cite is needed to use the command cite in the nagari
-% text. This section corrects this behaviour.
-% -- F. Patte.
-%
-\IfFileExists{cite.sty}
- {%
-\RequirePackage{cite} }%
-{ \newcommand\citeleft{}%
-  \newcommand\citeright{}%
-  \newcommand\citemid{}%
-\typeout{}
-\typeout{Package dev Info: Package cite.sty doesn't exist on your
- system.^^J
-\space\space\space\space\space\space\space\space\space\space
-\space\space\space\space\space\space\space
- This package is needed if you want to make bibliographies ^^J
-\space\space\space\space\space\space\space\space\space\space
-\space\space\space\space\space\space\space
-within the Devanagari text.}
-}
-\typeout{}
-%
-\renewcommand{\citeleft}{{\NormalFont\bfseries [$\!\!$[}}
-\renewcommand{\citeright}{{\NormalFont\bfseries ]$\!\!$]}}
-\renewcommand\@biblabel[1]{{\NormalFont\bfseries [$\!\!$[}#1{\NormalFont\bfseries ]$\!\!$]}}
-\renewcommand\citemid{{\LARGE{\dn\char'24 }}} %
-%
-% end the cite correction by F. Patte.
-%
-%
-% This section corrects the use of LaTeX commands within the
-% Devanagari text for those who want a nagari text with an European
-% make-up: e.g. \item in enumerate environment will produce
-% the number followed by a danda because the period stands for a danda
-% in Velthuis'translation scheme.
-% -- F. Patte.
-%
-\@ifundefined{@dev}
- {%
-  \renewcommand\@biblabel[1]{{\NormalFont\bfseries [$\!\!$[ #1 ]$\!\!$]}}
-  \renewcommand{\MakeUppercase}{}
- \newcommand{\notedn}[1]{\footnote{\dn #1}}
-%
-\@ifundefined{chapter}{}{%
-%
-\newcommand{\old@part}{} % Test if \old@part can be used.
-\let\old@part\part
-%
-\renewcommand{\part}{%
-  \@ifstar{\new@partstar}{%
-    \@ifnextchar[{\new@partopt}{\new@part}%
-  }%
-}
-\newcommand{\new@partstar}[1]{%
-  \old@part*{#1}%
-}
-\newcommand{\new@partopt}[2][]{%
-  \old@part[#1\NormalFont]{#2\NormalFont}%
-}
-\newcommand{\new@part}[1]{%
-  \old@part{#1\NormalFont}%
-}
-%
-\newcommand{\old@chapter}{} % Test if \old@chapter can be used.
-\let\old@chapter\chapter
-
-\renewcommand{\chapter}{%
-  \@ifstar{\new@chapterstar}{%
-    \@ifnextchar[{\new@chapteropt}{\new@chapter}%
-  }%
-}
-\newcommand{\new@chapterstar}[1]{%
-  \old@chapter*{#1}%
-}
-\newcommand{\new@chapteropt}[2][]{%
-  \old@chapter[#1\NormalFont]{#2\NormalFont}%
-}
-\newcommand{\new@chapter}[1]{%
-  \old@chapter{#1\NormalFont}%
-}
-}
-\newcommand{\old@starttoc}{} % Test if \old@starttoc can be used (Z. Wagner).
-\let\old@starttoc\@starttoc
-\renewcommand\@starttoc{\afterassignment\NormalFont\old@starttoc}
+\let\dn@old@starttoc\@starttoc
+\renewcommand\@starttoc{\afterassignment\NormalFont\dn@old@starttoc}
   \AtBeginDocument{%
-    \renewcommand\labelenumi{{\NormalFont\theenumi.}}%
-    \renewcommand\labelenumii{{\NormalFont(\theenumii)}}%
+    \let\dn@old@labelenumi\labelenumi
+    \let\dn@old@labelenumii\labelenumii
+    % Change the definitions in the \dn mode only
+    \renewcommand\labelenumi{\ifdnmode{\NormalFont\theenumi.}\else \dn@old@labelenumi\fi}%
+    \renewcommand\labelenumii{\ifdnmode{\NormalFont(\theenumii)}\else \dn@old@labelenumii\fi}%
   }%
-}{}
 
 % Select roman characters (comma, question and exclamation mark) from the correct
 % font, pen fonts always require italics
@@ -563,6 +486,7 @@ within the Devanagari text.}
 \def\alsoname{{\dn aOr d\?EKe}}%
 \def\alsoseename{{\dn aOr d\?EKe}}}
 
+\AtBeginDocument{%
 \providecommand\dateUSenglish{\def\today{\ifcase\month\or
   January\or February\or March\or April\or May\or June\or
   July\or August\or September\or October\or November\or December\fi
@@ -603,6 +527,7 @@ within the Devanagari text.}
 \def\tablename{Table}%
 \def\seename{see}%
 \def\alsoseename{see also}}
+}
 
 %
 % The end.
@@ -614,6 +539,52 @@ within the Devanagari text.}
 Here is the log file, created by RCS. (Log from dev.sty is also kept here.)
 
 % $Log: devanagari.sty,v $
+% Revision 1.12  2008-03-09 15:58:00  icebearsoft
+% Citation macros moved to a separate package. Switch \ifdnmode implemented. Email address corrected.
+%
+% Revision 1.11  2007/01/18 22:40:37  icebearsoft
+% I forgot to change the date...
+%
+% Revision 1.10  2007/01/18 22:38:24  icebearsoft
+% Enhanced switching to \dn so that it undoes language specific
+% modifications introduced by babel, mainly \catcodes. This should not
+% be done if invoked as a babel module because this action is done
+% within \selectlanguage{...} or \begin{otherlanguage}{...}. The module
+% will thus require another update in a short time.
+%
+% Revision 1.9  2006/11/16 10:18:18  icebearsoft
+% Packages identified by \ProvidesPackage
+%
+% Revision 1.8  2006/11/15 11:08:01  icebearsoft
+% Code which conflicts with hyperref.sty was removed. It seems that this code
+% is not used any more and one user successfully used this version with
+% a lot of other packages.
+%
+% Revision 1.7  2006/10/08 07:40:07  icebearsoft
+% Modifications by Kevin Carmody:
+% Switching between \cmum and \dnnum made simpler
+% Manual updated
+%
+% Revision 1.6  2006/09/27 08:10:22  icebearsoft
+% Default for the numerals was defined in a wrong place so that numerals did
+% not work properly unless \cmnum or \dnnum was used globally at the beginning
+% of the document.
+%
+% Revision 1.5  2006/09/26 15:54:20  icebearsoft
+% Switches \cmnum and \dnnum made global. There is some conflict between this package
+% and beng.sty: if beng.sty is loaded after devanagari.sty, global version of \cmnum
+% will cease to work.
+%
+% Revision 1.4  2006/07/01 16:39:36  icebearsoft
+% Order of option declarations changed. The Hindi language definitionn file
+% for babel explicitely requests devanagari.sty with option `nocatcodes'.
+% The new order of declarations allows to override it with `catcodes' on
+% `compat' as an option in the \documentclass command.
+%
+% Revision 1.3  2006/06/21 09:56:05  icebearsoft
+% Definition of English captions deferred in order to prevent colisions
+% with babel.
+%
 % Revision 1.2  2006/05/04 15:09:20  icebearsoft
 % \NormalFont made robust, otherwise sectioning commands do not work.
 %
@@ -719,7 +690,7 @@ Here is the log file, created by RCS. (Log from dev.sty is also kept here.)
 % o  Moved RCS log entries to after \endinput.
 %
 % Revision 1.11  1998/06/22 12:11:17  UCGADKW
-% o  added $Revision: 1.2 $ to \ProvidesFile;
+% o  added $Revision: 1.12 $ to \ProvidesFile;
 % o  moved RCS log to after \endinput.
 %
 % Revision 1.10  1998/06/22 12:10:00  UCGADKW
-- 
cgit v1.2.3

