{"id":10924,"date":"2022-11-03T14:22:49","date_gmt":"2022-11-03T18:22:49","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=10924"},"modified":"2022-11-03T14:22:49","modified_gmt":"2022-11-03T18:22:49","slug":"fsm-diagrams-in-latex","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=10924","title":{"rendered":"FSM Diagrams in LaTeX"},"content":{"rendered":"<p>I\u2019ve written several times about my use and affection for finite state automata in programming. It\u2019s amazing how often it can reduce a complex problem to a triviality. The first stage in taking advantage of this method is to draw a state transition diagram. Once you\u2019ve got the diagram, it\u2019s easy to write the code.<\/p>\n<p>After writing the code, you\u2019ll want to document the program and that will include the state diagram. Traditionally, I\u2019ve used the <a href=\"http:\/\/www.graphviz.org\/doc\/info\/lang.html\">Graphviz dot<\/a> program to produce these diagrams but it can also be done directly from LaTeX.<\/p>\n<p>Alexander Hayes has a short post that <a href=\"https:\/\/hayesall.com\/blog\/latex-automata\/\">shows how to use LaTeX to generate FSM diagrams<\/a>. It\u2019s not a comprehensive tutorial, although he does give a <a href=\"https:\/\/www.bu.edu\/math\/files\/2013\/08\/tikzpgfmanual.pdf#section.19\">link<\/a> to one, but it\u2019s still useful for getting an idea of how to produce such diagrams.<\/p>\n<p>Documentation is always a pain, of course, so it\u2019s nice to discover tools that make it easier. Even if you usually write in, say, Org mode, you can still include the requisite LaTeX for the diagrams or you can generate them separately and include the generated diagram in your text.<\/p>\n<p>The nice thing about this solution is that it uses easily available, open source tools that most developers are going to have installed anyway. If you use state diagrams and have to document them, take a look at Hayes\u2019 post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve written several times about my use and affection for finite state automata in programming. It\u2019s amazing how often it can reduce a complex problem to a triviality. The first stage in taking advantage of this method is to draw &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=10924\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[37],"class_list":["post-10924","post","type-post","status-publish","format-standard","hentry","category-general","tag-tech"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10924"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10924\/revisions"}],"predecessor-version":[{"id":10925,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10924\/revisions\/10925"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}