I have a problem about verbatim
and listings
. I need write some codes by using Thai font but it shows in picture
\documentclass[12pt,a4paper,oneside]{book}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{xltxtra}
\usepackage{fontspec}
\usepackage{xunicode}
\defaultfontfeatures{Mapping=tex-text}
\XeTeXlinebreaklocale "th_TH"
\XeTeXlinebreakpenalty=100
\XeTeXlinebreakskip=0pt plus 1pt
\setmainfont[Scale=1.4]{TH SarabunPSK} % Thai Font
\begin{document}
\begin{verbatim}
\begin{enumerate}
\item one หนึ่ง
\item two สอง
\end{enumerate}
\end{verbatim}
\begin{lstlisting}
\begin{enumerate}
\item one หนึ่ง
\item two สอง
\end{enumerate}
\end{lstlisting}
\end{document}
But I would like to get code like lstlisting
but font like verbatim
. How to improve it.
\lstset{basicstyle=\ttfamily}
to your preamble.