I have this document class in which I type both in English and Greek.
\documentclass[12pt, a4]{article}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{Liberation Sans}
\usepackage{listings}
\input{listcode}
\begin{document}
english text : hello
greek text : γεια σου
\lstinputlisting{my_code.ino}
\end{document}
It works fine except from the fact that I am not permitted to type Greek characters in the remarks of the code. This is the listcode package:
\lstset{
language=C,
basicstyle=\ttfamily,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
commentstyle=\usefont{T1}{pcr}{m}{sl}\color{red},
deletekeywords={},
firstnumber=1,
frame=leftline,
framerule=2.0pt,
numbers=left,
numbersep=10pt,
numberstyle=\tiny\color{red},
rulecolor=\color{green},
showstringspaces=false,
showtabs=false,
stepnumber=1,
stringstyle=\color{blue},
tabsize=2,
}
and this is an example code:
void setup(){
}
void loop(){
//english remarks
//ελληνικά σχόλια
}
This is what happens, that is Greek characters inside the snippet do not show up at all.
I suspect that the problem has to do with this line :commentstyle=\usefont{T1},
Could someone suggest how to configure this line (or any other line)?
