2

My code is here,

\documentclass{article}
\usepackage{listings,xcolor}
\lstnewenvironment{code}
{\lstset{language={Matlab},
    lineskip=-1pt,
    belowskip=3pt,
    breaklines=true,
    xleftmargin=2.2em,%
    showstringspaces=false,
    showspaces=false,%
    basicstyle=\bf\tt\color{black},%
    keywordstyle=\bf\tt\color{black},%
    identifierstyle=\bf\tt\color{black},%
    commentstyle=\bf\tt\color{black},%
    %backgroundcolor=\color{gray!3},
    tabsize=2,
    columns=flexible}}
{}

\begin{document}
This is example of listings.
\begin{code}
    / sqrt(5)   1 \
    | ------- + - |
    |   2       2 |
    |             |
    | 1   sqrt(5) |
    | - - ------- |
    \ 2      2    /
\end{code}

This is verbatim example.
\begin{verbatim}
    / sqrt(5)   1 \
    | ------- + - |
    |   2       2 |
    |             |
    | 1   sqrt(5) |
    | - - ------- |
    \ 2      2    /
\end{verbatim}

\end{document}

Using XelaTeX but the result is

enter image description here

I want to get the same result. How to do?

2
  • 3
    Please give the OP time to react. Closing after 30 min is a little bit too fast, I think ...
    – Mensch
    Oct 30, 2014 at 12:05
  • Welcome to TeX.SE. Oct 30, 2014 at 15:28

0

Browse other questions tagged .