TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using listings for code snippets and I can not seem to find a way to remove the horizontal line on the bottom of a listings environment.

My code:

        basicstyle=\scriptsize\ttfamily, % Standardschrift
        numbers=left,               % Ort der Zeilennummern
        numberstyle=\color{blue!20!black!30!green}\tiny\ttfamily,          % Stil der Zeilennummern
        %stepnumber=2,               % Abstand zwischen den Zeilennummern
        numbersep=5pt,              % Abstand der Nummern zum Text
        tabsize=2,                  % Groesse von Tabs
        extendedchars=true,         %
        breaklines=true,            % Zeilen werden Umgebrochen
%        keywordstyle=[1]\textbf,    % Stil der Keywords
%        keywordstyle=[2]\textbf,    %
%        keywordstyle=[3]\textbf,    %
%        keywordstyle=[4]\textbf,   \sqrt{\sqrt{}} %
        stringstyle=\color{blue}\ttfamily, % Farbe der String
        showspaces=false,           % Leerzeichen anzeigen ?
        showtabs=false,             % Tabs anzeigen ?
        showstringspaces=false,      % Leerzeichen in Strings anzeigen ?  

enter image description here

share|improve this question
Without checking the documentation, I would guess that the line frame=b is the cause. (b for bottom.) – Torbjørn T. Jun 10 '12 at 13:07
@TorbjørnT., did the trick! – JavaCake Jun 10 '12 at 13:13
@TorbjørnT. very good! Perhaps make this an answer, or let us close it as too localized since it was caused just by an accidental setting. – Stefan Kottwitz Jun 10 '12 at 13:14
@StefanKottwitz, im quite new here, whats best-practice? – JavaCake Jun 10 '12 at 13:15
best-practice: providing an answer, as @TorbjørnT. did, if it's useful for other LaTeX users; closing as too localized if it's a small mistake or an issue which is very specific for just the questioner. And we remove the (not problem related) comments later, to keep the page clean and readable. – Stefan Kottwitz Jun 10 '12 at 13:20
up vote 7 down vote accepted

This is caused by the line


in lstset. As described in the manual, section 4.11 Frames, listings can draw complete or partial frames around the listings, with single or double lines. b is for bottom, and draws a single line at the bottom of the listings.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.