SE
I am trying to draw the image below in LaTeX using lstlisting
, tikzpicture
, minipage
, and tabular
The code that I got so far can be seen below
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usepackage{listings}
\lstset{language=C,
basicstyle=\ttfamily,
frame=single,
keywordstyle=\color{blue}\ttfamily,
stringstyle=\color{red}\ttfamily,
commentstyle=\color{green}\ttfamily,
morecomment=[l][\color{magenta}]{\#}
}
\begin{document}
\begin{minipage}{0.8\textwidth}
\begin{tikzpicture}
\draw[- >,overlay] (1.5,-2.8) -- node [below] {(int, int)} (4,-0.8);
\end{tikzpicture}
\begin{tabular}{cc}
\begin{lstlisting}[language=C]
void foo()
{
int q = 5;
int l = 6;
bar(q, l);
}
\end{lstlisting}
&
\begin{lstlisting}[language=C]
void bar(int a, int b)
{
...
...
...
...
}
\end{lstlisting}
\end{tabular}
\end{minipage}
\end{document}
The code above results in the following piece of 'art'
Is there anyone that can polish this 'art', so it looks a bit more to the target image?
With kind regards,
Xhendos
EDIT: Changed my code so it is compileable
\documentclass
, the required packages etc. Not just a fragment.