Text Formatting ⇒ keep indenting for source code with verbatim?
-
albinoblacksheep
- Posts: 12
- Joined: Fri Mar 05, 2010 7:53 pm
Re: keep indenting for source code with verbatim?
Thank you for the tip! I would have never found that without you I guess.
If anyone encounters the same problem as I did, here is the solution:
1) include the moreverb package: \usepackage{moreverb}
2) use \begin{verbatimtab}[4] and \end{verbatimtab}
3) C/C++/Flash... source code goes in between.
The number [4] is the tabbing width. Change it to your personal needs.
Thanks again frabjous for your great help
Sebastian
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
VictorEijkhout
- Posts: 1
- Joined: Wed Jan 05, 2011 8:13 pm
keep indenting for source code with verbatim?
Code: Select all
\catcode`\@=11
\let \saveverbatime \@xverbatim
\def \@xverbatim {\leftskip = 1cm\relax\saveverbatime}
\catcode`\@=12
Code: Select all
\makeatletter
\def\verbatim@startline{\verbatim@line{\leavevmode\kern20pt\relax}}
\makeatother