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.

I want to put a graphic and a little linux bash code in a textbox, like the picture blow... with the follow in problem:

  1. all in a textbox with yellow backgroud

  2. left part is a graphic (a finger)...

  3. right part is the text(annotation), title is “Note” .... bold face...

  4. annotation is in form of item (may be could use \begin{itemize} \item...)

  5. annotation may include bash code (may be could user package listings or minted)...

Could any one tell me how to implement this? some one tell me should use tikz/pgf ...

I'm a new user, so could not post images, please refer to

http://www.linuxfromscratch.org/lfs/downloads/stable/LFS_BOOK-6.8.pdf

with the top of page 221 and the top page 13。

(included by moderator:) Example

share|improve this question
    
Hi, welcome to TeX.SX. I corrected the formatting of your post so that it is displayed better. Have a look at tex.stackexchange.com/editing-help to learn how to do this. –  Martin Scharrer Mar 15 '11 at 17:01

2 Answers 2

up vote 14 down vote accepted

Here's an example that you could use as a starting point. Please refer to the documentation of the packages involved and, of course, feel free to adapt and improve my example according to your needs:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{changepage}
\usepackage{framed}
\usepackage{tikz}
\usepackage{listings}
\usepackage{bbding}

% the shaded outter frame
\newenvironment{outshaded}{%
  \def\FrameCommand{\colorbox{yellow!25}}%
  \MakeFramed {\FrameRestore}}%
 {\endMakeFramed}

% the hand pointing right, and the "Note" title 
\newcommand*\mysign{%
  \begin{tikzpicture}
    \node[circle,draw,inner sep=2pt] at (0,-0.2) {\HandRight} ;% the hand pointing
    \node at (1.53,-0.2) {\bfseries Note};
  \end{tikzpicture}}

% this environment will be used to typeset the notes
\newenvironment{note}
  {\begin{outshaded}\mysign%
    \begin{adjustwidth}{2cm}{0cm}}
  {\end{adjustwidth}\end{outshaded}}

% some adjustments for the lstlisting environment used to typeset code
\lstset{backgroundcolor=\color{LightSteelBlue!60},
  frame=trbl,
  rulecolor=\color{black!30},
  xrightmargin=7pt}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{note}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{lstlisting}
debugfs -R feature /dev/<xxx>
\end{lstlisting}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{lstlisting}
cd /tmp
tar -xzvf /path/to/sources/e2fsprogs-1.41.14.tar.gz
cd e2fsprogs-1.41.14
mkdir -v build
cd build
configure/..
make #note that we intentionally don't 'make install' here!
<misc/mke2fs -jv /dev/<xxx/.
cd /tmp
rm -rfv e2fsprogs-1.41.1
\end{lstlisting}
\end{note}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

\end{document}

The framed package was used to create the shaded outter box; the changepage package was used to increase the left margin inside the shaded box; the TikZ package was used to draw the circle with the pointing hand from the bbding package (this can be improved), and the "Note" title; the listings package was used to typeset code inside a framed and colored box.

This is the result:

enter image description here

share|improve this answer
    
Nice answer! You know you can include images to your posts using e.g. ![Text](http://url) or using the image button on top. The SX sites use imgur.com for all the images. –  Martin Scharrer Mar 16 '11 at 11:16
    
@Martin: Thank you. I've now included the image (and corrected my grammar in this comment). –  Gonzalo Medina Mar 16 '11 at 19:59

You can make this with the package "bclogo". The documentation is perhaps in french but there are some examples. The only problem is to make a new logo but you can ask the author without problem

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.