Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make the grayed-round box using tiks
    primarykey
    data
    text
    <p>This is a follow-up question asked <a href="https://stackoverflow.com/questions/3275851/graying-out-texts-with-without-lines-with-latex">here</a>. I need to make a round-grayed box as is shown. </p> <p><a href="http://img707.imageshack.us/img707/9705/screenshot20100718at913.png" rel="nofollow noreferrer">http://img707.imageshack.us/img707/9705/screenshot20100718at913.png</a></p> <p>Based on the answers, I tried something, but not so fruitful. So, another questions coming.</p> <p>I came up with the following command, but it doesn't work. The verbatim inside the minipage doesn't compile. </p> <pre> \newcommand{\graybox}[1]{% \noindent\begin{tikzpicture}% \draw node[draw=black,fill=black!10,rounded corners,inner sep=2ex,text width=\mytikzwidth] {% #1 };% \end{tikzpicture}% }% %% ERROR - verbatim doesn't work. \graybox{% \begin{minipage}[b]{\mytikzwidth} ... \begin{verbatim} java -cp \$CLOJUREJAR:\$CLASSPATH clojure.lang.Script \$1 \end{verbatim} ... \end{minipage} } </pre> <p>I also tried with the environment, which also doesn't work. The minipage isn't sit inside the minipage.</p> <pre> \newenvironment{grayboxx}% {\noindent\begin{tikzpicture}% \draw node[draw=black,fill=black!10,rounded corners,inner sep=2ex,text width=\mytikzwidth] {% }% {};% \end{tikzpicture}% } </pre> <p><strong>Questions</strong></p> <ul> <li>What's wrong with the LaTeX code? How can I use verbatim environment with minipage in the tikzpicture?</li> <li>Could you teach me a better way to implement the grayboxed environment as is shown in the attached picture?</li> </ul> <p>This is the whole code, and I attached the compiled result with the compiled result.</p> <p><a href="http://a.imageshack.us/img571/7828/screenshot20100802at148.png" rel="nofollow noreferrer">http://a.imageshack.us/img571/7828/screenshot20100802at148.png</a></p> <pre> \documentclass{article} \usepackage{tikz} \newlength{\mytikzwidth} \setlength{\mytikzwidth}{\textwidth} \addtolength{\mytikzwidth}{-4ex} % this 10ex is just rule of thumb. \newcommand{\graybox}[1]{% \noindent\begin{tikzpicture}% \draw node[draw=black,fill=black!10,rounded corners,inner sep=2ex,text width=\mytikzwidth] {% #1 };% \end{tikzpicture}% }% \newenvironment{grayboxx}% {\noindent\begin{tikzpicture}% \draw node[draw=black,fill=black!10,rounded corners,inner sep=2ex,text width=\mytikzwidth] {% }% {};% \end{tikzpicture}% } \begin{document} %%%% CASE 1 - OK \begin{minipage}[b]{\mytikzwidth} clj command is as follows. \begin{verbatim} java -cp \$CLOJUREJAR:\$CLASSPATH clojure.lang.Script \$1 \end{verbatim} hello.clj needs a namespace (ns) to let the modules know about this code. \end{minipage} %%%% CASE 2 - not working with verbatim \graybox{% \begin{minipage}[b]{\mytikzwidth} clj command is as follows. %\begin{verbatim} java -cp \$CLOJUREJAR:\$CLASSPATH clojure.lang.Script \$1 %\end{verbatim} hello.clj needs a namespace (ns) to let the modules know about this code. \end{minipage} } %%%% CASE 3 - not inside the tikz \begin{grayboxx} \begin{minipage}[b]{\mytikzwidth} clj command is as follows. %\begin{verbatim} java -cp \$CLOJUREJAR:\$CLASSPATH clojure.lang.Script \$1 %\end{verbatim} hello.clj needs a namespace (ns) to let the modules know about this code. \end{minipage} \end{grayboxx} \end{document} </pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload