I'm using listings package to put java code in my tex files. There are some Turkish characters in the code. So, I'm using the literate directive for them to appear correctly. Everything works fine other than the "İ" character, the capital I with a dot on top. This character is not rendered correctly. My code is as follows:
\usepackage{listings}
\lstset{
language=Java,
captionpos=t,
tabsize=3,
frame=single,
frameround=tttt
backgroundcolor=\color{highlight},
basicstyle=\footnotesize\ttfamily,
keywordstyle=\color{javapurple}\bfseries,
commentstyle=\color{javagreen},
stringstyle=\color{javared},
morecomment=[s][\color{javadocblue}]{/**}{*/},
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
emph={label},
inputencoding=utf8,
extendedchars=true,
% German umlauts
literate=%
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}1
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
%Türkçe karakterler
{ı}{{\i}}1
{İ}{{\.{I}}}1 % This is the problem character.
{ğ}{{\u{g}}}1
{Ğ}{{\u{G}}}1
{ş}{{\c{s}}}1
{Ş}{{\c{S}}}1
{ç}{{\c{c}}}1
{Ç}{{\c{C}}}1
}
\begin{lstlisting}
System.out.println("Test: ı ü ğ ş ç ö, İ Ü Ğ Ş Ç Ö ");
\end{lstlisting}
The output of this is as follows:
The letter shows incorrectly with a line close to bottom of the letter. The correct output should be like "İ", with a dot on top. I have several options to solve this. But none worked. Does anybody have a solution? Thank you...
\usepackage[T1]{fontenc}
, add it to your preamble. – egreg Dec 19 '14 at 8:58fontenc
andinputenc
, you may want to consider using a 'more modern' approch, with xelatex or lualatex, which process Unicode files directly, in place of pdflatex. (That's assuming you don't already have a big investment in legacy files.) – Brent.Longborough Dec 19 '14 at 9:54