FiniteStateMachine._latex_: more options, better documentation
Improved FiniteStateMachine._latex_
:
 use state iterators instead of lists
 move code format_transition_label
 collect tikz options in array
 typeset final_word_out, introduce relevant options: if a final state has an attribute final_word_out, this is typeset as a leaving edge. This is in preparation for #16191
 new method
latex_options
: Provide a new convenience function collecting all options for LaTeX output. While all of its functionality can also be achieved by directly setting attributes of FiniteStateMachine
, FSMState
and FSMTransition
, this function also (somewhat) checks its input and serves to collect documentation on all these options.
 Added a section in the introduction to the module explaining how to latex a FiniteStateMachine? and pointing to this method for details.
 Similarly, expanded explanations in
setup_latex_preamble
.
 Use
latex_options
in other doctest instead of direct attribute assignment
 new method
default_format_transition_label
: Previously, when no custorm FiniteStateMachine.format_transition_label
was provided by the user, words have simply typeset by calling latex. As words are always lists, parentheses [ ] have always been printed.
This new default method typesets words by juxtaposition of their letters, the letters are piped through format_letter
first. The latter now defaults to latex.
Finally, format_transition_label
is by default set to default_format_transition_label
in the hope of providing a sensible default value.
 Convenience Formatting functions for digit problems: When using negative digits, it is quite customary to write e.g.
\overline{1
} instead of 1
in LaTeX. Introduce FiniteStateMachine.format_letter_negative
for this purpose.
Furthermore, In digit expansions, digits are frequently processed from the least significant to the most significant position, but it is customary to write the least significant digit at the rightmost position. Therefore, the labels have to be reversed. Provide a method FiniteStateMachine.format_transition_label_reversed
for this purpose.
Change History (14)
Commit: 
d6661e70a561f949bab7b3f5e319e9f4d48a53b6 →
53a700c61f5f05d3193b712483dbca169055e25a

Status: 
new →
needs_review

Commit: 
53a700c61f5f05d3193b712483dbca169055e25a →
4aee51173f9a97e6a5ab07a2a84f425fdc070ec3

Dependencies: 
#16146, #16200, #16205 →
#16132, #16146, #16200, #16205

Reviewers: 
→ Daniel Krenn

Commit: 
4aee51173f9a97e6a5ab07a2a84f425fdc070ec3 →
56b1d48dfeef86415338ffe06f1de7ec6ef61142

Commit: 
56b1d48dfeef86415338ffe06f1de7ec6ef61142 →
a0d894ef1c76c66cc17382599492487549be9314

Dependencies: 
#16132, #16146, #16200, #16205 →
#16132, #16145, #16146, #16200, #16205

Branch: 
u/cheuberg/fsm/lateximproved →
u/dkrenn/fsm/lateximproved

Commit: 
a0d894ef1c76c66cc17382599492487549be9314 →
e5a31912c6ab32068484eb7b4008cecf896c5d75

Status: 
needs_review →
positive_review

Milestone: 
sage6.2 →
sage6.3

Branch: 
u/dkrenn/fsm/lateximproved →
e5a31912c6ab32068484eb7b4008cecf896c5d75

Resolution: 
→ fixed

Status: 
positive_review →
closed

Branch pushed to git repo; I updated commit sha1. New commits:
marked 3 doctests as indirect
Merge branch 'fsm/latexinitialstatenew' into fsm/latexrotatelabelsnew
Merge branch 'fsm/latexrotatelabelsnew' #16205 into fsm/lateximproved
replaced range by srange
replace \overline{1} by \overline{1
}Moved FiniteStateMachine._latex_.accepting_where to finite_state_machine.tikz_automata_where