2007/6/20, Bo Peng <[EMAIL PROTECTED]>:
> - I can't put any Polish letters in a listing or a listing's caption,
> because I get those errors:
>
> (listing)
> Missing $ inserted.
> Extra }, or forgotten $.
> Package inputenc Error: Keyboard character used is undefined. [You
> need to provide a definition with \DeclareInputText or
> \DeclareInputMath before using this key.]

I do not know this but please try it in plain latex. I mean, create a
minimal lyx file with a  Polish listing, export to latex and adjust
things over there. If it is supposed to work, please send the lyx file
to the devel list and I will have a look.

I've experimented a bit and found out that:

- listings package generally has problems with UTF-8 encoding, even
without Lyx, but there's a workaround - UTF-8 works inside a Latex
escape block, so if I set inputencoding=utf8 and escapechar=| and then
write comments |like this|, there are no errors

- that trick doesn't work in listing captions, but if I change the
line \inputencoding{latin1} just before \begin{lstlisting} to
\inputencoding{utf8}, it starts working. The problem is, Lyx generates
listing blocks with \inputencoding{latin1} and I don't think I can
change that... (in Document->Settings->Language I've set: Language =
Polish, Use language's default encoding = no, Encoding = utf8... So
why latin1?)

Jakub Suder

Reply via email to