I'm using the verbatim
environment to format some code.
Is there a way to set the desired number of spaces represented by a tab character?
What is the default number of spaces?
formattingverbatim
I'm using the verbatim
environment to format some code.
Is there a way to set the desired number of spaces represented by a tab character?
What is the default number of spaces?
Best Answer
If you don't need any further formatting of the verbatim stuff you can use the package
moreverb
orfancyvrb
. The provided environmentverbatimtab
bymoreverb
has an optional argument to specify the width of a tab. The packagefancyvrb
provides the optiontabsize
to speficy the width.N.b. to set the tab size in the verbatimtab environment, do the following:
Where
tabsize
is the number of spaces that the tab should represent.