Tell me more ×
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 use \lstinline{foo} from the listings package to set pieces of code in regular text. To get automatic line-breaks I use the following options:

\lstset{
 breaklines=true,
 breakatwhitespace=true,
 breakindent=2ex,
 postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookrightarrow\space}}
}

Sometime code fragments have to go into rather narrow table cells and the automatic line breaks just don't look very nice.

Is there any way to tell \lstinline (and lstlisting) where to insert line-breaks without actually putting them into the LaTeX source literally? If I do hard code them this will influence line numbers (in lstlistings) and also the line continuation symbol and indentation will be missing.

share|improve this question
1  
Welcome to TeX.sx! – Rico Jan 20 at 17:43

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.