[email protected] writes:
>> Sent: Friday, June 11, 2021 at 1:25 PM
>> From: "Jacob Bachmeyer" <[email protected]>
>> To: [email protected]
>> Cc: "help-texinfo gnu" <[email protected]>
>> Subject: Re: Help using DeclareUnicodeCharacter for russian
>>
>> [email protected] wrote:
>> > I am trying to declare unicode characters for russian
>> >
>> > @macro ru
>> >
>> > \DeclareUnicodeCharacter{1040}{\ensuremath\rua}
>> > \DeclareUnicodeCharacter{1041}{\ensuremath\rube}
>> > \DeclareUnicodeCharacter{1042}{\ensuremath\ruve}
>> > \DeclareUnicodeCharacter{1043}{\ensuremath\rughe}
>> > \DeclareUnicodeCharacter{1044}{\ensuremath\rude}
>> > \DeclareUnicodeCharacter{1045}{\ensuremath\ruie}
>> > \DeclareUnicodeCharacter{1046}{\ensuremath\ruzhe}
>> > \DeclareUnicodeCharacter{1047}{\ensuremath\ruze}
>> >
>> > @end macro
>> >
>>
>> Instead of "@macro"/"@end macro", try "@tex"/"@end tex".
>>
>>
>> -- Jacob
>
> I have tried that but still get the same problem.
>
> Have also played with
>
> @documentencoding UTF-8
> @documentencoding ISO-8859-1
> @documentencoding ISO-8859-2
>
> before calling the unicode declarations.
You likely don't need \ensuremath, which looks like it is causing your
tex errors.
FI:
\ifcsname ensuremath\endcsname
\relax
\else
\message{Defining ensuremath.}
\gdef\ensuremath#1{\ifmmode{#1}\else\math{#1}\math\fi}
\fi
Leo