Holger Zebner wrote:
> What about backing up the original prettyref.sty and then translate the
> environments in the old prettyref.sty?
> Or would that give me other problems?
Theoretically not, as long as you don't need to upgrade prettyref. I don't
know if prettyref's license allows this, though.
Actually, it is quite easy to add babel support to prettyref without modifying
it. I have written a class that loads prettyref and translates the terms to
the document language, using babel. Due to my language "knowledges" and my
lazyness, it only supports (n)german and (probably wrong) french. I have
added the latter because the package works around a clash of prettyref and
french babel (it uses a non-active colon for label and prettyref). But it is
only a try anyway and can be extended to other languages easily. Furthermore,
already defined terms as \chaptername are used.
Additionally, with the option "prettyvario" varioref and prettyref can be
combined.
Maybe it is of some use for you. Note that it is my first package, so there
might be lots of bugs.
Regards,
Juergen.
%%
%% This is file `babelref.sty',
%%
%% LaTeX package for adding language options to Kevin Ruland's
%% prettyref without actually modifying that file and, optionally,
%% combining prettyref with Frank Mittelbach's varioref
%%
%% Copyright (C) 2003 Juergen Spitzmueller
%% <[EMAIL PROTECTED]>
%% Suggestions and bug reports welcome!
%%
%% This package was created for my personal needs, thus only
%% (n)german and french ist supported currently.
%% But I'd be happy about more language options.
%%
%%
%% 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 2
%% of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\NeedsTeXFormat{LaTeX2e}[1995/05/16]
\ProvidesPackage{babelref}[2003/07/26 v0.1 adding babel translations to prettyref]
\RequirePackage{prettyref}
\RequirePackage{varioref}
% for internal use only
\newcommand{\babref}[1]{\ref{#1}}
[EMAIL PROTECTED]
\PackageWarning{babelref}{Package prettyref not found!\MessageBreak
I'm afraid I cannot do anything for you without that}%
}
{%
%% Include varioref commands?
\DeclareOption{prettyvario}
{%
[EMAIL PROTECTED]
\PackageWarning{babelref}%
{You have chosen option 'prettyvario' but I don't find varioref!\MessageBreak
We have to proceed without}%
}{%
\renewcommand{\babref}[1]{\vref{#1}}
}
}
% babel mechanism taken from varioref.sty
[EMAIL PROTECTED]
#2%
[EMAIL PROTECTED]
\ifx#1\undefined
[EMAIL PROTECTED]
\else
[EMAIL PROTECTED]
[EMAIL PROTECTED]@temptokena}%
\fi
[EMAIL PROTECTED]@[EMAIL PROTECTED]
}
[EMAIL PROTECTED]@addto
%% Fallback and standard
\def\breflem {lemma}%
\def\brefthm {theorem}%
[EMAIL PROTECTED]
\def\brefsec {section}}%
{\def\brefsec {\sectionname}}
\def\brefsub {subsection}%
\def\breffot {footnote}%
%% The language options
\DeclareOption{ngerman}
[EMAIL PROTECTED]
\def\breflem {Lemma}%
\def\brefthm {Theorem}%
\def\brefsec {Abschnitt}%
\def\brefsub {Abschnitt}%
\def\breffot {Anm.}%
}
}
\DeclareOption{german}
[EMAIL PROTECTED]
\def\breflem {Lemma}%
\def\brefthm {Theorem}%
\def\brefsec {Abschnitt}%
\def\brefsub {Abschnitt}%
\def\breffot {Anm.}%
}
}
\DeclareOption{french}
[EMAIL PROTECTED]
\def\breflem {lemme}%
\def\brefthm {Th\'eor\`eme}%
\def\brefsec {section}%
\def\brefsub {sous-section}%
\def\breffot {note en bas de page}% correct?
}
%% This works around a clash of prettyref
%% with the french babel option
%% we have to make colon a passive char
%% inside label and prettyref
\let\oldlabel\label
\renewcommand*{\label}%
{\catcode`\:=12 \oldlabel}
\let\oldpref\prettyref
\renewcommand*{\prettyref}%
{\catcode`\:=12 \oldpref}
}
\DeclareOption*{%
\PackageWarning{babelref}{Unknown option}%
}
\ProcessOptions\relax
%% The prettyref definitions
\newrefformat{lem}{\breflem~\babref{#1}}%
\newrefformat{thm}{\brefthm~\babref{#1}}%
\newrefformat{prt}{\partname~\babref{#1}}%
\newrefformat{cha}{\chaptername~\babref{#1}}%
\newrefformat{sec}{\brefsec~\babref{#1}}%
\newrefformat{sub}{\brefsub~\babref{#1}}%
\newrefformat{anm}{\breffot~\babref{#1}}%
\newrefformat{app}{\appendixname~\babref{#1}}%
\newrefformat{tab}{\tablename~\babref{#1}}%
\newrefformat{fig}{\figurename~\babref{#1}}%
}
\endinput
%%
%% End of file `babelref.sty'.