Last active
December 25, 2015 14:39
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The command used to compile the above, will create an outputted pdf and a png file. | |
pdflatex --shell-escape compiler.tex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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