Skip to content

Instantly share code, notes, and snippets.

@leksak
Last active December 25, 2015 14:39
Show Gist options
  • Save leksak/d7e5039afcebd0a293b2 to your computer and use it in GitHub Desktop.
Save leksak/d7e5039afcebd0a293b2 to your computer and use it in GitHub Desktop.
A (standalone) sample input-output example in TikZ which is compiled with a designated output file.
# The command used to compile the above, will create an outputted pdf and a png file.
pdflatex --shell-escape compiler.tex
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\documentclass[tikz,border=3mm, convert={outfile=compiler.png}]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,positioning}
\begin{document}
\begin{tikzpicture}[>=stealth]
% Draw the labelled box. ``compiler'' is its label, and how
% it is referred to within this TikZ picture. Its displayed
% text is ``Compiler''. I.e. generically we'd write
%
% \node [draw] (nodelabel) {some text};
%
\node [draw] (compiler) {Compiler};
% Create an input node, with the text ``source program''
% which is above the box named ``compiler'', see above.
\node [above=of compiler] (input) {source program};
% Create an output node, with the text ``target program''
% which is below the box named ``compiler'', see above.
\node [below=of compiler] (output) {target program};
% Draw an arrow _from_ the input node, to the compiler node.
\draw [->] (input) -- (compiler);
% Draw an array _from_ the compiler node to the output node.
\draw [->] (compiler) -- (output);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment