I am using showexpl package.
If the attribute "frame" is enabled (frame=single) then the frame enclosing code becomes larger than the frame enclosing the formated text.
However, when I disable it, both frames have the same size.
Please see my screen shot below.
I want to enable the frame such that both frames are equal to the text width.
Do you have any idea to do this?
Code: Select all
\documentclass{article}
\setlength{\textwidth}{8cm}
\usepackage{xcolor}
\usepackage{showexpl}
\lstset{%
backgroundcolor=\color{yellow},
frame=single,
framesep=\fboxsep,
framerule=1pt,
rulecolor=\color{red},
xleftmargin=2\fboxsep, % no affect for LTXexample.
xrightmargin=2\fboxsep, % no affect for LTXexample.
language=[LaTeX]TeX,
explpreset={pos=b,vsep=\fboxsep}%
}
\newcommand{\Marker}{\noindent\strut\vrule\hrulefill~\scriptsize{\color{blue}text width}~\hrulefill\vrule}
\begin{document}
\section{Frame is enabled}
\Marker
\begin{LTXexample}
frame is enabled.
\end{LTXexample}
\Marker
\section{Frame is disabled}
\Marker
\begin{LTXexample}[frame=none]
frame is disabled.
\end{LTXexample}
\Marker
\end{document}