Sound ok exept that i won't use a name that is also a keyword and that
is meanless (as you are using grayscale, gray by it's own is a
nonsense; \definecolor{gray50}{gray}{0.5} or
\definecolor{halfgray}{gray}{0.5} sound better imho) My suggestion :
\definecolor{BoxBackground}{gray}{0.1} % 10%
\definecolor{BoxForeground}{gray}{0.9} % 90%
\definecolor{BoxBorderframe}{gray}{0.8} % 80%
\fcolorbox{BoxBorderframe}{BoxBackground}{
\color{BoxForeground} % the default text color (black) is not changed,
we had to specify the desired one if we want something else (then no
need with the default black excep if the hole is chanfed previousely)
... now comes your text :)
}
> \fcolorbox{gray}{gray}%
> {\color{white}
> \begin{verbatim}
> euca-bundle-image -i <kernel file> --kernel true
> euca-upload-bundle -b <kernel bucket> -m /tmp/<kernel file>.manifest.xml
> euca-register <kernel-bucket>/<kernel file>.manifest.xml
> \end{verbatim}
> }
>
> But this shows an error, I want something like this, black text, gray BG and black border.
I didn't test it but maybe color package don't know the color name
"white" ? I used to use those names too, but I always instruct the
package that I want to use some basic/common friendly names so:
\usepackage[usenames,dvipsnames]{color} %
http://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips
Please consider reading the package documentation (command line: texdoc color)
You may consider using the package Fancy Verbatim too (also read the
documentation)
\usepackage{fancyvrb}
\usepackage{color}
% don't forget to define your needed colors..
...
\colorbox{BoxBackgroud}{ % this trick is required because there's no
option provided for that, but you may redefine some internals used by
Verbatim if you wisth ;)
\begin{Verbatim}[frame=single, fillcolor=BoxBackground,
formatcom=\color{BoxForeground}]
% the frame use the same color as the text, otherwise add the option
rulecolor=\color{BoxBorderframe} in the list too.
\end{Verbatim}
% beware: "Verbatim" (capital v) instead of "verbatim"
}
Another solution.. listing package
\usepackage{fancyvrb}
\usepackage{color}
% don't forget to define your needed colors..
...
\lstset{language=bash, backgroundcolor=\color{BoxBackgroud},
rulecolor=\color{BoxBorderframe} }
\textcolor{BoxForeground}{ % use this trick if you don't want to use
defautlt text color and don't have time to tweek each class
ofwords/tokens used by the language ;)
\begin{lstlisting}[frame=single]
% put your listing here
\end{lstlisting}
}
Best regards
--
http://www.math.harvard.edu/computing/latex/color.html
http://mirror.ctan.org/macros/latex/contrib/xcolor/xcolor.pdf
http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/fancyvrb.pdf
http://kom.aau.dk/group/02gr506/diverse/guide%20to%20fancyvrb.pdf
ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf
Hello there,
Sorry for posting again without waiting for any answer from others.I have found out another way to do this,\usepackage{verbatim,framed}\usepackage[usenames,dvipsnames]{color}\newenvironment{colorverbatim}[1][Gray]%{%\definecolor{shadecolor}{named}{#1}%% supress ugly vertical space which is inserted by% environment above and below text:\topsep=0ex\relax% start shaded and verbatim:\shaded \verbatim \color{White}}%{%\endverbatim\endshaded}%\begin{colorverbatim}auto eth0\end{colorverbatim}This environment gives me the output I want, but still black border is needed.How to do this?
--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
Thank you all,
But I am having report class not article.
As well as I have tried this fancyverb package but this shows error in itemize...somehow, which can't figure out, why?
It prompts the error with the line that already defined or somewhat which means \item is being conflicted by using this fancyverb package in report class.
Any guess to use this in report class?
--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
Thanks Peter,For colored background and all, we are using fancyverb and others packages. If I want the same thing for itemize (Lists) or maybe for any matrix or array, then what to do?
Is there any document related to this?
As I want to study the SBox and Minipage which you have coded in last reply.Can you please explain that code if possible?
Hello there,Solution given by Peter was working fine in my previous report. But this time I am using this with my final report it making some conflicts. Below are the packages which I have used in report.\documentclass[12pt,a4paper]{report}\usepackage[pdftex]{graphicx}\DeclareGraphicsExtensions{.pdf,.jpeg,.png}\usepackage{amsthm,amssymb} % for mathematical formulas\usepackage{rotating} %used to have landskape figures\usepackage{graphicx}\usepackage{enumerate}\usepackage{epsfig}%\usepackage{algorithms}%\usepackage{algorithm}%\usepackage{algorithmic}\usepackage{pseudocode}%\usepackage{fancybox}%\usepackage{mathpazo} %for good font\usepackage{subfigure}%\usepackage{slashbox}\usepackage{pict2e}\usepackage{makeidx}%\usepackage{subfig}\usepackage{multirow}\usepackage{nomencl}% to have links to figures and citations in PDF version.\usepackage{hyperref}\usepackage{setspace}\usepackage{sectsty,fix-cm}\usepackage[svgnames]{xcolor}\usepackage{fancyvrb,fancybox,calc}
\newenvironment{colframe}{%\begin{Sbox}\begin{minipage}{\columnwidth-\leftmargin-\rightmargin-2\fboxsep-2\fboxrule-4pt}}{%\end{minipage}\end{Sbox}\begin{center}\fcolorbox{black}{LightSteelBlue}{\TheSbox}\end{center}}
I have another tex file which is included like this way...\flushbottom\include{ProposedArch}\flushbottomwhich contains the code like it...
\begin{Verbatim}{frame=single}$ ifconfig eth0 down
\end{Verbatim}
\end{colframe}
but it shows the error,! Missing number, treated as zero.<to be read again>\let1.5 \begin{colframe}?What is the problem? Which packages are being crashed with each other? I have no idea, I have done minimal examples.
///Peter --
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
///Peter --
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.