My tips and trics
This page is aimed at showing various small problems along with their solutions. It is about these annoying little things which are not worth
remembering, but from time to time they happend to be needed and even useful. The main goal of this page is to be handy for me but if someone
would find anything here useful I would be happy (if I would know about it of course :) ).
Any comments and suggestions are of course welcome.
Latex
- UTF8 characters and the Listings package [20th Dec. 2008]
-
The very useful listings package for Latex lacks full support for UTF8 encoding (the problem consists in fact in lack of support for any multibyte character encoding and not for UTF8
in particular).
If one wants to use UTF8 in Latex documents with code samples, (s)he can choose one of the following options:
- Put code samples in separate files and use the
listingsutf8 package (haven't tried that).
- Change character encoding in code samples to any one-byte encoding (presumably with the inputencoding=one_byte_encoding_name
option in the \lstset setting block).
- If the problem concerns only special characters in comments, one can follow the listing package documentation and modify:
- the lstset option block to include extendedchars option switched off:
\lstset{
inputencoding=utf8,
extendedchars=false,
...
- beginning of each code sample to include the texcl option:
\begin{lstlisting}[texcl]
Standardy