<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[11pt]{article}

%packages
\usepackage[colorlinks,urlcolor=blue,linkcolor=blue]{hyperref}
\usepackage{tikz}
\usepackage{mathabx}
\usetikzlibrary{automata,positioning}
\usepackage{fancyhdr}
\usepackage[top=0.4in,bottom=0.4in,left=0.75in,right=0.75in,
            nofoot,head=14pt,headsep=8pt,includeheadfoot] {geometry}

%commands
\newcommand{\tkz}{Ti{\em k}Z}
\newcommand{\JFLAP}{JFLAP}
\newcommand{\jtot}{{\JFLAP}2\tkz}
\newcommand{\httpURL}[1]{\href{http://#1}{#1}}

%title
\title{\jtot}
\author{Andrew Mertz and William Slough}
\date{}

%header
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[RO,LE]{\thepage}
\fancyhead[LO,RE]{\jtot\ v1.1}

\begin{document}
\maketitle
\thispagestyle{empty}
\section*{Introduction}

\href{http://www.jflap.org}{\JFLAP}\footnote{\httpURL{www.jflap.org}} is a
popular Java program for experimenting with finite state machines, Turing
machines and other concepts from Formal Languages and Automata Theory. Version
7 of \JFLAP\ can export JPG, PNG, GIF, BMP, or SVG images. \jtot\ is a
\href{http://groovy.codehaus.org}{Groovy}\footnote{\httpURL{groovy.codehaus.org}} script
that converts a \JFLAP\ jff file representing a finite automaton, pushdown
automaton, or Turing machine into a \LaTeX\ file depicting the automaton
graphically using \tkz.

\section*{Requirements}

To use \jtot\ you will need \href{http://www.java.com}{Java}
installed. Additionally, you may find it useful to have
\href{http://groovy.codehaus.org}{Groovy} installed as well. You will
need to download either {\tt jflap2tikz.jar} (if you only have Java
installed) or {\tt jflap2tikz.groovy} (if you also have groovy
installed).

\section*{Usage}

\jtot\ is invoked from the command line with:
\begin{quote}
\begin{verbatim}
java -jar jflap2tikz.jar -i example.jff
\end{verbatim}
\end{quote}
or:
\begin{quote}
\begin{verbatim}
groovy jflap2tikz.groovy -i example.jff
\end{verbatim}
\end{quote}
In the above cases the output will be written to the console. Use the -h option
to see the full usage information, which is also given in
Figure~\ref{fig:usage}.

\begin{figure}
\begin{center}
\begin{verbatim}
usage: jflap2tikz [options]
Version 1.2
 -d,--accepting-distance &lt;distance&gt;   Distance, in pt, between the circles of an
                                      accepting state (default is 2)
 -g,--grid &lt;size&gt;                     Round positions so that they are on a
                                      grid. If a size is given it sets the
                                      spacing of the grid (default is 20.0)
 -h,--help                            Show usage information and quit
 -i,--input-file &lt;filename&gt;           Name of a JFLAP jff file representing a
                                      finite automaton, pushdown automaton, or
                                      Turing machine. If a file is not given
                                      standard input will be used.
 -k,--keep-names                      Use the state names from the JFLAP file.
                                      The default is to replace the state names
                                      with names of the form '$q_{id}$', where
                                      id is the unique state number. Note state
                                      names will not be sanitized and thus may
                                      contain invalid TeX.
 -l,--arrow-length &lt;length&gt;           Length of arrows in points (default is 9)
 -o,--output-file &lt;filename&gt;          Name of a file for writing output. If this
                                      file already exists it will be
                                      overwritten.
 -r,--rotate                          Rotate labels along edges
 -s,--scale &lt;x&gt;                       1 pixel in JFLAP = x points in LaTeX
                                      (default is 1.0)
 -w,--arrow-width &lt;width&gt;             Width of arrows in points (default is 6)
 \end{verbatim}
 \end{center}
  \caption{Usage information}
  \label{fig:usage}
\end{figure}

\section*{Examples}

The following figures show machines from the book
\href{http://www.jflap.org/jflapbook/}{JFLAP: An Interactive Formal
  Languages and Automata Package} being converted to \tkz\ using
\jtot. Note that \jtot\ currently ignores \JFLAP\ state
annotations. Furthermore, not all \JFLAP\ files will be converted
perfectly. You may have to adjust the scale and/or gridsize, or edit
the resulting \tkz\ code to achieve the effect you want. However,
\jtot\ should provide a good starting point.

\begin{figure}
  \begin{center}
    \includegraphics{examples/ex0_1a.png}
  \end{center}
  \caption{{\tt ex0.1a.jff}}
\end{figure}

\begin{figure}
  \begin{center}
    \includegraphics{examples/ex0_1a.pdf}
  \end{center}
  \caption{{\tt ex0.1a.jff} converted to \tkz\ using default values}
\end{figure}

\begin{figure}
  \begin{center}
    \includegraphics{examples/ex0_1aScale2.pdf}
  \end{center}  \caption{{\tt ex0.1a.jff} converted to \tkz\ using a scale of 2}
\end{figure}

\begin{figure}
  \begin{center}
    \includegraphics{examples/ex0_1aGrid100.pdf}
  \end{center}  \caption{{\tt ex0.1a.jff} converted to \tkz\ using a gridsize of 100}
\end{figure}

\begin{figure}
  \begin{center}
    \includegraphics[width=\textwidth]{examples/ex9-anbncn.png}
  \end{center}
  \caption{{\tt ex9-anbncn.jff}}
\end{figure}

\begin{figure}
  \begin{center}
    \includegraphics{examples/ex9-anbncn.pdf}
  \end{center}
    \caption{{\tt ex9-anbncn.jff} converted to \tkz\ using a gridsize of
    50 and label rotations on}
\end{figure}

\newpage

\section*{License}

\jtot\ and its documentation are licensed under an MIT style license

\begin{verbatim}
  Copyright (c) 2009, 2014, 2015 Andrew Mertz and William Slough

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.
\end{verbatim}

\end{document}

% LocalWords:  JFlap TikZ jff documentclass LocalWords filename gridsize nofoot
% LocalWords:  includeheadfoot anbncn codehaus www jflap jflapbook
% LocalWords:  NONINFRINGEMENT
</pre></body></html>