
Considere o seguinte 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}
Ele fornece a seguinte saída
(a) Aqui está a primeira linha.
(b) Aqui está a segunda linha.
No entanto, gostaria de obter a seguinte saída
\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}
Ou seja, o lado esquerdo das colunas conterá todo o texto e o lado direito das colunas conterá a saída original do código TeX. Há alguma maneira de fazer isso?
Responder1
Aqui está o seu MWE com 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}
Por favor, dê uma olhada nos exemplos fornecidos com esse pacote.
Voce deveria pegar:
Responder2
\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}
onde ex1.tex
está o seu exemplo.