0

Hi I want to define a string in Listings but I can not do it in Turkish.

I want to write:

int[] sayılar= new int[5];'

but the output is

int[] saylar= new int[5];

How can I write Ç,ç,ı,ö,ü,ğ?

2

This should allow typing the characters you requested - basically adding more to the list of literates will allow other characters as well:

\documentclass[a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} 

\usepackage{listings}
\lstset{literate=%
    {Ç}{{\c{C}}}1
    {ç}{{\c{c}}}1
    {ı}{{\i}}1
    {ö}{{\"{o}}}1
    {ü}{{\"{u}}}1
    {ğ}{{\u{g}}}1
}

\begin{document}
This is the listing:
\begin{lstlisting}
  int[] sayılar= new int[5];
  also check: Ç,ç,ı,ö,ü,ğ
\end{lstlisting}
\end{document}
  • are you sure about =\true ? – daleif Aug 13 '14 at 21:06
  • @greyshade Cool. Let's clean up and delete those comments, so. – jub0bs Aug 13 '14 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.