5

Is it possible to enable a continuous vertical line on code to show indentation? I am trying to use the following code from a stackoverflow question. Originally, the documentation suggests using showtabs and change the kind of symbol using tabs.

To emulate the effect I wanted, I turned the showtabs=false to showtabs=true, and added a line just below it as tabs=$\mid$

However, you can see the side effect of using it on the image below, for example in line 7. I attempted to press space and then only tab once on line 6, but it doesn't quite end up the way I want, it tends to press the word further. Ideally line 6 and 7 would be close to the print command, and would be a continuous line.

Is there an easier way that the code referred on the question could be adapted to do this? I tend to see this indentation vertical line quite often on the blackboard lectures, but not in latex and I find it quite a good visual clue to not clutter the code when reading it.

enter image description here.

closed as unclear what you're asking by jub0bs, Mensch, Svend Tveskæg, user31729, Claudio Fiandrino Sep 12 '14 at 13:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Did you check this question? – Supernormal Nov 12 '13 at 9:48
  • 1
    Thank you, I wasn't aware of this package or post! :-) Since this one is a different package, I will wait and see if anyone has a particular solution for this current template. But I will use this one you suggested meanwhile. Edit: The only side-effect is that the current version I have loads the code directly, while this one requires to hand-edit it one by one so it is less reusable. – Oeufcoque Penteano Nov 12 '13 at 17:18
  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Sep 12 '14 at 12:40

Browse other questions tagged or ask your own question.