GeneralVerbatim code examples and wrapping text around images

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
evanesco
Posts: 6
Joined: Wed Mar 14, 2007 11:52 pm

Verbatim code examples and wrapping text around images

Post by evanesco »

Hi everybody, I've got some questions about LaTeX.

One is, how can I insert text in verbatim and the output, in two columns, like in "The Not So Short Introduction to LaTeX2e"? That is, like the examples.

And the second one is, how can I write around a graphic? If I put a picture, can I write a text that starts just to the top right side of the graphic, instead of under it?

I hope you understand me. :oops:

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Verbatim code examples and wrapping text around images

Post by localghost »

For the first problem i would suggest two minipage environments side by side, where one of them contains the source code and the other has the output. For the other problem there is the package wrapfig, which allows to place a picture and let text flow around by providing the environment wrapfigure. An alternative could be the picins package.
evanesco
Posts: 6
Joined: Wed Mar 14, 2007 11:52 pm

Verbatim code examples and wrapping text around images

Post by evanesco »

localghost wrote: For the first problem i would suggest two minipage environments side by side, where one of them contains the source code and the other has the output. For the other problem there is the package wrapfig, which allows to place a picture and let text flow around by providing the environment wrapfigure. An alternative could be the picins package.


Minipage goes perfect, thanks. ;) I will see the graphics' one later.
evanesco
Posts: 6
Joined: Wed Mar 14, 2007 11:52 pm

Verbatim code examples and wrapping text around images

Post by evanesco »

evanesco wrote:
localghost wrote: For the first problem i would suggest two minipage environments side by side, where one of them contains the source code and the other has the output. For the other problem there is the package wrapfig, which allows to place a picture and let text flow around by providing the environment wrapfigure. An alternative could be the picins package.

Minipage goes perfect, thanks. ;) I will see the graphics' one later.

When I write it in two minipages, the one in verbatim keeps on out of the box, as you can see here:
Image

Furthermore, if I want to insert it in a box, (I think it's with "framebox"), LyX shows some errors.
Image
The box with normal text is using "doublebox" and does not give any error.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Verbatim code examples and wrapping text around images

Post by localghost »

I had to search a while but i found the showexpl package, which provides a command and an environment. This should support you in a very comfortable way.
Post Reply