1

When I use the option [frame=single] for LTXexample, the frame around the LaTeX code gets poor vertical alignment with respect to the formatted output, especially for one-line coding.

How can we get the two frames to align vertically?

Thanks!

\documentclass{article}
\usepackage{showexpl}
\begin{document}
\begin{LTXexample}[frame=single,numbers=none]
\TeX
\end{LTXexample}
\end{document}

enter image description here

1 Answer 1

0

I found a solution that adding a \hbox{} or \mbox{} for the \basicstyle option in this post: Displaying Examples Side By Side

It works, although the heights of the two frames differ slightly, but it's acceptable.

\documentclass{article}
\usepackage{showexpl}
\begin{document}
\begin{LTXexample}[frame=single, basicstyle=\small\ttfamily\hbox{}, numbers=none]
\TeX{}
\end{LTXexample}
\end{document}

enter image description here

Different solutions using other packages can be found in this post: Side-by-side source and output when documenting a style file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .