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.

Could you please provide a working example in which a source code delimited by listings environment word wraps its lines, without breaking the column layout of sciposter?

Whenever I put a long line in the middle column, for instance, it is rendered until it ends (\textwidth is the limit), therefore breaking the column layout.

Hope that makes sense.

EDIT:

Setting the breaklines flag solved the word-wrapping problem.

http://stackoverflow.com/questions/981020/how-to-force-line-wrapping-in-listings-package

share|improve this question
1  
It is always best to compose a MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. If you can't get it to compile at least post what you have attempted so far. –  Peter Grill Nov 12 '11 at 2:12
    
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Mar 2 at 14:02

1 Answer 1

To get automatic line breaking with listings you need to specify breaklines=true:

enter image description here

\documentclass{article}
\usepackage{listings}

\lstset{basicstyle=\small\sffamily,
  numbers=none,
  frame=tb,
  columns=fullflexible,
  showstringspaces=false,
  breaklines=true
}

\begin{document}
\begin{lstlisting}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur nulla a ante ullamcorper sed mattis massa fringilla. Mauris et leo nisl. Sed tortor lorem, vestibulum ut fermentum a, sollicitudin in arcu. Vivamus leo purus, imperdiet quis scelerisque et, varius non enim. Nunc scelerisque velit et dui porttitor at vulputate lorem convallis. Nam vitae erat ac urna semper adipiscing. Proin quis justo nibh. Proin ultricies ultricies libero. Nunc sodales sapien vel purus ultricies sodales. Curabitur non semper magna. Nullam varius dapibus leo, ac imperdiet nulla tempus vitae. In et turpis ut turpis facilisis tristique. Phasellus interdum, justo a semper aliquam, ante diam consequat justo, a egestas nisi lorem sit amet erat. Nam justo nunc, vulputate ac luctus et, ullamcorper eu mi. Pellentesque ut dui nulla, ut sagittis dui. Donec eget ligula non dui tristique auctor at vel sapien. 
\end{lstlisting}
\end{document}
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.