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 have using pdflatex and htlatex for converting framed color box in html. Successfully converted in pdflatex and not converting in htlatex. Please find the MWE below:

\documentclass{article}
\usepackage{xcolor,listings,caption}

\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{%
\parbox{\textwidth}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}\vskip-4pt}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\lstset{frame=lrb,xleftmargin=\fboxsep,xrightmargin=-\fboxsep}

\begin{document}


\lstset{backgroundcolor=\color{gray}}
\begin{lstlisting}[frame=single,framerule=2pt]
    for i:=maxint to 0 do
    begin
    j:=square(root(i));
    end;
\end{lstlisting}

\begin{lstlisting}[label=some-code,caption=Program Code Here]
public void here() {
    goes().the().code()
}
\end{lstlisting}

\end{document}
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.