diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/babel/bbcompat.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/babel/bbcompat.dtx | 322 |
1 files changed, 321 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/babel/bbcompat.dtx b/Master/texmf-dist/source/latex/babel/bbcompat.dtx index 507a2fa5219..9b12be77cba 100644 --- a/Master/texmf-dist/source/latex/babel/bbcompat.dtx +++ b/Master/texmf-dist/source/latex/babel/bbcompat.dtx @@ -30,7 +30,7 @@ % % \iffalse %<*dtx> -\ProvidesFile{bbcompat.dtx}[2017/04/28 v3.9t] +\ProvidesFile{bbcompat.dtx}[2017/05/19 v3.10] %</dtx> % %% File 'bbcompat.dtx' @@ -256,6 +256,326 @@ %<+hebrew>\def\CurrentOption{hebrew} %<+hebrew>\input rlbabel.def\input hebrew.ldf\relax % \end{macrocode} +% +% \section{Internationalizing \LaTeX{} 2.09} +% +% Now that we're sure that the code is seen by \LaTeX\ only, we +% have to find out what the main (primary) document style is +% because we want to redefine some macros. This is only necessary +% for releases of \LaTeX\ dated before December~1991. Therefore +% this part of the code can optionally be included in +% \file{babel.def} by specifying the \texttt{docstrip} option +% \texttt{names}. +% +% The standard styles can be distinguished by checking whether some +% macros are defined. In table~\ref{styles} an overview is given of +% the macros that can be used for this purpose. +% \begin{table}[htb] +% \begin{center} +% \DeleteShortVerb{\|} +% \begin{tabular}{|lcp{8cm}|} +% \hline +% article & : & both the \verb+\chapter+ and \verb+\opening+ +% macros are undefined\\ +% report and book & : & the \verb+\chapter+ macro is defined and +% the \verb+\opening+ is undefined\\ +% letter & : & the \verb+\chapter+ macro is undefined and +% the \verb+\opening+ is defined\\ +% \hline +% \end{tabular} +% \caption{How to determine the main document style}\label{styles} +% \MakeShortVerb{\|} +% \end{center} +% \end{table} +% +% \noindent The macros that have to be redefined for the +% \texttt{report} and \texttt{book} document styles happen to be +% the same, so there is no need to distinguish between those two +% styles. +% +% \begin{macro}{\doc@style} +% First a parameter |\doc@style| is defined to identify the current +% document style. This parameter might have been defined by a +% document style that already uses macros instead of hard-wired +% texts, such as \file{artikel1.sty}~\cite{BEP}, so the existence of +% |\doc@style| is checked. If this macro is undefined, i.\,e., if +% the document style is unknown and could therefore contain +% hard-wired texts, |\doc@style| is defined to the default +% value~`0'. +% \changes{babel~3.0d}{1991/10/29}{Removed use of \cs{@ifundefined}} +% \begin{macrocode} +%<*names> +\ifx\@undefined\doc@style + \def\doc@style{0}% +% \end{macrocode} +% This parameter is defined in the following \texttt{if} +% construction (see table~\ref{styles}): +% +% \begin{macrocode} + \ifx\@undefined\opening + \ifx\@undefined\chapter + \def\doc@style{1}% + \else + \def\doc@style{2}% + \fi + \else + \def\doc@style{3}% + \fi% +\fi% +% \end{macrocode} +% \end{macro} +% +% \changes{babel~3.1}{1991/11/05}{Removed definition of +% \cs{if@restonecol}} +% +% Now here comes the real work: we start to redefine things and +% replace hard-wired texts by macros. These redefinitions should be +% carried out conditionally, in case it has already been done. +% +% For the \texttt{figure} and \texttt{table} environments we have +% in all styles: +% \begin{macrocode} +\@ifundefined{figurename}{\def\fnum@figure{\figurename{} \thefigure}}{} +\@ifundefined{tablename}{\def\fnum@table{\tablename{} \thetable}}{} +% \end{macrocode} +% +% The rest of the macros have to be treated differently for each +% style. When |\doc@style| still has its default value nothing +% needs to be done. +% \begin{macrocode} +\ifcase\doc@style\relax +\or +% \end{macrocode} +% +% This means that \file{babel.def} is read after the +% \texttt{article} style, where no |\chapter| and |\opening| +% commands are defined\footnote{A fact that was pointed out to me +% by Nico Poppelier and was already used in Piet van Oostrum's +% document style option~\texttt{nl}.}. +% +% First we have the |\tableofcontents|, +% |\listoffigures| and |\listoftables|: +% \begin{macrocode} +\@ifundefined{contentsname}% + {\def\tableofcontents{\section*{\contentsname\@mkboth + {\uppercase{\contentsname}}{\uppercase{\contentsname}}}% + \@starttoc{toc}}}{} +\@ifundefined{listfigurename}% + {\def\listoffigures{\section*{\listfigurename\@mkboth + {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}% + \@starttoc{lof}}}{} +\@ifundefined{listtablename}% + {\def\listoftables{\section*{\listtablename\@mkboth + {\uppercase{\listtablename}}{\uppercase{\listtablename}}}% + \@starttoc{lot}}}{} +% \end{macrocode} +% +% Then the |\thebibliography| and |\theindex| environments. +% +% \begin{macrocode} +\@ifundefined{refname}% + {\def\thebibliography#1{\section*{\refname + \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}% + \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \usecounter{enumi}}% + \def\newblock{\hskip.11em plus.33em minus.07em}% + \sloppy\clubpenalty4000\widowpenalty\clubpenalty + \sfcode`\.=1000\relax}}{} +\@ifundefined{indexname}% + {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ + \columnsep 35pt\twocolumn[\section*{\indexname}]% + \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}% + \thispagestyle{plain}% + \parskip\z@ plus.3pt\parindent\z@\let\item\@idxitem}}{} +% \end{macrocode} +% +% The |abstract| environment: +% +% \begin{macrocode} +\@ifundefined{abstractname}% + {\def\abstract{\if@twocolumn + \section*{\abstractname}% + \else \small + \begin{center}% + {\bf \abstractname\vspace{-.5em}\vspace{\z@}}% + \end{center}% + \quotation + \fi}}{} +% \end{macrocode} +% +% And last but not least, the macro |\part|: +% +% \begin{macrocode} +\@ifundefined{partname}% +{\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart + \hspace{1em}#1}\else + \addcontentsline{toc}{part}{#1}\fi + {\parindent\z@ \raggedright + \ifnum \c@secnumdepth >\m@ne + \Large \bf \partname{} \thepart + \par \nobreak + \fi + \huge \bf + #2\markboth{}{}\par}% + \nobreak + \vskip 3ex\@afterheading}% +}{} +% \end{macrocode} +% +% This is all that needs to be done for the \texttt{article} style. +% +% \begin{macrocode} +\or +% \end{macrocode} +% +% The next case is formed by the two styles \texttt{book} and +% \texttt{report}. Basically we have to do the same as for the +% \texttt{article} style, except now we must also change the +% |\chapter| command. +% +% The tables of contents, figures and tables: +% \begin{macrocode} +\@ifundefined{contentsname}% + {\def\tableofcontents{\@restonecolfalse + \if@twocolumn\@restonecoltrue\onecolumn + \fi\chapter*{\contentsname\@mkboth + {\uppercase{\contentsname}}{\uppercase{\contentsname}}}% + \@starttoc{toc}% + \csname if@restonecol\endcsname\twocolumn + \csname fi\endcsname}}{} +\@ifundefined{listfigurename}% + {\def\listoffigures{\@restonecolfalse + \if@twocolumn\@restonecoltrue\onecolumn + \fi\chapter*{\listfigurename\@mkboth + {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}% + \@starttoc{lof}% + \csname if@restonecol\endcsname\twocolumn + \csname fi\endcsname}}{} +\@ifundefined{listtablename}% + {\def\listoftables{\@restonecolfalse + \if@twocolumn\@restonecoltrue\onecolumn + \fi\chapter*{\listtablename\@mkboth + {\uppercase{\listtablename}}{\uppercase{\listtablename}}}% + \@starttoc{lot}% + \csname if@restonecol\endcsname\twocolumn + \csname fi\endcsname}}{} +% \end{macrocode} +% +% Again, the |bibliography| and |index| environments; notice that +% in this case we use |\bibname| instead of |\refname| as in the +% definitions for the \texttt{article} style. The reason for this +% is that in the \texttt{article} document style the term +% `References' is used in the definition of |\thebibliography|. In +% the \texttt{report} and \texttt{book} document styles the term +% `Bibliography' is used. +% \begin{macrocode} +\@ifundefined{bibname}% + {\def\thebibliography#1{\chapter*{\bibname + \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}% + \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}% + \leftmargin\labelwidth \advance\leftmargin\labelsep + \usecounter{enumi}}% + \def\newblock{\hskip.11em plus.33em minus.07em}% + \sloppy\clubpenalty4000\widowpenalty\clubpenalty + \sfcode`\.=1000\relax}}{} +\@ifundefined{indexname}% + {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@ + \columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]% + \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}% + \thispagestyle{plain}% + \parskip\z@ plus.3pt\parindent\z@ \let\item\@idxitem}}{} +% \end{macrocode} +% +% Here is the |abstract| environment: +% \begin{macrocode} +\@ifundefined{abstractname}% + {\def\abstract{\titlepage + \null\vfil + \begin{center}% + {\bf \abstractname}% + \end{center}}}{} +% \end{macrocode} +% +% And last but not least the |\chapter|, |\appendix| and +% |\part| macros. +% \begin{macrocode} +\@ifundefined{chaptername}{\def\@chapapp{\chaptername}}{} +% +\@ifundefined{appendixname}% + {\def\appendix{\par + \setcounter{chapter}{0}% + \setcounter{section}{0}% + \def\@chapapp{\appendixname}% + \def\thechapter{\Alph{chapter}}}}{} +% +\@ifundefined{partname}% + {\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 + \ifnum \c@secnumdepth >-2\relax + \huge\bf \partname{} \thepart + \par + \vskip 20pt \fi + \Huge \bf + #1\par}\@endpart}}{}% +\or +% \end{macrocode} +% +% Now we address the case where \file{babel.def} is read after the +% \texttt{letter} style. The \texttt{letter} document style +% defines the macro |\opening| and some other macros that are +% specific to \texttt{letter}. This means that we have to redefine +% other macros, compared to the previous two cases. +% +% First two macros for the material at the end of a letter, the +% |\cc| and |\encl| macros. +% \begin{macrocode} +\@ifundefined{ccname}% + {\def\cc#1{\par\noindent + \parbox[t]{\textwidth}% + {\@hangfrom{\rm \ccname : }\ignorespaces #1\strut}\par}}{} +\@ifundefined{enclname}% + {\def\encl#1{\par\noindent + \parbox[t]{\textwidth}% + {\@hangfrom{\rm \enclname : }\ignorespaces #1\strut}\par}}{} +% \end{macrocode} +% +% The last thing we have to do here is to redefine the +% \texttt{headings} pagestyle: +% \changes{babel~3.3}{1993/07/11}{\cs{headpagename} should be +% \cs{pagename}} +% \begin{macrocode} +\@ifundefined{headtoname}% + {\def\ps@headings{% + \def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil + \@date \hfil \pagename{} \thepage}% + \def\@oddfoot{}}}{} +\fi +%</names> +% \end{macrocode} +% +% This was the last of the four standard document styles, so if +% |\doc@style| has another value we do nothing and just close the +% \texttt{if} construction. Here ends the code that can be optionally +% included when a version of \LaTeX\ is in use that is dated +% \emph{before} December~1991. +% +% We also need to redefine a number of commands to ensure that the +% right font encoding is used, but this can't be done before +% \file{babel.def} is loaded. +% \changes{babel~3.6o}{1999/04/07}{Moved the rest of the font encoding +% related definitions to their original place} +% %% %% \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 |