
나는 현재 'The Not So Short Introduction To LaTeX'에서 LaTeX를 배우고 있으며 그 책에는 많은 예제가 나란히 표시되어 있습니다.
$a^2$ '페이지 왼쪽' ---------------------------------- '페이지 오른쪽' a^2
제가 쓰고 있는 논문에서도 같은 작업을 하고 싶은데 이에 대한 명령을 찾을 수 없는 것 같나요?
답변1
showexpl
문제를 해결하기 위해 작성되었습니다.
\documentclass[preview,border=12pt,12pt]{standalone}% change it back to article
\newlength{\parindentsave}
\AtBeginDocument{\setlength{\parindentsave}{\parindent}}
\usepackage{xcolor}
\usepackage{accsupp}
\newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}
\usepackage{showexpl}
\lstset
{
numbers=left,
numbersep=1em,
numberstyle=\tiny\color{white}\noaccsupp,% to hide number lines
frame=single,
framesep=\fboxsep,% expands outward, cannot affect if frame=none
framerule=\fboxrule,% expands outward, cannot affect if frame=none
rulecolor=\color{red},% cannot affect if frame=none
xleftmargin=\dimexpr\fboxsep+\fboxrule\relax,
xrightmargin=\dimexpr\fboxsep+\fboxrule\relax,
breaklines=true,
breakindent=0pt,
tabsize=2,
columns=flexible,
language={[LaTeX]TeX},
basicstyle=\small\ttfamily\hbox{},
keywordstyle=\color{blue},
backgroundcolor=\color{cyan!10},
pos=r,
width=0.5\linewidth,
preset=\setlength{\parindent}{\parindentsave},
explpreset={},
}
\usepackage{tikz}
\begin{document}
\begin{LTXexample}[pos=b,width=\linewidth]
Merry Christmas December 25, 2013 and Happy New Year 2014
\end{LTXexample}
\begin{LTXexample}
Solve $ax^2+bx+c=0$.
\end{LTXexample}
\LTXexample[preset=\centering]
\tikzpicture
\draw (0,0) rectangle (4,3);
\fill[red] (2,1.5) circle (1);
\endtikzpicture
\endLTXexample
\end{document}