I have a problem with inserting a comment in lstlisting environment.
LaTeX says:
! Package inputenc Error: Unicode char \u8:�\expandafter not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H for immediate help.
...
l.49 \%komentář
Your command was ignored.
I want the character % to start a comment which ends at end of line.
I tried \lstset{morecomment=[l]\%} but I get the error above.
Here is a MWE:
\documentclass[12pt,a4paper,oneside,openany,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\usepackage{listings}
...
\begin{document}
\lstset{
language=Matlab,
comment=[l]{\%}
}
...
\begin{lstlisting}[title=Výpočet]
%komentář
code
\end{lstlisting}
...
\end{document}
\documentclass{...}and ending with\end{document}. – jub0bs Apr 19 '14 at 11:07fancyvrbpackage as an alternative, see http://tex.stackexchange.com/a/170346/48028 – Malipivo Apr 19 '14 at 12:40matlab-prettifierpackage; see this answer. – jub0bs Apr 28 '14 at 16:38