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.

there is following code:

\begin{verbatim}
pc:~$ ls
folder1                Documents         folder2        New Folder  folder3
folder4444             Downloads         folder5        Pictures    Templats
\end{verbatim}

And the output is:

folder1             Documents       folder2       New Folder  folder3
folder4444             Downloads         folder5        Pictures    Templats

The thing is, that words in output are shifted. However when I use verbatim*, everything is all right, but there is ␣ character. It seems like spaces are not the same width as letters. How to output text with proper spaces? Or is there some other good method to print terminal output?

Edited:

Full code:

\documentclass[12pt,openany]{report}

\usepackage{xltxtra}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{color}
\usepackage{polski}
\usepackage{titlesec}
\usepackage{listings}
\usepackage{hyperref}
\setromanfont[Mapping=tex-text]{Linux Libertine O}

\begin{document}

\begin{verbatim}
pc:~$ ls
fffffff                Documents         gggggggggggg   New Folder  hhhhh
jjjjjjjjjjjjjjj        eeeeeeeee         kkkk           Pictures    Templates
Desktop                xxxxx             ccccccccccccc  Public      dddddd
bbbbbbbbbbbbbbbbbbbbb  fffffffffeeeeeee  jjjjj          qqqqqqqqqq  sssww
\end{verbatim}

\end{document}
share|improve this question
    
Don't see the problem in my testing. Can you provide a more complete example? –  Justin Bailey Jun 16 '11 at 20:27

1 Answer 1

up vote 9 down vote accepted

The output lines are too wide for the page. You will get warnings about overfull hboxes. I can see the shifting, but it goes away for example after making margins smaller for a quick test, so adjust font or line width.

Original example output:

original output with shift

With \usepackage[hmargin=2cm]{geometry} warnings go away and it changes:

enter image description here

share|improve this answer

Your Answer

 
discard

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.