summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/drawstack
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-09 18:14:42 +0000
committerKarl Berry <karl@freefriends.org>2010-09-09 18:14:42 +0000
commit6f8ad80b630fe27ac6608c9a23305830ac19625b (patch)
tree51344b04c86d1dbaf6e029d7a40c640861e6c767 /Master/texmf-dist/doc/latex/drawstack
parent7a77819da9e5bb398ce3a5d67a1647c0e27d1366 (diff)
new latex package drawstack 1.0 (17aug10)
git-svn-id: svn://tug.org/texlive/trunk@19627 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/drawstack')
-rw-r--r--Master/texmf-dist/doc/latex/drawstack/README6
-rw-r--r--Master/texmf-dist/doc/latex/drawstack/stack-example.pdfbin0 -> 55599 bytes
-rw-r--r--Master/texmf-dist/doc/latex/drawstack/stack-example.tex163
3 files changed, 169 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/drawstack/README b/Master/texmf-dist/doc/latex/drawstack/README
new file mode 100644
index 00000000000..388191c406c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/drawstack/README
@@ -0,0 +1,6 @@
+This is a simple LaTeX package to easily draw execution stack
+(typically to illustrate assembly language notions), written
+on top of TikZ.
+
+Author's name: Matthieu Moy
+License type: lppl \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/drawstack/stack-example.pdf b/Master/texmf-dist/doc/latex/drawstack/stack-example.pdf
new file mode 100644
index 00000000000..b74d38cba73
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/drawstack/stack-example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/drawstack/stack-example.tex b/Master/texmf-dist/doc/latex/drawstack/stack-example.tex
new file mode 100644
index 00000000000..863b0981bed
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/drawstack/stack-example.tex
@@ -0,0 +1,163 @@
+ %% stack-example.tex
+ %% Copyright 2010 Matthieu Moy <Matthieu.Moy@imag.fr>
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.3
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Matthieu Moy.
+ %
+ % This work consists of the files drawstack.sty and the example file
+ % stack-example.tex.
+
+\documentclass{article}
+
+\usepackage{drawstack}
+
+% Use this instead if you don't want colors.
+% \usepackage[nocolor]{drawstack}
+
+\title{{\tt drawstack.sty}: Draw execution stack easily in LaTeX}
+\author{Matthieu Moy}
+
+\begin{document}
+\maketitle
+
+{\tt drawstack} is a LaTeX package to easily draw execution stack
+(typically to illustrate assembly language notions), written on top of
+TikZ. This file serves as an example of usage of {\tt drawstack}, and
+serves as documentation for this package. Read the source code and
+comments to see how to use it.
+
+\section{Minimalistic example}
+
+% The main feature of the package is to define an environment
+% drawstack.
+\begin{drawstack}
+ % Within the environment, draw stack elements with \cell{...}
+ \cell{First cell}
+ \cell{Second cell}
+\end{drawstack}
+
+\section{Grouping cells into stack frames}
+
+\begin{drawstack}
+ \startframe
+ \cell{First cell}
+ \cell{Second cell}
+ \finishframe{Some stack frame}
+ \cell{Not interesting}
+ \startframe
+ \cell{Next stack frame}
+ \cell{Next stack frame}
+ \finishframe{Another stack frame}
+\end{drawstack}
+
+\section{Stack and Base pointers}
+
+\begin{drawstack}
+ \startframe
+ % \cellcom writes something on the right-hand side of a cell.
+ \cell{loc2} \cellcom{-8(\%ebp)}
+ \cell{loc1} \cellcom{-4(\%ebp)}
+ % \esp and \ebp are stack pointer and base pointer in Pentium.
+ % These macros are simple shortcuts for \cellptr{...}
+ \cell{Sauvegarde \%ebp} \esp \ebp
+ \cell{@ retour} \cellcom{4(\%ebp)}
+ \finishframe{fonction\\ {\tt f}}
+ \startframe
+ \cell{} \cellcom{8(\%ebp)}
+ \cell{}
+ \finishframe{fonction\\ {\tt main}}
+\end{drawstack}
+
+\section{Padding}
+
+\begin{drawstack}
+ \cell{above padding}
+ \padding{3}{nothing here}
+ \cell{below padding}
+\end{drawstack}
+
+\section{Below/Above stack pointer}
+
+\begin{drawstack}
+ \cell{Top}
+ \cell{Below top}
+ % \bcell is just like \cell, but in a different color.
+ \bcell{Above bottom} \cellptr{Stack pointer here}
+ \bcell{Bottom}
+\end{drawstack}
+
+\section{Highlighting some cell}
+
+\begin{drawstack}
+ \cell{Uninteresting cell}
+ \cell{Interesting cell} \cellround{Yes, this one!}
+\end{drawstack}
+
+\section{Using tikzpicture instead of drawstack}
+
+% The environment drawstack is basically a syntactic sugar for
+%
+% \begin{tikzpicture}[#1]
+% \stacktop{}
+% ...
+% \stackbottom
+% \end{tikzpicture}
+%
+% You can use the above syntax for more flexibility.
+
+\begin{tikzpicture}[scale=0.8]
+ \small
+ \stacktop{}
+ \cell{My cell}
+ \stackbottom{}
+\end{tikzpicture}
+
+\section{Changing style}
+
+{% tikzstyle will be local to this {...}
+\tikzstyle{freecell}=[fill=blue!10,draw=blue!30!black]
+\tikzstyle{occupiedcell}=[fill=blue!10!orange!10,draw=blue!30!black]
+\tikzstyle{padding}=[fill=yellow!20,draw=blue!30!black]
+\tikzstyle{highlight}=[draw=orange!50!black,text=orange!50!black]
+
+\begin{drawstack}
+ \cell{Uninteresting cell}
+ \cell{Interesting cell} \cellround{Yes, this one!}
+ \bcell{bcell}
+ \padding{2}{Padding}
+\end{drawstack}
+}
+
+\section{Example: Computing Factorial}
+
+\begin{drawstack}[scale=0.8]
+ \startframe
+ \cell{N = 1}
+ \cell{...}
+ \finishframe{fact(1)}
+ \startframe
+ \cell{N = 2}
+ \cell{...}
+ \finishframe{fact(2)}
+ \cell{$\vdots$}
+ \startframe
+ \cell{N = 5}
+ \cell{...}
+ \finishframe{fact(5)}
+\end{drawstack}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End: