Opened 8 years ago
Closed 8 years ago
#16207 closed enhancement (fixed)
FiniteStateMachine._latex_: more options, better documentation
Reported by:  cheuberg  Owned by:  

Priority:  major  Milestone:  sage6.3 
Component:  combinatorics  Keywords:  finite_state_machine 
Cc:  dkrenn, skropf  Merged in:  
Authors:  Clemens Heuberger  Reviewers:  Daniel Krenn 
Report Upstream:  N/A  Work issues:  
Branch:  e5a3191 (Commits, GitHub, GitLab)  Commit:  e5a31912c6ab32068484eb7b4008cecf896c5d75 
Dependencies:  #16132, #16145, #16146, #16200, #16205  Stopgaps: 
Description
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 ofFiniteStateMachine
,FSMState
andFSMTransition
, 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 custormFiniteStateMachine.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 throughformat_letter
first. The latter now defaults to latex.
Finally,
format_transition_label
is by default set todefault_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 of1
in LaTeX. IntroduceFiniteStateMachine.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)
comment:1 Changed 8 years ago by
 Commit changed from d6661e70a561f949bab7b3f5e319e9f4d48a53b6 to 53a700c61f5f05d3193b712483dbca169055e25a
comment:2 Changed 8 years ago by
 Status changed from new to needs_review
comment:3 Changed 8 years ago by
 Commit changed from 53a700c61f5f05d3193b712483dbca169055e25a to 4aee51173f9a97e6a5ab07a2a84f425fdc070ec3
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
2d43fdd  FiniteStateMachine: add failing doctests: nonhashable colors

547968a  FiniteStateMachine.product_FiniteStateMachine, composition: fix unhashable colors

d51be51  Automaton.determinisation(): docstring on hashable colors

c5dd860  Merge branch 'fsm/state_color' into fsm/process_output_new

70294bf  trac ticket number added

ed93dd3  Minor changes during review.

3820c49  corrected whitespaceerror

a14dd81  Merge remotetracking branch 'origin/u/dkrenn/ticket/16132' into fsm/process_output_newonbeta8

afc15e5  Replaced two raise ..., ... by raise ...(...) in the spirit of #15990

4aee511  Merge ticket #16132 into #16207 in order to resolve merge conflict.

comment:4 Changed 8 years ago by
 Dependencies changed from #16146, #16200, #16205 to #16132, #16146, #16200, #16205
comment:5 Changed 8 years ago by
trac's automerge fails. Patch is based on 6.2.beta8, it merges cleanly with 6.2.rc0.
comment:6 Changed 8 years ago by
 Reviewers set to Daniel Krenn
comment:7 Changed 8 years ago by
 Commit changed from 4aee51173f9a97e6a5ab07a2a84f425fdc070ec3 to 56b1d48dfeef86415338ffe06f1de7ec6ef61142
comment:8 Changed 8 years ago by
 Commit changed from 56b1d48dfeef86415338ffe06f1de7ec6ef61142 to a0d894ef1c76c66cc17382599492487549be9314
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
f13725d  asymptotic_moments: add explanation on PolynomialRing vs SymbolicRing

878acff  asymptotic_moments: replaced parameter verbose by sage.misc.misc.verbose

40da528  Explanations for >1 final components, periodic final components

00e063e  asymptotic_moments: upgraded two tests to examples

1908a5d  asymptotic_moments: unique initial states, all states are final

78997f5  Corrected and improved version of commit 40da528

d56a769  Rewrote asymptotic_moments to output en+Order(1) etc.

24b6d69  explained the shifting in the Gray codeconstruction differently

0b1200d  Merge branch 't/16143/fsm/example_gray_code' into fsm/asymptoticmoments

a0d894e  Merge remotetracking branch 'aau/fsm/asymptoticmoments' into fsm/latexoptionsdigits

comment:9 Changed 8 years ago by
 Dependencies changed from #16132, #16146, #16200, #16205 to #16132, #16145, #16146, #16200, #16205
comment:10 Changed 8 years ago by
comment:11 Changed 8 years ago by
 Branch changed from u/cheuberg/fsm/lateximproved to u/dkrenn/fsm/lateximproved
comment:12 Changed 8 years ago by
 Commit changed from a0d894ef1c76c66cc17382599492487549be9314 to e5a31912c6ab32068484eb7b4008cecf896c5d75
 Status changed from needs_review to positive_review
finished my review; everything is fine; corrected one PEP8spacing.
New commits:
e5a3191  corrected one spacing (PEP8)

comment:13 Changed 8 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:14 Changed 8 years ago by
 Branch changed from u/dkrenn/fsm/lateximproved to e5a31912c6ab32068484eb7b4008cecf896c5d75
 Resolution set to fixed
 Status changed from positive_review to 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