TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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 have the following code that displays a listing in a paragraph. However, because there are not so many line of code, I would like to move it to the right and the paragraph be on the left hand side. I'm wondering how I can do this.

  \begin{lstlisting}[basicstyle=\scriptsize,label= mylabel, caption = mycaption}
share|improve this question
wrapfig is probably the package you are looking for – David Carlisle Dec 17 '12 at 16:01
up vote 3 down vote accepted

You can use the wrapfig package; a little example:

\usepackage{lipsum}% just to generate text for the example


\begin{lstlisting}[basicstyle=\scriptsize,label= mylabel, caption =mycaption]


enter image description here

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.