Take the 2-minute tour ×
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.

I have a small tex document below, and I have tried various methods to remove the white spaces between rows, but haven't had any luck yet. Thanks! Here's the document:

\documentclass[a4paper,landscape]{article}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage[left=0cm,top=0cm,right=0cm,bottom=0cm,nohead,nofoot]{geometry}
\usepackage[T1]{fontenc}
\usepackage[scaled]{beramono}
\begin{document}
\newcolumntype{C}{>{\color[HTML]{F8F8F8}\columncolor[HTML]{000000}}l}
\newcolumntype{N}{>{\color[HTML]{000000}\columncolor[HTML]{DDF0FF}}l}
\begin{longtable}{NC}
\texttt{   1 }&\mbox{\texttt{ {\color[HTML]{E28964}def}\hspace{1ex}{\color[HTML]{89BDFF}hello}}}\\
\texttt{   2 }&\mbox{\texttt{ \hspace{1ex}\hspace{1ex}puts\hspace{1ex}{\color[HTML]{65B042}{\color[HTML]{65B042}''}Hi\hspace{1ex}guys!{\color[HTML]{65B042}''}}}}\\
\texttt{   3 }&\mbox{\texttt{ {\color[HTML]{E28964}end}}}\\
\end{longtable}
\end{document}
share|improve this question

closed as too localized by Joseph Wright Apr 15 '12 at 8:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
I don't see any whitespace: i.imgur.com/mlHs9.png maybe it's your viewer? (Have you tried zooming in/out?) –  dbaupp Mar 10 '12 at 4:27
2  
If you replace the \\ with \\[-1pt] the white space seems to go away. I'll leave this as a comment as it is too hackish, even for me... –  Peter Grill Mar 10 '12 at 5:42
2  
I tried with pdflatex and xelatex and didn't see any gaps between the rows with either pdflatex or xelatex (tl2010 versions) what versions were you and @PeterGrill using? This is likely to be a back end driver rendering issue. If you are typesetting adjacent coloured panels then even a single pixel out is disturbing if it leaves a gap. –  David Carlisle Mar 10 '12 at 11:29
1  
@DavidCarlisle: I also am on Mac TeXLive2011 (packages updated yesterday), and saw the horizontal lines in both the TeXWorks previewer and Adobe Acrobat. I have seem similar issues, and recall that at some magnifications the lines don't show, zooming in shows them, and zooming in further does not... –  Peter Grill Mar 10 '12 at 16:46
1  
@PeterGrill: I am using Ubuntu and I can't see any white lines, too. –  Marco Daniel Apr 12 '12 at 18:52