2

How to write a verbatim form of an equation on the left and its output form on the right inside a box?

yo'
  • 51,322
Jamil
  • 21

1 Answers1

8

With tcolorbox and the listings library you can show the verbatim form of your equation. you have just to add listing side text in the option of tcblisting environment

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{listings}
\begin{document}
\begin{tcblisting}{listing side text}
\[f(x)=\frac{1}{\ln x - x^2}\]
\end{tcblisting}
\end{document}  

to obtain

enter image description here

Salim Bou
  • 17,021
  • 2
  • 31
  • 76