LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Vladimir Volovich <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Wed, 30 Jul 1997 02:52:26 +0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (116 lines)
This is a multi-part message in MIME format.

--------------49AD844F7440AD1D6F907B3D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I found some `bug' in \bibitem and \cite commands,
when they are used with Russian letters.
In particuler, I wanted to make it possible to use
Russian letters in four places:

  \cite[russian text]{label with russian letters}
  \bibitem[russian text]{label with russian letters}

If I use inputenc package, then any attempts
to use russian letters in these fiels would fail.
The informaiton written to AUX file is incorrect, etc...

So, I had to hack some commands in order to resolve this
problem. My solution is attached to this message.
What do you think about this? Anyway, something
should be changed in a LaTeX kernel to work
around this problem.

Currently, I use this like the following:

\documentclass{article}

\usepackage[english,russian]{babel}
\usepackage[koi8-r]{inputenc}

\input citehack  % Correct come LaTeX commands

\begin{document}

\cite[...]{...}  % here one may use Russian letters

\begin{thebibliography}

\bibitem[...]{...} Something   % here one may use Russian letters

\end{thebibliography}

\end{document}

With best regards,
                   Vladimir.

--------------49AD844F7440AD1D6F907B3D
Content-Type: application/x-tex; name="citehack.tex"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="citehack.tex"

\makeatletter

%
% This is the \IeC command (from inputenc),
% corrected thanks to David Carlisle:
%
\def\org@IeC{%
  \ifx\protect\@typeset@protect
    \expandafter\@firstofone
  \else
    \noexpand\IeC
  \fi}

\def\tmp@IeC#1{\string\IeC\space{\string#1 }}

%
% This is a modified \@bibitem command;
% we added \let\protect\noexpand, like in \@lbibitem,
% because the item may include, e.g. \IeC {...}
% or some other protected commands.
%
\def\@bibitem#1{\item\if@filesw {\let\protect\noexpand\immediate\write\@auxout
       {\string\bibcite{#1}{\the\value{\@listctr}}}}\fi\ignorespaces}

\def\@citex[#1]#2{\let\IeC\tmp@IeC\edef\reserved@a{#2}\let\IeC\org@IeC
  \let\@citea\@empty
  \@cite{\@for\@citeb:=\reserved@a\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}

\def\@newl@bel#1#2#3{\let\IeC\tmp@IeC
  \@ifundefined{#1@#2}%
    \relax
    {\gdef \@multiplelabels {%
       \@latex@warning@no@line{There were multiply-defined labels}}%
     \@latex@warning@no@line{Label `#2' multiply defined}}%
  \global\@namedef{#1@#2}{#3}\let\IeC\org@IeC}

%
% This is a modified \@testdef command taken from Babel:
%
\def\@testdef #1#2#3{%
  \let\IeC\tmp@IeC
  \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname
  \def\bbl@tempb{#3}%
  \ifx\bbl@tempa\relax\else
  \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}\fi
  \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
  \ifx \bbl@tempa \bbl@tempb
  \else \@tempswatrue \fi\let\IeC\org@IeC}

\makeatother

--------------49AD844F7440AD1D6F907B3D--

ATOM RSS1 RSS2