
Considere el siguiente documento LaTeX
\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[(a)]
\item Here is the 1st line.
\item Here is the 2nd line.
\end{enumerate}
\end{document}
Da el siguiente resultado
(a) Aquí está la primera línea.
(b) Aquí está la segunda línea.
Sin embargo, me gustaría obtener el siguiente resultado.
\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[(a)]
\item Here is the 1st line. (a) Here is the 1st line.
\item Here is the 2nd line. (b) Here is the 2nd line
\end{enumerate}
\end{document}
Es decir, el lado izquierdo de las columnas contendrá el texto completo y el lado derecho de las columnas contendrá la salida original del código TeX. ¿Hay alguna manera de hacer esto?
Respuesta1
Aquí está su MWE con showexpl
:
\documentclass{article}
\usepackage{enumerate}
\usepackage[final]{showexpl}
\begin{document}
\begin{LTXexample}
\begin{enumerate}[(a)]
\item Here is the 1st line.
\item Here is the 2nd line.
\end{enumerate}
\end{LTXexample}
Another possibility in Listing~\ref{ex:test}:
\begin{LTXexample}[pos=r,rframe={},caption={Test},label=ex:test]
\begin{enumerate}[(a)]
\item Here is the 1st line.
\item Here is the 2nd line.
\end{enumerate}
\end{LTXexample}
Another possibility is:
\begin{LTXexample}[pos=r,rframe=single,numbers=none,basicstyle=\ttfamily\small,]
\begin{enumerate}[(a)]
\item Here is the 1st line.
\item Here is the 2nd line.
\end{enumerate}
\end{LTXexample}
Original environment in document:
\begin{enumerate}[(a)]
\item Here is the 1st line.
\item Here is the 2nd line.
\end{enumerate}
\end{document}
Eche un vistazo a los ejemplos proporcionados con ese paquete.
Deberías obtener:
Respuesta2
\documentclass{article}
\usepackage{verbatim}
\usepackage{enumerate}
\begin{document}
\noindent
\begin{minipage}{.42\textwidth}
\verbatiminput{ex1.tex}
\end{minipage}
\hfill
\vrule
\hfill
\begin{minipage}{.42\textwidth}
\def\documentclass#1{}
\def\usepackage#1{}
\renewenvironment{document}{}{}
\input{ex1.tex}
\end{minipage}
\end{document}
¿Dónde ex1.tex
está tu ejemplo?