# [Tex/LaTex] How to stop verbatim from converting tabs to spaces

sourcecodeverbatim

I am using verbatim to put some sample code in my document:

\begin{verbatim}
\end{verbatim}


I would like latex to preserve the tabs but instead what I am getting as output is this:

[start] printf{"Start command received"};


As you can see the tab is converted to a space. Is it not defeating the entire purpose of writing something inside verbatim? Is this normal behaviour for the verbatim environment?

P.S. I am using TexLive 2014 and TexStudio 2.8.8

Use fancyvrb:

\documentclass{article}

\usepackage{fancyvrb}

\begin{document}

Some text to surround the verbatim
\begin{Verbatim}[obeytabs]
\end{Verbatim}
Some text to surround the verbatim
\begin{Verbatim}[obeytabs,tabsize=4]