LaTeX code example with box
Leonardo Pereira Santos <[email protected]> Wed, 7 Aug 2019 22:24:57 +0000
| Newsgroups | gmane.text.doxygen.general |
|---|---|
| Message-ID | <19D444D2299FEE43A99CCB03048F85200BBFEE0E@usaz01ws0035.ad.onsemi.com> |
Hello All!
I'm trying to get in LaTeX that nice rendering of code examples Doxygen creates dfor the HTML output. Specifically, I'm trying to place the code examples inside a box with a light gray background.
I'm re-defining the DoxyCode environment, and for code examples, in Markdown it works perfectly. But for the @example directive, the code is placed inside a DoxyParagraph, which is a list. This makes the DoxyParagraph's title and the code to overlap in the resulting PDF.
From what I could gather, the code is not inserted as a block, but each line is inserted as a \DoxyCodeLine.
Any ideas on how to make the LaTeX code examples look similar as they do in the HTML output?
Thank you!
My Doxycode style is
\renewenvironment{DoxyCode}[1]{%
\vspace{\fontcharht\font`A}
\par%
\scriptsize%
\normalfont\ttfamily%
\rightskip0pt plus 1fil%
\settowidth{\DoxyCodeWidth}{000000}%
\settowidth{\CodeWidthChar}{?}%
\settoheight{\CodeHeightChar}{?}%
\setlength{\parskip}{0ex plus 0ex minus 0ex}%
\ifthenelse{\equal{#1}{0}}
{
{\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces%
}
{
{\lccode`~32 \lowercase{\global\let~}}\obeyspaces%
}
\begin{tabular}{|>{\columncolor[gray]{0.9}}p{0.9\textwidth}|}%
\hline\\%
}{%
\\\\\hline%
\end{tabular}%
\normalfont%
\normalsize%
\settowidth{\CodeWidthChar}{?}%
\settoheight{\CodeHeightChar}{?}%
}
____________________________________________________________
Leonardo Pereira Santos | ON Semiconductor
Design Engineer
200-611 Kumpf Dr | Waterloo, Ontario, Canada, N2N 1A8
519-884-9696 x2269 (O) | [email protected]<mailto:[email protected]>
_______________________________________________
Doxygen-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-users