I have a book published more than 10 years ago. It contains the following code in its preamble:
\documentclass{article}
\usepackage[cp1251]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage{shortvrb}
\MakeShortVerb{\§}
\begin{document}
§\begin{i}§
\end{document}
Now I want to convert source files to unicode. However after changing cp1251
encoding to utf8
\usepackage[utf8]{inputenc}
compilation stopped with error message indicating on a problem with \MakeShortVerb{\§}
:
! Missing \endcsname inserted.
<to be read again>
\protect
l.8 \MakeShortVerb{\В§}
? h
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
? h
Sorry, I already gave what help I could...
Maybe you should try asking a human?
An error might have occurred before I noticed any problems.
``If all else fails, read the instructions.''
?
! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `utf8'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.8 \MakeShortVerb{\В§}
? r
How to bypass this problem? Nothing to say that I still want to use §
as delimiters for short verbatim text. Is shortverb
package compatible with utf8
encoding?
B
in\B...
coming from?utf8
and that you therefore get the error because there is a second character where the\endcsname
should be. The character may be encoded as a single character incp1251
but forutf8
to work with 8-bit engines, as I understand it, some apparently single characters are really a sequence of two characters.§
is a two-byte char so this can't work: you can only make short verbatim chars which are a single octet in pdfTeX.